Remove unused parameter of SetWindowParams function

The `bool AllowResizing` parameter is only passed to other `SetWindowParams` functions but never used in the end, as whether or not resizing is allowed is separately determined based on the value of the `int FullscreenMode` parameter.
This commit is contained in:
Robert Müller 2024-01-23 17:49:53 +01:00
parent a2c8869025
commit 9c66a6a147
9 changed files with 22 additions and 22 deletions

View file

@ -174,7 +174,7 @@ public:
// gfx
virtual void SwitchWindowScreen(int Index) = 0;
virtual void SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing) = 0;
virtual void SetWindowParams(int FullscreenMode, bool IsBorderless) = 0;
virtual void ToggleWindowVSync() = 0;
virtual void Notify(const char *pTitle, const char *pMessage) = 0;
virtual void OnWindowResize() = 0;

View file

@ -1459,7 +1459,7 @@ void CGraphicsBackend_SDL_GL::Maximize()
// TODO: SDL
}
void CGraphicsBackend_SDL_GL::SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing)
void CGraphicsBackend_SDL_GL::SetWindowParams(int FullscreenMode, bool IsBorderless)
{
if(FullscreenMode > 0)
{
@ -1574,7 +1574,7 @@ bool CGraphicsBackend_SDL_GL::ResizeWindow(int w, int h, int RefreshRate)
{
#ifdef CONF_FAMILY_WINDOWS
// in windows make the window windowed mode first, this prevents strange window glitches (other games probably do something similar)
SetWindowParams(0, true, true);
SetWindowParams(0, true);
#endif
SDL_DisplayMode SetMode = {};
SDL_DisplayMode ClosestMode = {};
@ -1586,7 +1586,7 @@ bool CGraphicsBackend_SDL_GL::ResizeWindow(int w, int h, int RefreshRate)
#ifdef CONF_FAMILY_WINDOWS
// now change it back to fullscreen, this will restore the above set state, bcs SDL saves fullscreen modes apart from other video modes (as of SDL 2.0.16)
// see implementation of SDL_SetWindowDisplayMode
SetWindowParams(1, false, true);
SetWindowParams(1, false);
#endif
return true;
}

View file

@ -250,7 +250,7 @@ public:
void Minimize() override;
void Maximize() override;
void SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing) override;
void SetWindowParams(int FullscreenMode, bool IsBorderless) override;
bool SetWindowScreen(int Index) override;
bool UpdateDisplayMode(int Index) override;
int GetWindowScreen() override;

View file

@ -3894,10 +3894,10 @@ void CClient::SwitchWindowScreen(int Index)
// Todo SDL: remove this when fixed (changing screen when in fullscreen is bugged)
if(g_Config.m_GfxFullscreen)
{
SetWindowParams(0, g_Config.m_GfxBorderless, g_Config.m_GfxFullscreen != 3);
SetWindowParams(0, g_Config.m_GfxBorderless);
if(Graphics()->SetWindowScreen(Index))
g_Config.m_GfxScreen = Index;
SetWindowParams(g_Config.m_GfxFullscreen, g_Config.m_GfxBorderless, g_Config.m_GfxFullscreen != 3);
SetWindowParams(g_Config.m_GfxFullscreen, g_Config.m_GfxBorderless);
}
else
{
@ -3918,11 +3918,11 @@ void CClient::ConchainWindowScreen(IConsole::IResult *pResult, void *pUserData,
pfnCallback(pResult, pCallbackUserData);
}
void CClient::SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing)
void CClient::SetWindowParams(int FullscreenMode, bool IsBorderless)
{
g_Config.m_GfxFullscreen = clamp(FullscreenMode, 0, 3);
g_Config.m_GfxBorderless = (int)IsBorderless;
Graphics()->SetWindowParams(FullscreenMode, IsBorderless, AllowResizing);
Graphics()->SetWindowParams(FullscreenMode, IsBorderless);
}
void CClient::ConchainFullscreen(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
@ -3931,7 +3931,7 @@ void CClient::ConchainFullscreen(IConsole::IResult *pResult, void *pUserData, IC
if(pSelf->Graphics() && pResult->NumArguments())
{
if(g_Config.m_GfxFullscreen != pResult->GetInteger(0))
pSelf->SetWindowParams(pResult->GetInteger(0), g_Config.m_GfxBorderless, pResult->GetInteger(0) != 3);
pSelf->SetWindowParams(pResult->GetInteger(0), g_Config.m_GfxBorderless);
}
else
pfnCallback(pResult, pCallbackUserData);
@ -3943,7 +3943,7 @@ void CClient::ConchainWindowBordered(IConsole::IResult *pResult, void *pUserData
if(pSelf->Graphics() && pResult->NumArguments())
{
if(!g_Config.m_GfxFullscreen && (g_Config.m_GfxBorderless != pResult->GetInteger(0)))
pSelf->SetWindowParams(g_Config.m_GfxFullscreen, !g_Config.m_GfxBorderless, g_Config.m_GfxFullscreen != 3);
pSelf->SetWindowParams(g_Config.m_GfxFullscreen, !g_Config.m_GfxBorderless);
}
else
pfnCallback(pResult, pCallbackUserData);

View file

@ -460,7 +460,7 @@ public:
// gfx
void SwitchWindowScreen(int Index) override;
void SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing) override;
void SetWindowParams(int FullscreenMode, bool IsBorderless) override;
void ToggleWindowVSync() override;
void Notify(const char *pTitle, const char *pMessage) override;
void OnWindowResize() override;

View file

@ -2618,9 +2618,9 @@ void CGraphics_Threaded::WarnPngliteIncompatibleImages(bool Warn)
m_WarnPngliteIncompatibleImages = Warn;
}
void CGraphics_Threaded::SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing)
void CGraphics_Threaded::SetWindowParams(int FullscreenMode, bool IsBorderless)
{
m_pBackend->SetWindowParams(FullscreenMode, IsBorderless, AllowResizing);
m_pBackend->SetWindowParams(FullscreenMode, IsBorderless);
CVideoMode CurMode;
m_pBackend->GetCurrentVideoMode(CurMode, m_ScreenHiDPIScale, g_Config.m_GfxDesktopWidth, g_Config.m_GfxDesktopHeight, g_Config.m_GfxScreen);
GotResized(CurMode.m_WindowWidth, CurMode.m_WindowHeight, CurMode.m_RefreshRate);

View file

@ -719,7 +719,7 @@ public:
virtual void Minimize() = 0;
virtual void Maximize() = 0;
virtual void SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing) = 0;
virtual void SetWindowParams(int FullscreenMode, bool IsBorderless) = 0;
virtual bool SetWindowScreen(int Index) = 0;
virtual bool UpdateDisplayMode(int Index) = 0;
virtual int GetWindowScreen() = 0;
@ -1235,7 +1235,7 @@ public:
void Minimize() override;
void Maximize() override;
void WarnPngliteIncompatibleImages(bool Warn) override;
void SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing) override;
void SetWindowParams(int FullscreenMode, bool IsBorderless) override;
bool SetWindowScreen(int Index) override;
void Move(int x, int y) override;
void Resize(int w, int h, int RefreshRate) override;

