diff --git a/DDrawCompat/Config/Config.cpp b/DDrawCompat/Config/Config.cpp index 7ba390d..b8804d1 100644 --- a/DDrawCompat/Config/Config.cpp +++ b/DDrawCompat/Config/Config.cpp @@ -14,6 +14,7 @@ namespace Config Settings::DisplayRefreshRate displayRefreshRate; Settings::DisplayResolution displayResolution; Settings::DpiAwareness dpiAwareness; + Settings::FontAntialiasing fontAntialiasing; Settings::ForceD3D9On12 forceD3D9On12; Settings::FpsLimiter fpsLimiter; Settings::FullscreenMode fullscreenMode; diff --git a/DDrawCompat/Config/Config.h b/DDrawCompat/Config/Config.h index 63bc596..439bbbe 100644 --- a/DDrawCompat/Config/Config.h +++ b/DDrawCompat/Config/Config.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ namespace Config extern Settings::DisplayRefreshRate displayRefreshRate; extern Settings::DisplayResolution displayResolution; extern Settings::DpiAwareness dpiAwareness; + extern Settings::FontAntialiasing fontAntialiasing; extern Settings::ForceD3D9On12 forceD3D9On12; extern Settings::FpsLimiter fpsLimiter; extern Settings::FullscreenMode fullscreenMode; diff --git a/DDrawCompat/Config/Settings/FontAntialiasing.h b/DDrawCompat/Config/Settings/FontAntialiasing.h new file mode 100644 index 0000000..a0f3153 --- /dev/null +++ b/DDrawCompat/Config/Settings/FontAntialiasing.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +namespace Config +{ + namespace Settings + { + class FontAntialiasing : public MappedSetting + { + public: + static const UINT APP = 0; + static const UINT OFF = 1; + static const UINT ON = 2; + + FontAntialiasing() + : MappedSetting("FontAntialiasing", "app", { {"app", APP}, {"off", OFF}, {"on", ON} }) + { + } + }; + } +} diff --git a/DDrawCompat/DDrawCompat.vcxproj b/DDrawCompat/DDrawCompat.vcxproj index 6ba12af..3f4a12d 100644 --- a/DDrawCompat/DDrawCompat.vcxproj +++ b/DDrawCompat/DDrawCompat.vcxproj @@ -171,6 +171,7 @@ + diff --git a/DDrawCompat/DDrawCompat.vcxproj.filters b/DDrawCompat/DDrawCompat.vcxproj.filters index 84fa43d..d8495ac 100644 --- a/DDrawCompat/DDrawCompat.vcxproj.filters +++ b/DDrawCompat/DDrawCompat.vcxproj.filters @@ -582,6 +582,9 @@ Header Files\Common + + Header Files\Config\Settings + diff --git a/DDrawCompat/Gdi/Font.cpp b/DDrawCompat/Gdi/Font.cpp index 0f2f2a3..9cf986c 100644 --- a/DDrawCompat/Gdi/Font.cpp +++ b/DDrawCompat/Gdi/Font.cpp @@ -1,5 +1,6 @@ #include #include +#include #include namespace @@ -45,7 +46,8 @@ namespace Gdi { Mapper::Mapper(HDC dc) : m_dc(dc), m_origFont(nullptr) { - if (!dc || g_isFontSmoothingEnabled) + if (!dc || Config::Settings::FontAntialiasing::ON == Config::fontAntialiasing.get() || + g_isFontSmoothingEnabled && Config::Settings::FontAntialiasing::APP == Config::fontAntialiasing.get()) { return; } diff --git a/DDrawCompat/Overlay/ConfigWindow.cpp b/DDrawCompat/Overlay/ConfigWindow.cpp index 5f12923..64b8cbf 100644 --- a/DDrawCompat/Overlay/ConfigWindow.cpp +++ b/DDrawCompat/Overlay/ConfigWindow.cpp @@ -17,7 +17,7 @@ namespace namespace Overlay { ConfigWindow::ConfigWindow() - : Window(nullptr, { 0, 0, SettingControl::TOTAL_WIDTH, 380 }, Config::configHotKey.get()) + : Window(nullptr, { 0, 0, SettingControl::TOTAL_WIDTH, 405 }, Config::configHotKey.get()) , m_buttonCount(0) , m_focus(nullptr) { @@ -31,6 +31,7 @@ namespace Overlay addControl(Config::bltFilter); addControl(Config::antialiasing); addControl(Config::displayFilter); + addControl(Config::fontAntialiasing); addControl(Config::fpsLimiter); addControl(Config::renderColorDepth); addControl(Config::resolutionScale);