diff --git a/Source/Glide64/Config.cpp b/Source/Glide64/Config.cpp index e15f6627a..429b4da7e 100644 --- a/Source/Glide64/Config.cpp +++ b/Source/Glide64/Config.cpp @@ -316,7 +316,7 @@ public: m_cbxFBO.Attach(GetDlgItem(IDC_CHK_USE_FRAME_BUFFER_OBJECT)); TTSetTxt(IDC_CHK_USE_FRAME_BUFFER_OBJECT, "Use frame buffer objects:\n\nChanges the way FB effects are rendered - with or without usage of the OpenGL Frame Buffer Objects (FBO) extension.\nThe choice depends on game and your video card. FBO off is good for NVIDIA cards, while for ATI cards, it's usually best that FBOs are turned on.\nAlso, some FB effects works only with one of the methods, no matter, which card you have.\nOn the whole, with FBO off, compatibility/ accuracy is a bit better (which is the case for Resident Evil 2).\nHowever, with FBO on with some systems, it can actually be a bit faster in cases.\n\n[Recommended: video card and game dependant]"); - m_cbxFBO.SetCheck(g_settings->wrpFBO > 0 ? BST_CHECKED : BST_UNCHECKED); + m_cbxFBO.SetCheck(g_settings->wrpFBO() > 0 ? BST_CHECKED : BST_UNCHECKED); m_cbxVRAM.Attach(GetDlgItem(IDC_CHK_AUTODETECT_VRAM)); TTSetTxt(IDC_CHK_AUTODETECT_VRAM, "Autodetect VRAM Size:\n\nSince OpenGL cannot do this reliably at the moment, the option to set this manually is available.\nIf checked, plugin will try to autodetect VRAM size.\nBut if this appears wrong, please uncheck and set it to correct value.\n\n[Recommended: on]"); @@ -340,7 +340,7 @@ public: g_settings->SetFullScreenRes(m_cmbFSResolution.GetCurSel()); g_settings->wrpAnisotropic = m_cbxAnisotropic.GetCheck() == BST_CHECKED; g_settings->SetWrpVRAM(m_cbxVRAM.GetCheck() == BST_CHECKED ? 0 : atoi(spinVRAM)); - g_settings->wrpFBO = m_cbxFBO.GetCheck() == BST_CHECKED; + g_settings->SetWrpFBO(m_cbxFBO.GetCheck() == BST_CHECKED); if (memcmp(&oldsettings, g_settings, sizeof(oldsettings))) //check that settings were changed { diff --git a/Source/Glide64/Main.cpp b/Source/Glide64/Main.cpp index df66c47ca..e3bce2cdd 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 027aa639f..3a9ca0638 100644 --- a/Source/Glide64/Settings.cpp +++ b/Source/Glide64/Settings.cpp @@ -88,7 +88,7 @@ CSettings::CSettings() : m_FullScreenRes(0), #endif m_wrpVRAM(0), -wrpFBO(0), + m_wrpFBO(false), wrpAnisotropic(0), m_FlushLogs(false) { @@ -114,9 +114,9 @@ void CSettings::RegisterSettings(void) general_setting(Set_texenh_options, "texenh_options", false); general_setting(Set_wrpVRAM, "wrpVRAM", 0); #ifndef ANDROID - general_setting(Set_wrpFBO, "wrpFBO", 0); + general_setting(Set_wrpFBO, "wrpFBO", false); #else - general_setting(Set_wrpFBO, "wrpFBO", 1); + general_setting(Set_wrpFBO, "wrpFBO", true); #endif general_setting(Set_Rotate, "rotate", Rotate_None); general_setting(Set_wrpAnisotropic, "wrpAnisotropic", 0); @@ -324,6 +324,15 @@ void CSettings::SetWrpVRAM(int value) } } +void CSettings::SetWrpFBO(bool value) +{ + if (value != m_wrpFBO) + { + m_wrpFBO = value; + m_dirty = true; + } +} + void CSettings::SetGhqFltr(TextureFilter_t value) { if (value != m_ghq_fltr) @@ -559,7 +568,7 @@ void CSettings::ReadSettings() m_texenh_options = GetSetting(Set_texenh_options) != 0; m_wrpVRAM = GetSetting(Set_wrpVRAM); - this->wrpFBO = GetSetting(Set_wrpFBO); + m_wrpFBO = GetSetting(Set_wrpFBO) != 0; this->wrpAnisotropic = GetSetting(Set_wrpAnisotropic); m_autodetect_ucode = GetSetting(Set_autodetect_ucode) != 0; @@ -829,7 +838,7 @@ void CSettings::WriteSettings(void) SetSetting(Set_texenh_options, m_texenh_options); SetSetting(Set_wrpVRAM, m_wrpVRAM); - SetSetting(Set_wrpFBO, g_settings->wrpFBO); + SetSetting(Set_wrpFBO, m_wrpFBO); SetSetting(Set_wrpAnisotropic, g_settings->wrpAnisotropic); SetSetting(Set_autodetect_ucode, m_autodetect_ucode); diff --git a/Source/Glide64/Settings.h b/Source/Glide64/Settings.h index aa7158ac0..72bbfbb78 100644 --- a/Source/Glide64/Settings.h +++ b/Source/Glide64/Settings.h @@ -262,7 +262,7 @@ public: inline uint32_t FullScreenRes(void) const { return m_FullScreenRes; } #endif inline int wrpVRAM(void) const { return m_wrpVRAM; } - int wrpFBO; + inline bool wrpFBO(void) const { return m_wrpFBO; } int wrpAnisotropic; inline bool FlushLogs(void) const { return m_FlushLogs; } @@ -276,6 +276,7 @@ public: void SetFog(bool value); void SetBuffClear(bool value); void SetWrpVRAM(int value); + void SetWrpFBO(bool value); void SetGhqFltr(TextureFilter_t value); void SetGhqEnht(TextureEnhancement_t value); void SetGhqCmpr(TextureCompression_t value); @@ -320,6 +321,7 @@ private: uint32_t m_FullScreenRes; #endif int m_wrpVRAM; + bool m_wrpFBO; bool m_FlushLogs; char m_log_dir[260]; uint32_t m_ScreenRes;