Skip to content

Commit

Permalink
Readd C4StartupOptionsDlg::SaveGfxTroubleshoot so that DisableGamma c…
Browse files Browse the repository at this point in the history
…hanges are applied
  • Loading branch information
Fulgen301 committed Oct 15, 2023
1 parent f2aeec3 commit 41bfb87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/C4StartupOptionsDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,8 @@ bool C4StartupOptionsDlg::SaveConfig(bool fForce, bool fKeepOpen)
{
// prevent double save
if (fConfigSaved) return true;
// store some config values
SaveGfxTroubleshoot();
// save any config fields that are not stored directly; return whether all values are OK
// check port validity
if (!fForce)
Expand Down Expand Up @@ -1326,6 +1328,12 @@ void C4StartupOptionsDlg::RecreateDialog(bool fFade)
pNewDlg->fCanGoBack = false;
}

void C4StartupOptionsDlg::SaveGfxTroubleshoot()
{
lpDDraw->InvalidateDeviceObjects();
lpDDraw->RestoreDeviceObjects();
}

void C4StartupOptionsDlg::OnEffectsSliderChange(int32_t iNewVal)
{
Config.Graphics.SmokeLevel = iNewVal;
Expand Down
2 changes: 2 additions & 0 deletions src/C4StartupOptionsDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ class C4StartupOptionsDlg : public C4StartupDlg

C4GUI::ScrollBar *pEffectLevelSlider;

void SaveGfxTroubleshoot();

class ScaleEdit;

C4GUI::ScrollBar *pScaleSlider;
Expand Down

0 comments on commit 41bfb87

Please sign in to comment.