From 4e9214f6c6de5c9543e3fe1ac3fa23b66984da43 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 10 Mar 2017 23:03:10 +1100 Subject: [PATCH] [Glide64]Make ghq_hirs_f16bpp private --- Source/Glide64/Config.cpp | 4 ++-- Source/Glide64/Main.cpp | 2 +- Source/Glide64/Settings.cpp | 17 +++++++++++++---- Source/Glide64/Settings.h | 4 +++- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Source/Glide64/Config.cpp b/Source/Glide64/Config.cpp index ad279397c..f4784df66 100644 --- a/Source/Glide64/Config.cpp +++ b/Source/Glide64/Config.cpp @@ -654,7 +654,7 @@ public: m_cbxHrsForce16.Attach(GetDlgItem(IDC_CHK_FORCE_16BPP_TEXT)); TTSetTxt(IDC_CHK_FORCE_16BPP_TEXT, "Force 16bpp textures:\n\nThe color of the textures will be reduced to 16bpp.\nThis is another space saver and performance enhancer.\nThis halves the space used on the texture cache and the GFX hardware's texture RAM.\nColor reduction is done so that the original quality is preserved as much as possible.\nDepending on the texture, this usually is hardly noticeable.\nSometimes though, it can be: skies are a good example.\n\n[Recommended: off]"); - m_cbxHrsForce16.SetCheck(g_settings->ghq_hirs_f16bpp > 0 ? BST_CHECKED : BST_UNCHECKED); + m_cbxHrsForce16.SetCheck(g_settings->ghq_hirs_f16bpp() > 0 ? BST_CHECKED : BST_UNCHECKED); m_cbxHrsTexEdit.Attach(GetDlgItem(IDC_CHK_TEX_DUMP_EDIT)); TTSetTxt(IDC_CHK_TEX_DUMP_EDIT, "Texture dumping mode:\n\nIn this mode, you have that ability to dump textures on screen to the appropriate folder.\nYou can also reload textures while the game is running to see how they look instantly - big time saver!\n\nHotkeys:\n\"R\" reloads hires textures from the texture pack\n\"D\" toggles texture dumps on/off."); @@ -696,7 +696,7 @@ public: g_settings->SetGhqEnhtGz(m_cbxEnhCompressCache.GetCheck() == BST_CHECKED); g_settings->SetGhqHirs((CSettings::HiResPackFormat_t)m_cmbHrsFormat.GetItemData(m_cmbHrsFormat.GetCurSel())); g_settings->SetGhqHirsTile(m_cbxHrsTile.GetCheck() == BST_CHECKED); - g_settings->ghq_hirs_f16bpp = (int)m_cbxHrsForce16.GetCheck() == BST_CHECKED; + g_settings->SetGhqHirsF16bpp(m_cbxHrsForce16.GetCheck() == BST_CHECKED); g_settings->ghq_hirs_dump = (int)m_cbxHrsTexEdit.GetCheck() == BST_CHECKED; g_settings->ghq_hirs_altcrc = (int)m_cbxHrsAltCRC.GetCheck() == BST_CHECKED; g_settings->SetGhqHirsCmpr(m_cbxHrsTexCompression.GetCheck() == BST_CHECKED); diff --git a/Source/Glide64/Main.cpp b/Source/Glide64/Main.cpp index 15414ba7f..a8101dfcb 100644 --- a/Source/Glide64/Main.cpp +++ b/Source/Glide64/Main.cpp @@ -677,7 +677,7 @@ int InitGfx() { options |= FORCE16BPP_TEX; } - if (g_settings->ghq_hirs_f16bpp) + if (g_settings->ghq_hirs_f16bpp()) { options |= FORCE16BPP_HIRESTEX; } diff --git a/Source/Glide64/Settings.cpp b/Source/Glide64/Settings.cpp index cb7721d3a..5958a468c 100644 --- a/Source/Glide64/Settings.cpp +++ b/Source/Glide64/Settings.cpp @@ -46,7 +46,7 @@ CSettings::CSettings() : m_ghq_enht_nobg(false), m_ghq_hirs_cmpr(false), m_ghq_hirs_tile(false), -ghq_hirs_f16bpp(0), + m_ghq_hirs_f16bpp(false), ghq_hirs_gz(0), ghq_hirs_altcrc(0), ghq_cache_save(0), @@ -145,7 +145,7 @@ void CSettings::RegisterSettings(void) general_setting(Set_ghq_enht_nobg, "ghq_enht_nobg", false); general_setting(Set_ghq_hirs_cmpr, "ghq_hirs_cmpr", false); general_setting(Set_ghq_hirs_tile, "ghq_hirs_tile", false); - general_setting(Set_ghq_hirs_f16bpp, "ghq_hirs_f16bpp", 0); + general_setting(Set_ghq_hirs_f16bpp, "ghq_hirs_f16bpp", false); general_setting(Set_ghq_hirs_gz, "ghq_hirs_gz", 1); general_setting(Set_ghq_hirs_altcrc, "ghq_hirs_altcrc", 1); general_setting(Set_ghq_cache_save, "ghq_cache_save", 1); @@ -379,6 +379,15 @@ void CSettings::SetGhqHirsTile(bool value) } } +void CSettings::SetGhqHirsF16bpp(bool value) +{ + if (value != m_ghq_hirs_f16bpp) + { + m_ghq_hirs_f16bpp = value; + m_dirty = true; + } +} + void CSettings::SetGhqEnhtNobg(bool value) { if (value != m_ghq_enht_nobg) @@ -518,7 +527,7 @@ void CSettings::ReadSettings() m_ghq_enht_nobg = GetSetting(Set_ghq_enht_nobg) != 0; m_ghq_hirs_cmpr = GetSetting(Set_ghq_hirs_cmpr) != 0; m_ghq_hirs_tile = GetSetting(Set_ghq_hirs_tile) != 0; - this->ghq_hirs_f16bpp = GetSetting(Set_ghq_hirs_f16bpp); + m_ghq_hirs_f16bpp = GetSetting(Set_ghq_hirs_f16bpp) != 0; this->ghq_hirs_gz = GetSetting(Set_ghq_hirs_gz); this->ghq_hirs_altcrc = GetSetting(Set_ghq_hirs_altcrc); this->ghq_cache_save = GetSetting(Set_ghq_cache_save); @@ -787,7 +796,7 @@ void CSettings::WriteSettings(void) SetSetting(Set_ghq_enht_nobg, m_ghq_enht_nobg); SetSetting(Set_ghq_hirs_cmpr, m_ghq_hirs_cmpr); SetSetting(Set_ghq_hirs_tile, m_ghq_hirs_tile); - SetSetting(Set_ghq_hirs_f16bpp, g_settings->ghq_hirs_f16bpp); + SetSetting(Set_ghq_hirs_f16bpp, m_ghq_hirs_f16bpp); SetSetting(Set_ghq_hirs_gz, g_settings->ghq_hirs_gz); SetSetting(Set_ghq_hirs_altcrc, g_settings->ghq_hirs_altcrc); SetSetting(Set_ghq_cache_save, g_settings->ghq_cache_save); diff --git a/Source/Glide64/Settings.h b/Source/Glide64/Settings.h index 629669514..331f7be13 100644 --- a/Source/Glide64/Settings.h +++ b/Source/Glide64/Settings.h @@ -213,7 +213,7 @@ public: inline bool ghq_enht_nobg(void) const { return m_ghq_enht_nobg; } inline bool ghq_hirs_cmpr(void) const { return m_ghq_hirs_cmpr; } inline bool ghq_hirs_tile(void) const { return m_ghq_hirs_tile; } - int ghq_hirs_f16bpp; + inline bool ghq_hirs_f16bpp(void) const { return m_ghq_hirs_f16bpp; } int ghq_hirs_gz; int ghq_hirs_altcrc; int ghq_cache_save; @@ -278,6 +278,7 @@ public: void SetGhqHirs(HiResPackFormat_t value); void SetGhqEnhtGz(bool value); void SetGhqHirsTile(bool value); + void SetGhqHirsF16bpp(bool value); void SetGhqEnhtNobg(bool value); void SetGhqEnhtCmpr(bool value); void SetGhqHirsCmpr(bool value); @@ -331,6 +332,7 @@ private: bool m_ghq_enht_nobg; bool m_ghq_hirs_cmpr; bool m_ghq_hirs_tile; + bool m_ghq_hirs_f16bpp; ucode_t m_ucode; StippleMode_t m_stipple_mode; hacks_t m_hacks;