[Glide64] Make vsync private

This commit is contained in:
zilmar 2017-03-09 18:13:25 +11:00
parent 880d7c61ff
commit 8fdb912291
4 changed files with 20 additions and 11 deletions

View File

@ -306,7 +306,7 @@ public:
TTSetTxt(IDC_CMB_WINDOW_RES, "Resolution:\n\nThis option selects the windowed resolution.\n\n[Recommended: 640x480, 800x600, 1024x768]"); TTSetTxt(IDC_CMB_WINDOW_RES, "Resolution:\n\nThis option selects the windowed resolution.\n\n[Recommended: 640x480, 800x600, 1024x768]");
m_cbxVSync.Attach(GetDlgItem(IDC_CHK_VERTICAL_SYNC)); m_cbxVSync.Attach(GetDlgItem(IDC_CHK_VERTICAL_SYNC));
m_cbxVSync.SetCheck(g_settings->vsync ? BST_CHECKED : BST_UNCHECKED); m_cbxVSync.SetCheck(g_settings->vsync() ? BST_CHECKED : BST_UNCHECKED);
TTSetTxt(IDC_CHK_VERTICAL_SYNC, "Vertical sync:\n\nThis option will enable the vertical sync, which will prevent tearing.\nNote: this option will ONLY have effect if vsync is set to \"Software Controlled\"."); TTSetTxt(IDC_CHK_VERTICAL_SYNC, "Vertical sync:\n\nThis option will enable the vertical sync, which will prevent tearing.\nNote: this option will ONLY have effect if vsync is set to \"Software Controlled\".");
m_cbxTextureSettings.Attach(GetDlgItem(IDC_CHK_SHOW_TEXTURE_ENHANCEMENT)); m_cbxTextureSettings.Attach(GetDlgItem(IDC_CHK_SHOW_TEXTURE_ENHANCEMENT));
@ -350,7 +350,7 @@ public:
m_spinVRAM.GetWindowText(spinVRAM, sizeof(spinVRAM)); m_spinVRAM.GetWindowText(spinVRAM, sizeof(spinVRAM));
CSettings oldsettings = *g_settings; CSettings oldsettings = *g_settings;
g_settings->SetScreenRes(m_WindowRes.GetCurSel()); g_settings->SetScreenRes(m_WindowRes.GetCurSel());
g_settings->vsync = m_cbxVSync.GetCheck() == BST_CHECKED; g_settings->SetVsync(m_cbxVSync.GetCheck() == BST_CHECKED);
g_settings->SetTexenhOptions(m_cbxTextureSettings.GetCheck() == BST_CHECKED); g_settings->SetTexenhOptions(m_cbxTextureSettings.GetCheck() == BST_CHECKED);
g_settings->wrpResolution = m_cmbFSResolution.GetCurSel(); g_settings->wrpResolution = m_cmbFSResolution.GetCurSel();
g_settings->wrpAnisotropic = m_cbxAnisotropic.GetCheck() == BST_CHECKED; g_settings->wrpAnisotropic = m_cbxAnisotropic.GetCheck() == BST_CHECKED;

View File

