mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
game_window: don't allow resizing until after boot, fix monitor switching
This commit is contained in:
parent
e1edd5f35d
commit
70ebdaa685
3 changed files with 11 additions and 1 deletions
|
|
@ -38,6 +38,7 @@ PPC_FUNC(sub_824EB490)
|
||||||
|
|
||||||
SWA::SGlobals::Init();
|
SWA::SGlobals::Init();
|
||||||
Registry::Save();
|
Registry::Save();
|
||||||
|
GameWindow::SetResizable(true);
|
||||||
|
|
||||||
__imp__sub_824EB490(ctx, base);
|
__imp__sub_824EB490(ctx, base);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -382,6 +382,11 @@ void GameWindow::SetFullscreenCursorVisibility(bool isVisible)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameWindow::SetResizable(bool isResizable)
|
||||||
|
{
|
||||||
|
SDL_SetWindowResizable(s_pWindow, (SDL_bool)isResizable);
|
||||||
|
}
|
||||||
|
|
||||||
bool GameWindow::IsMaximised()
|
bool GameWindow::IsMaximised()
|
||||||
{
|
{
|
||||||
return SDL_GetWindowFlags(s_pWindow) & SDL_WINDOW_MAXIMIZED;
|
return SDL_GetWindowFlags(s_pWindow) & SDL_WINDOW_MAXIMIZED;
|
||||||
|
|
@ -442,7 +447,7 @@ void GameWindow::ResetDimensions()
|
||||||
|
|
||||||
uint32_t GameWindow::GetWindowFlags()
|
uint32_t GameWindow::GetWindowFlags()
|
||||||
{
|
{
|
||||||
uint32_t flags = SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
|
uint32_t flags = SDL_WINDOW_HIDDEN | SDL_WINDOW_ALLOW_HIGHDPI;
|
||||||
|
|
||||||
if (Config::WindowState == EWindowState::Maximised)
|
if (Config::WindowState == EWindowState::Maximised)
|
||||||
flags |= SDL_WINDOW_MAXIMIZED;
|
flags |= SDL_WINDOW_MAXIMIZED;
|
||||||
|
|
@ -480,6 +485,9 @@ void GameWindow::SetDisplay(int displayIndex)
|
||||||
if (!IsFullscreen())
|
if (!IsFullscreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (GetDisplay() == displayIndex)
|
||||||
|
return;
|
||||||
|
|
||||||
s_isChangingDisplay = true;
|
s_isChangingDisplay = true;
|
||||||
|
|
||||||
SDL_Rect bounds;
|
SDL_Rect bounds;
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ public:
|
||||||
static bool IsFullscreen();
|
static bool IsFullscreen();
|
||||||
static bool SetFullscreen(bool isEnabled);
|
static bool SetFullscreen(bool isEnabled);
|
||||||
static void SetFullscreenCursorVisibility(bool isVisible);
|
static void SetFullscreenCursorVisibility(bool isVisible);
|
||||||
|
static void SetResizable(bool isResizable);
|
||||||
static bool IsMaximised();
|
static bool IsMaximised();
|
||||||
static EWindowState SetMaximised(bool isEnabled);
|
static EWindowState SetMaximised(bool isEnabled);
|
||||||
static SDL_Rect GetDimensions();
|
static SDL_Rect GetDimensions();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue