1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00
DDrawCompat/DDrawCompat/Config/Settings/DisplayResolution.cpp
2022-09-27 21:44:53 +02:00

40 lines
779 B
C++

#include <Config/Settings/DisplayResolution.h>
namespace Config
{
namespace Settings
{
DisplayResolution::DisplayResolution()
: MappedSetting("DisplayResolution", DESKTOP, { {"app", APP}, {"desktop", DESKTOP} })
{
}
std::string DisplayResolution::getValueStr() const
{
try
{
return MappedSetting::getValueStr();
}
catch (const ParsingError&)
{
return std::to_string(m_value.cx) + 'x' + std::to_string(m_value.cy);
}
}
void DisplayResolution::setValue(const std::string& value)
{
try
{
MappedSetting::setValue(value);
}
catch (const ParsingError&)
{
m_value = Parser::parseResolution(value);
}
}
const SIZE DisplayResolution::APP = { 0, 0 };
const SIZE DisplayResolution::DESKTOP = { 1, 0 };
}
}