@ -1539,7 +1539,7 @@ void newSwapBuffers()
grAuxBufferExt(GR_BUFFER_AUXBUFFER); grAuxBufferExt(GR_BUFFER_AUXBUFFER);
} }
WriteTrace(TraceGlide64, TraceDebug, "BUFFER SWAPPED"); WriteTrace(TraceGlide64, TraceDebug, "BUFFER SWAPPED");
grBufferSwap(g_settings->vsync); grBufferSwap(g_settings->vsync());
if (*gfx.VI_STATUS_REG & 0x08) //gamma correction is used if (*gfx.VI_STATUS_REG & 0x08) //gamma correction is used
{ {
if (!voodoo.gamma_correction) if (!voodoo.gamma_correction)

View File

@ -23,7 +23,7 @@ CSettings::CSettings() :
m_ScreenRes(GetDefaultScreenRes()), m_ScreenRes(GetDefaultScreenRes()),
m_advanced_options(false), m_advanced_options(false),
m_texenh_options(false), m_texenh_options(false),
vsync(0), m_vsync(false),
m_rotate(Rotate_None), m_rotate(Rotate_None),
m_filtering(Filter_Automatic), m_filtering(Filter_Automatic),
@ -120,7 +120,7 @@ void CSettings::RegisterSettings(void)
#ifdef _WIN32 #ifdef _WIN32
general_setting(Set_FullScreenRes, "FullScreenRes", GetCurrentResIndex()); general_setting(Set_FullScreenRes, "FullScreenRes", GetCurrentResIndex());
#endif #endif
general_setting(Set_vsync, "vsync", 1); general_setting(Set_vsync, "vsync", true);
general_setting(Set_texenh_options, "texenh_options", false); general_setting(Set_texenh_options, "texenh_options", false);
general_setting(Set_wrpVRAM, "wrpVRAM", 0); general_setting(Set_wrpVRAM, "wrpVRAM", 0);
#ifndef ANDROID #ifndef ANDROID
@ -281,6 +281,15 @@ void CSettings::SetLODmode(PixelLevelOfDetail_t value)
} }
} }
void CSettings::SetVsync(bool value)
{
if (value != m_vsync)
{
m_vsync = value;
m_dirty = true;
}
}
void CSettings::SetFiltering(Filtering_t value) void CSettings::SetFiltering(Filtering_t value)
{ {
if (value != m_filtering) if (value != m_filtering)
@ -391,7 +400,7 @@ void CSettings::ReadSettings()
#ifndef ANDROID #ifndef ANDROID
this->wrpResolution = GetSetting(Set_FullScreenRes); this->wrpResolution = GetSetting(Set_FullScreenRes);
#endif #endif
this->vsync = GetSetting(Set_vsync); m_vsync = GetSetting(Set_vsync) != 0;
m_rotate = (ScreenRotate_t)GetSetting(Set_Rotate); m_rotate = (ScreenRotate_t)GetSetting(Set_Rotate);
m_advanced_options = Set_basic_mode ? GetSystemSetting(Set_basic_mode) == 0 : false; m_advanced_options = Set_basic_mode ? GetSystemSetting(Set_basic_mode) == 0 : false;
m_texenh_options = GetSetting(Set_texenh_options) != 0; m_texenh_options = GetSetting(Set_texenh_options) != 0;
@ -671,7 +680,7 @@ void CSettings::WriteSettings(void)
#ifdef _WIN32 #ifdef _WIN32
SetSetting(Set_FullScreenRes, g_settings->wrpResolution); SetSetting(Set_FullScreenRes, g_settings->wrpResolution);
#endif #endif
SetSetting(Set_vsync, g_settings->vsync); SetSetting(Set_vsync, m_vsync ? 1 : 0);
SetSetting(Set_Rotate, m_rotate); SetSetting(Set_Rotate, m_rotate);
SetSetting(Set_texenh_options, m_texenh_options); SetSetting(Set_texenh_options, m_texenh_options);

View File

@ -146,9 +146,6 @@ public:
}; };
int vsync;
int fog; int fog;
int buff_clear; int buff_clear;
@ -184,7 +181,7 @@ public:
inline uint32_t ScreenRes(void) const { return m_ScreenRes; } inline uint32_t ScreenRes(void) const { return m_ScreenRes; }
inline bool advanced_options(void) const { return m_advanced_options; } inline bool advanced_options(void) const { return m_advanced_options; }
inline bool texenh_options(void) const { return m_texenh_options; } inline bool texenh_options(void) const { return m_texenh_options; }
inline bool FlushLogs(void) const { return m_FlushLogs; } inline bool vsync(void) const { return m_vsync; }
inline ScreenRotate_t rotate(void) const { return m_rotate; } inline ScreenRotate_t rotate(void) const { return m_rotate; }
inline Filtering_t filtering(void) const { return m_filtering; } inline Filtering_t filtering(void) const { return m_filtering; }
@ -255,11 +252,13 @@ public:
#endif #endif
int wrpVRAM; int wrpVRAM;
int wrpFBO; int wrpFBO;
inline bool FlushLogs(void) const { return m_FlushLogs; }
int wrpAnisotropic; int wrpAnisotropic;
void SetTexenhOptions(bool value); void SetTexenhOptions(bool value);
void SetScreenRes(uint32_t value); void SetScreenRes(uint32_t value);
void SetAspectmode(AspectMode_t value); void SetAspectmode(AspectMode_t value);
void SetLODmode(PixelLevelOfDetail_t value); void SetLODmode(PixelLevelOfDetail_t value);
void SetVsync(bool value);
void SetFiltering(Filtering_t value); void SetFiltering(Filtering_t value);
void SetSwapMode(SwapMode_t value); void SetSwapMode(SwapMode_t value);
void SetGhqFltr(TextureFilter_t value); void SetGhqFltr(TextureFilter_t value);
@ -298,6 +297,7 @@ private:
PixelLevelOfDetail_t m_lodmode; PixelLevelOfDetail_t m_lodmode;
bool m_advanced_options; bool m_advanced_options;
bool m_texenh_options; bool m_texenh_options;
bool m_vsync;
TextureFilter_t m_ghq_fltr; TextureFilter_t m_ghq_fltr;
TextureEnhancement_t m_ghq_enht; TextureEnhancement_t m_ghq_enht;
ucode_t m_ucode; ucode_t m_ucode;