config: override type operator

This commit is contained in:
Hyper
2024-10-21 17:18:17 +01:00
parent cf8bba788b
commit 231a78a118
6 changed files with 24 additions and 49 deletions
+3 -3
View File
@@ -92,8 +92,8 @@ void Window::Init()
s_window = SDL_CreateWindow(title,
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
Config::WindowWidth.Value,
Config::WindowHeight.Value,
Config::WindowWidth,
Config::WindowHeight,
SDL_WINDOW_RESIZABLE);
if (auto icon = GetIconSurface())
@@ -103,7 +103,7 @@ void Window::Init()
}
SetWindowDimensions();
SetFullscreen(Config::Fullscreen.Value);
SetFullscreen(Config::Fullscreen);
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
+4 -4
View File
@@ -29,8 +29,8 @@ public:
static bool IsDisplayResolution(int w, int h, bool isExact = true)
{
auto width = w <= 0 ? Config::WindowWidth.Value : w;
auto height = h <= 0 ? Config::WindowHeight.Value : h;
auto width = w <= 0 ? Config::WindowWidth : w;
auto height = h <= 0 ? Config::WindowHeight : h;
SDL_Rect displayRect;
if (SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(s_window), &displayRect) == ERROR_SUCCESS)
@@ -83,8 +83,8 @@ public:
static void SetWindowDimensions(int w = -1, int h = -1)
{
auto width = w <= 0 ? Config::WindowWidth.Value : w;
auto height = h <= 0 ? Config::WindowHeight.Value : h;
auto width = w <= 0 ? Config::WindowWidth : w;
auto height = h <= 0 ? Config::WindowHeight : h;
auto isPendingMaximise = false;
if (IsDisplayResolution(width, height))