Wx: Fix regressions from settings decouple

Wx: Fix GS hotkeys losing values after reboot

Wx: Fix trace log hotkey losing value after reboot

WxSettingsInterface: Fix uint value loads

Wx: Fix presets resetting GS window settings

Common/SettingsWrapper: Fix SettingsWrapBitfield
This commit is contained in:
Connor McLaughlin 2021-10-03 13:11:28 +11:00 committed by refractionpcsx2
parent 1e703286f0
commit a585a27d1e
4 changed files with 20 additions and 8 deletions

View File

@ -103,7 +103,7 @@ protected:
#define SettingsWrapSection(section) const char* CURRENT_SETTINGS_SECTION = section; #define SettingsWrapSection(section) const char* CURRENT_SETTINGS_SECTION = section;
#define SettingsWrapEntry(var) wrap.Entry(CURRENT_SETTINGS_SECTION, #var, var, var) #define SettingsWrapEntry(var) wrap.Entry(CURRENT_SETTINGS_SECTION, #var, var, var)
#define SettingsWrapBitfield(var) wrap.EntryBitfield(CURRENT_SETTINGS_SECTION, #var, var, var) #define SettingsWrapBitfield(varname) varname = wrap.EntryBitfield(CURRENT_SETTINGS_SECTION, #varname, varname, varname)
#define SettingsWrapBitBool(varname) varname = wrap.EntryBitBool(CURRENT_SETTINGS_SECTION, #varname, !!varname, varname) #define SettingsWrapBitBool(varname) varname = wrap.EntryBitBool(CURRENT_SETTINGS_SECTION, #varname, !!varname, varname)
#define SettingsWrapBitfieldEx(varname, textname) varname = wrap.EntryBitfield(CURRENT_SETTINGS_SECTION, textname, varname, varname) #define SettingsWrapBitfieldEx(varname, textname) varname = wrap.EntryBitfield(CURRENT_SETTINGS_SECTION, textname, varname, varname)
#define SettingsWrapBitBoolEx(varname, textname) varname = wrap.EntryBitBool(CURRENT_SETTINGS_SECTION, textname, !!varname, varname) #define SettingsWrapBitBoolEx(varname, textname) varname = wrap.EntryBitBool(CURRENT_SETTINGS_SECTION, textname, !!varname, varname)

View File

@ -912,10 +912,11 @@ bool AppConfig::IsOkApplyPreset(int n, bool ignoreMTVU)
EnableGameFixes = false; EnableGameFixes = false;
EmuOptions.EnablePatches = true; EmuOptions.EnablePatches = true;
EmuOptions.GS = default_Pcsx2Config.GS;
EmuOptions.GS.FrameLimitEnable = original_GS.FrameLimitEnable; //Frame limiter is not modified by presets EmuOptions.GS.SynchronousMTGS = default_Pcsx2Config.GS.SynchronousMTGS;
EmuOptions.GS.VsyncEnable = original_GS.VsyncEnable; EmuOptions.GS.FrameSkipEnable = default_Pcsx2Config.GS.FrameSkipEnable;
EmuOptions.GS.VsyncQueueSize = original_GS.VsyncQueueSize; EmuOptions.GS.FramesToDraw = default_Pcsx2Config.GS.FramesToDraw;
EmuOptions.GS.FramesToSkip = default_Pcsx2Config.GS.FramesToSkip;
EmuOptions.Cpu = default_Pcsx2Config.Cpu; EmuOptions.Cpu = default_Pcsx2Config.Cpu;
EmuOptions.Gamefixes = default_Pcsx2Config.Gamefixes; EmuOptions.Gamefixes = default_Pcsx2Config.Gamefixes;

View File

@ -192,6 +192,10 @@ namespace Implementations
break; break;
} }
// Sync the mode with the settings. This is kinda silly, since they won't be
// saved until shutdown, but it matches the behavior pre-settings-move.
g_Conf->EmuOptions.GS.AspectRatio = art;
OSDlog(Color_StrongBlue, true, "(GSwindow) Aspect ratio: %s", arts); OSDlog(Color_StrongBlue, true, "(GSwindow) Aspect ratio: %s", arts);
} }
@ -199,6 +203,8 @@ namespace Implementations
{ {
EmuConfig.GS.OffsetX = x; EmuConfig.GS.OffsetX = x;
EmuConfig.GS.OffsetY = y; EmuConfig.GS.OffsetY = y;
g_Conf->EmuOptions.GS.OffsetX = x;
g_Conf->EmuOptions.GS.OffsetY = y;
OSDlog(Color_StrongBlue, true, "(GSwindow) Offset: x=%f, y=%f", x, y); OSDlog(Color_StrongBlue, true, "(GSwindow) Offset: x=%f, y=%f", x, y);
} }
@ -232,6 +238,7 @@ namespace Implementations
if (zoom <= 0) if (zoom <= 0)
return; return;
EmuConfig.GS.StretchY = zoom; EmuConfig.GS.StretchY = zoom;
g_Conf->EmuOptions.GS.StretchY = zoom;
OSDlog(Color_StrongBlue, true, "(GSwindow) Vertical stretch: %f", zoom); OSDlog(Color_StrongBlue, true, "(GSwindow) Vertical stretch: %f", zoom);
} }
@ -253,6 +260,7 @@ namespace Implementations
if (zoom < 0) if (zoom < 0)
return; return;
EmuConfig.GS.Zoom = zoom; EmuConfig.GS.Zoom = zoom;
g_Conf->EmuOptions.GS.Zoom = zoom;
if (zoom == 0) if (zoom == 0)
OSDlog(Color_StrongBlue, true, "(GSwindow) Zoom: 0 (auto, no black bars)"); OSDlog(Color_StrongBlue, true, "(GSwindow) Zoom: 0 (auto, no black bars)");
@ -401,8 +409,10 @@ namespace Implementations
// FIXME: Some of the trace logs will require recompiler resets to be activated properly. // FIXME: Some of the trace logs will require recompiler resets to be activated properly.
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
EmuConfig.Trace.Enabled = !EmuConfig.Trace.Enabled; // This is touching the CPU thread's settings, it really shouldn't be, but it'll desync with the UI if we don't.
Console.WriteLn(EmuConfig.Trace.Enabled ? "Logging Enabled." : "Logging Disabled."); g_Conf->EmuOptions.Trace.Enabled = !g_Conf->EmuOptions.Trace.Enabled;
EmuConfig.Trace.Enabled = g_Conf->EmuOptions.Trace.Enabled;
Console.WriteLn(g_Conf->EmuOptions.Trace.Enabled ? "Logging Enabled." : "Logging Disabled.");
#endif #endif
} }

View File

@ -64,7 +64,8 @@ bool wxSettingsInterface::GetUIntValue(const char* section, const char* key, uin
if (!m_config->Read(key, &lvalue)) if (!m_config->Read(key, &lvalue))
return false; return false;
return static_cast<uint>(lvalue); *value = static_cast<uint>(lvalue);
return true;
} }
bool wxSettingsInterface::GetFloatValue(const char* section, const char* key, float* value) const bool wxSettingsInterface::GetFloatValue(const char* section, const char* key, float* value) const