mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 02:47:02 +02:00
window: ignore nonpositive resize dimensions
This commit is contained in:
@@ -362,11 +362,13 @@ static void GameEventDidEnterForeground(WindowLoopState& game) {
|
|||||||
SetPause(game, false);
|
SetPause(game, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowContext::Resize(uint32_t new_width, uint32_t new_height) {
|
void WindowContext::Resize(int new_width, int new_height) {
|
||||||
EXIT_IF(new_width == 0 || new_height == 0);
|
if (new_width <= 0 || new_height <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Common::LockGuard lock(mutex);
|
Common::LockGuard lock(mutex);
|
||||||
graphic_ctx.screen_width = new_width;
|
graphic_ctx.screen_width = static_cast<uint32_t>(new_width);
|
||||||
graphic_ctx.screen_height = new_height;
|
graphic_ctx.screen_height = static_cast<uint32_t>(new_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowContext::ProcessWindowEvent(const SDL_WindowEvent& event) {
|
void WindowContext::ProcessWindowEvent(const SDL_WindowEvent& event) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ struct WindowContext {
|
|||||||
void RefreshSurfaceCapabilities();
|
void RefreshSurfaceCapabilities();
|
||||||
void UpdateIcon();
|
void UpdateIcon();
|
||||||
void UpdateTitle();
|
void UpdateTitle();
|
||||||
void Resize(uint32_t width, uint32_t height);
|
void Resize(int width, int height);
|
||||||
void ProcessWindowEvent(const SDL_WindowEvent& event);
|
void ProcessWindowEvent(const SDL_WindowEvent& event);
|
||||||
void ProcessDisplayEvent(const SDL_DisplayEvent& event);
|
void ProcessDisplayEvent(const SDL_DisplayEvent& event);
|
||||||
void ProcessEvent(double time_seconds);
|
void ProcessEvent(double time_seconds);
|
||||||
|
|||||||
Reference in New Issue
Block a user