From 564d840a6254ee78827a69544c8cc984f8733b59 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 13 Mar 2017 17:46:14 +1100 Subject: [PATCH] [Glide64] Make wrpAnisotropic private --- Source/Glide64/Config.cpp | 4 ++-- Source/Glide64/Main.cpp | 4 ++-- Source/Glide64/Settings.cpp | 17 +++++++++++++---- Source/Glide64/Settings.h | 4 +++- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Source/Glide64/Config.cpp b/Source/Glide64/Config.cpp index 429b4da7e..787b6c147 100644 --- a/Source/Glide64/Config.cpp +++ b/Source/Glide64/Config.cpp @@ -311,7 +311,7 @@ public: TTSetTxt(IDC_CMB_FS_RESOLUTION, "Full screen resolution:\n\nThis sets the full screen resolution.\nAll the resolutions that your video card / monitor support should be displayed.\n\n[Recommended:native(max) resolution of your monitor - unless performance becomes an issue]"); m_cbxAnisotropic.Attach(GetDlgItem(IDC_CBXANISOTROPIC)); - m_cbxAnisotropic.SetCheck(g_settings->wrpAnisotropic > 0 ? BST_CHECKED : BST_UNCHECKED); + m_cbxAnisotropic.SetCheck(g_settings->wrpAnisotropic() ? BST_CHECKED : BST_UNCHECKED); TTSetTxt(IDC_CBXANISOTROPIC, "Anisotropic filtering:\n\nThis filter sharpens and brings out the details of textures that recede into the distance.\nWhen activated, it will use the max anisotropy your video card supports.\nHowever, this will override native way of texture filtering and may cause visual artifacts in some games.\n\n[Recommended: your preference, game dependant]"); m_cbxFBO.Attach(GetDlgItem(IDC_CHK_USE_FRAME_BUFFER_OBJECT)); @@ -338,7 +338,7 @@ public: g_settings->SetVsync(m_cbxVSync.GetCheck() == BST_CHECKED); g_settings->SetTexenhOptions(m_cbxTextureSettings.GetCheck() == BST_CHECKED); g_settings->SetFullScreenRes(m_cmbFSResolution.GetCurSel()); - g_settings->wrpAnisotropic = m_cbxAnisotropic.GetCheck() == BST_CHECKED; + g_settings->SetWrpAnisotropic(m_cbxAnisotropic.GetCheck() == BST_CHECKED); g_settings->SetWrpVRAM(m_cbxVRAM.GetCheck() == BST_CHECKED ? 0 : atoi(spinVRAM)); g_settings->SetWrpFBO(m_cbxFBO.GetCheck() == BST_CHECKED); diff --git a/Source/Glide64/Main.cpp b/Source/Glide64/Main.cpp index e3bce2cdd..51f4101ef 100644 --- a/Source/Glide64/Main.cpp +++ b/Source/Glide64/Main.cpp @@ -205,7 +205,7 @@ void ChangeSize() void ConfigWrapper() { - grConfigWrapperExt(g_settings->wrpVRAM() * 1024 * 1024, g_settings->wrpFBO(), g_settings->wrpAnisotropic); + grConfigWrapperExt(g_settings->wrpVRAM() * 1024 * 1024, g_settings->wrpFBO(), g_settings->wrpAnisotropic()); } void UseUnregisteredSetting(int /*SettingID*/) @@ -1008,7 +1008,7 @@ int CALL InitiateGFX(GFX_INFO Gfx_Info) CountCombine(); ZLUT_init(); - grConfigWrapperExt(g_settings->wrpVRAM() * 1024 * 1024, g_settings->wrpFBO(), g_settings->wrpAnisotropic); + grConfigWrapperExt(g_settings->wrpVRAM() * 1024 * 1024, g_settings->wrpFBO(), g_settings->wrpAnisotropic()); grGlideInit(); const char *extensions = grGetString(GR_EXTENSION); grGlideShutdown(); diff --git a/Source/Glide64/Settings.cpp b/Source/Glide64/Settings.cpp index 3a9ca0638..5e611cb1e 100644 --- a/Source/Glide64/Settings.cpp +++ b/Source/Glide64/Settings.cpp @@ -89,7 +89,7 @@ CSettings::CSettings() : #endif m_wrpVRAM(0), m_wrpFBO(false), -wrpAnisotropic(0), + m_wrpAnisotropic(false), m_FlushLogs(false) { memset(m_log_dir, 0, sizeof(m_log_dir)); @@ -119,7 +119,7 @@ void CSettings::RegisterSettings(void) general_setting(Set_wrpFBO, "wrpFBO", true); #endif general_setting(Set_Rotate, "rotate", Rotate_None); - general_setting(Set_wrpAnisotropic, "wrpAnisotropic", 0); + general_setting(Set_wrpAnisotropic, "wrpAnisotropic", false); general_setting(Set_autodetect_ucode, "autodetect_ucode", true); general_setting(Set_ucode, "ucode", ucode_F3DEX2); general_setting(Set_wireframe, "wireframe", false); @@ -315,6 +315,15 @@ void CSettings::SetBuffClear(bool value) } } +void CSettings::SetWrpAnisotropic(bool value) +{ + if (value != m_wrpAnisotropic) + { + m_wrpAnisotropic = value; + m_dirty = true; + } +} + void CSettings::SetWrpVRAM(int value) { if (value != m_wrpVRAM) @@ -569,7 +578,7 @@ void CSettings::ReadSettings() m_wrpVRAM = GetSetting(Set_wrpVRAM); m_wrpFBO = GetSetting(Set_wrpFBO) != 0; - this->wrpAnisotropic = GetSetting(Set_wrpAnisotropic); + m_wrpAnisotropic = GetSetting(Set_wrpAnisotropic) != 0; m_autodetect_ucode = GetSetting(Set_autodetect_ucode) != 0; m_unk_as_red = GetSetting(Set_unk_as_red) != 0; @@ -839,7 +848,7 @@ void CSettings::WriteSettings(void) SetSetting(Set_wrpVRAM, m_wrpVRAM); SetSetting(Set_wrpFBO, m_wrpFBO); - SetSetting(Set_wrpAnisotropic, g_settings->wrpAnisotropic); + SetSetting(Set_wrpAnisotropic, m_wrpAnisotropic); SetSetting(Set_autodetect_ucode, m_autodetect_ucode); SetSetting(Set_wireframe, m_wireframe); diff --git a/Source/Glide64/Settings.h b/Source/Glide64/Settings.h index 72bbfbb78..323eb2fd5 100644 --- a/Source/Glide64/Settings.h +++ b/Source/Glide64/Settings.h @@ -263,7 +263,7 @@ public: #endif inline int wrpVRAM(void) const { return m_wrpVRAM; } inline bool wrpFBO(void) const { return m_wrpFBO; } - int wrpAnisotropic; + inline bool wrpAnisotropic(void) const { return m_wrpAnisotropic; } inline bool FlushLogs(void) const { return m_FlushLogs; } void SetTexenhOptions(bool value); @@ -275,6 +275,7 @@ public: void SetSwapMode(SwapMode_t value); void SetFog(bool value); void SetBuffClear(bool value); + void SetWrpAnisotropic(bool value); void SetWrpVRAM(int value); void SetWrpFBO(bool value); void SetGhqFltr(TextureFilter_t value); @@ -322,6 +323,7 @@ private: #endif int m_wrpVRAM; bool m_wrpFBO; + bool m_wrpAnisotropic; bool m_FlushLogs; char m_log_dir[260]; uint32_t m_ScreenRes;