From 7a43073eef03d4cb521de737562754ac219358b9 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 13 Mar 2017 17:33:08 +1100 Subject: [PATCH] [Glide64]rename wrpResolution to m_FullScreenRes --- Source/Glide64/Config.cpp | 4 ++-- Source/Glide64/Main.cpp | 2 +- Source/Glide64/ScreenResolution.cpp | 4 ++-- Source/Glide64/Settings.cpp | 23 +++++++++++++++++------ Source/Glide64/Settings.h | 9 +++++++-- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/Source/Glide64/Config.cpp b/Source/Glide64/Config.cpp index 49c4efbd0..59f10ccc8 100644 --- a/Source/Glide64/Config.cpp +++ b/Source/Glide64/Config.cpp @@ -306,7 +306,7 @@ public: { m_cmbFSResolution.AddString(aRes[r]); } - m_cmbFSResolution.SetCurSel(g_settings->wrpResolution < size ? g_settings->wrpResolution : 0); + m_cmbFSResolution.SetCurSel(g_settings->FullScreenRes() < size ? g_settings->FullScreenRes() : 0); } 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]"); @@ -337,7 +337,7 @@ public: g_settings->SetScreenRes(m_WindowRes.GetCurSel()); g_settings->SetVsync(m_cbxVSync.GetCheck() == BST_CHECKED); g_settings->SetTexenhOptions(m_cbxTextureSettings.GetCheck() == BST_CHECKED); - g_settings->wrpResolution = m_cmbFSResolution.GetCurSel(); + g_settings->SetFullScreenRes(m_cmbFSResolution.GetCurSel()); g_settings->wrpAnisotropic = m_cbxAnisotropic.GetCheck() == BST_CHECKED; g_settings->wrpVRAM = m_cbxVRAM.GetCheck() == BST_CHECKED ? 0 : atoi(spinVRAM); g_settings->wrpFBO = m_cbxFBO.GetCheck() == BST_CHECKED; diff --git a/Source/Glide64/Main.cpp b/Source/Glide64/Main.cpp index 16618bd54..0d1d54e06 100644 --- a/Source/Glide64/Main.cpp +++ b/Source/Glide64/Main.cpp @@ -393,7 +393,7 @@ void SetWindowDisplaySize(HWND hWnd) g_windowedStyle = GetWindowLong(hWnd, GWL_STYLE); // primary monitor only - if (!EnterFullScreen(g_settings->wrpResolution)) + if (!EnterFullScreen(g_settings->FullScreenRes())) { WriteTrace(TraceGlitch, TraceWarning, "can't change to fullscreen mode"); } diff --git a/Source/Glide64/ScreenResolution.cpp b/Source/Glide64/ScreenResolution.cpp index 7326ce3f0..962819ec5 100644 --- a/Source/Glide64/ScreenResolution.cpp +++ b/Source/Glide64/ScreenResolution.cpp @@ -331,7 +331,7 @@ char ** grQueryResolutionsExt(int32_t * Size) uint32_t grWrapperFullScreenResolutionExt(uint32_t * width, uint32_t * height) { WriteTrace(TraceGlitch, TraceDebug, "-"); - g_FullScreenResolutions.getResolution(g_settings->wrpResolution, width, height); - return g_settings->wrpResolution; + g_FullScreenResolutions.getResolution(g_settings->FullScreenRes(), width, height); + return g_settings->FullScreenRes(); } #endif \ No newline at end of file diff --git a/Source/Glide64/Settings.cpp b/Source/Glide64/Settings.cpp index 7846581f7..6bcf1e302 100644 --- a/Source/Glide64/Settings.cpp +++ b/Source/Glide64/Settings.cpp @@ -85,7 +85,7 @@ CSettings::CSettings() : //wrapper settings #ifndef ANDROID -wrpResolution(0), + m_FullScreenRes(0), #endif wrpVRAM(0), wrpFBO(0), @@ -232,8 +232,8 @@ void CSettings::UpdateScreenSize(bool fullscreen) #ifndef ANDROID if (fullscreen) { - g_width = GetFullScreenResWidth(wrpResolution); - g_height = GetFullScreenResHeight(wrpResolution); + g_width = GetFullScreenResWidth(m_FullScreenRes); + g_height = GetFullScreenResHeight(m_FullScreenRes); } else { @@ -490,6 +490,17 @@ void CSettings::SetUcode(ucode_t value) m_ucode = value; } +#ifndef ANDROID +void CSettings::SetFullScreenRes(uint32_t value) +{ + if (value != m_FullScreenRes) + { + m_FullScreenRes = value; + m_dirty = true; + } +} +#endif + void CSettings::UpdateAspectRatio(void) { switch (m_aspectmode) @@ -531,7 +542,7 @@ void CSettings::ReadSettings() { SetScreenRes(GetSetting(Set_Resolution)); #ifndef ANDROID - this->wrpResolution = GetSetting(Set_FullScreenRes); + SetFullScreenRes(GetSetting(Set_FullScreenRes)); #endif m_vsync = GetSetting(Set_vsync) != 0; m_rotate = (ScreenRotate_t)GetSetting(Set_Rotate); @@ -801,8 +812,8 @@ void CSettings::ReadGameSettings(const char * name) void CSettings::WriteSettings(void) { SetSetting(Set_Resolution, g_settings->m_ScreenRes); -#ifdef _WIN32 - SetSetting(Set_FullScreenRes, g_settings->wrpResolution); +#ifndef ANDROID + SetSetting(Set_FullScreenRes, m_FullScreenRes); #endif SetSetting(Set_vsync, m_vsync ? 1 : 0); SetSetting(Set_Rotate, m_rotate); diff --git a/Source/Glide64/Settings.h b/Source/Glide64/Settings.h index 6f0d41a41..179400bcf 100644 --- a/Source/Glide64/Settings.h +++ b/Source/Glide64/Settings.h @@ -259,7 +259,7 @@ public: //wrapper settings #ifndef ANDROID - int wrpResolution; + inline uint32_t FullScreenRes(void) const { return m_FullScreenRes; } #endif int wrpVRAM; int wrpFBO; @@ -294,7 +294,9 @@ public: void UpdateFrameBufferBits(uint32_t BitsToAdd, uint32_t BitsToRemove); ucode_t DetectUCode(uint32_t uc_crc); void SetUcode(ucode_t value); - +#ifndef ANDROID + void SetFullScreenRes(uint32_t value); +#endif void ReadSettings(); void ReadGameSettings(const char * name); void WriteSettings(void); @@ -313,6 +315,9 @@ private: short m_Set_texture_dir; bool m_dirty; +#ifndef ANDROID + uint32_t m_FullScreenRes; +#endif bool m_FlushLogs; char m_log_dir[260]; uint32_t m_ScreenRes;