View file

@ -275,7 +275,7 @@ public:
int WindowHeight() const { return m_ScreenHeight / m_ScreenHiDPIScale; }
virtual void WarnPngliteIncompatibleImages(bool Warn) = 0;
virtual void SetWindowParams(int FullscreenMode, bool IsBorderless, bool AllowResizing) = 0;
virtual void SetWindowParams(int FullscreenMode, bool IsBorderless) = 0;
virtual bool SetWindowScreen(int Index) = 0;
virtual bool SetVSync(bool State) = 0;
virtual bool SetMultiSampling(uint32_t ReqMultiSamplingCount, uint32_t &MultiSamplingCountBackend) = 0;

View file

@ -1562,15 +1562,15 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
if(OldWindowMode != NewWindowMode)
{
if(NewWindowMode == 0)
Client()->SetWindowParams(0, false, true);
Client()->SetWindowParams(0, false);
else if(NewWindowMode == 1)
Client()->SetWindowParams(0, true, true);
Client()->SetWindowParams(0, true);
else if(NewWindowMode == 2)
Client()->SetWindowParams(3, false, false);
Client()->SetWindowParams(3, false);
else if(NewWindowMode == 3)
Client()->SetWindowParams(2, false, true);
Client()->SetWindowParams(2, false);
else if(NewWindowMode == 4)
Client()->SetWindowParams(1, false, true);
Client()->SetWindowParams(1, false);
}
if(Graphics()->GetNumScreens() > 1)