mirror of
https://github.com/hedge-dev/UnleashedRecomp
synced 2026-08-26 16:36:35 -04:00
Implemented camera aspect ratio hooks
This commit is contained in:
@@ -87,7 +87,7 @@ void Window::Init()
|
||||
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
|
||||
SDL_AddEventWatch(Window_OnSDLEvent, s_window);
|
||||
|
||||
s_window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_RESIZABLE);
|
||||
s_window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Window::s_width, Window::s_height, SDL_WINDOW_RESIZABLE);
|
||||
|
||||
if (auto icon = GetIconSurface())
|
||||
{
|
||||
@@ -95,6 +95,7 @@ void Window::Init()
|
||||
SDL_FreeSurface(icon);
|
||||
}
|
||||
|
||||
SetWindowDimensions();
|
||||
SetFullscreen(Config::Fullscreen);
|
||||
|
||||
SDL_SysWMinfo info;
|
||||
|
||||
@@ -13,8 +13,8 @@ public:
|
||||
|
||||
inline static bool s_isFocused;
|
||||
|
||||
inline static int s_width;
|
||||
inline static int s_height;
|
||||
inline static int s_width = 1280;
|
||||
inline static int s_height = 720;
|
||||
|
||||
static SDL_Surface* GetIconSurface(void* pIconBmp = nullptr, size_t iconSize = 0)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void SetWindowDimensions(int w, int h)
|
||||
static void SetWindowDimensions(int w = -1, int h = -1)
|
||||
{
|
||||
auto width = w <= 0 ? Config::Width : w;
|
||||
auto height = h <= 0 ? Config::Height : h;
|
||||
@@ -97,6 +97,9 @@ public:
|
||||
SDL_SetWindowMinimumSize(s_window, 640, 480);
|
||||
SDL_SetWindowPosition(s_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
||||
|
||||
s_width = width;
|
||||
s_height = height;
|
||||
|
||||
if (!isPendingMaximise)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user