From 7cbe44c4e5b81c5d3d61891255f4ed9291383ac8 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sun, 1 Dec 2024 20:51:37 +0200 Subject: [PATCH] _update sdl --- Source/Engine/Platform/SDL/SDLInput.cpp | 2 +- Source/Engine/Platform/SDL/SDLPlatform.cpp | 2 +- Source/Engine/Platform/SDL/SDLWindow.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Engine/Platform/SDL/SDLInput.cpp b/Source/Engine/Platform/SDL/SDLInput.cpp index 2dd870399..16507130d 100644 --- a/Source/Engine/Platform/SDL/SDLInput.cpp +++ b/Source/Engine/Platform/SDL/SDLInput.cpp @@ -389,7 +389,7 @@ public: SDL_GetGlobalMouseState(&oldPosition.X, &oldPosition.Y); Mouse::SetRelativeMode(relativeMode, window); - if (SDL_SetWindowRelativeMouseMode(static_cast(window)->_window, relativeMode) != 0) + if (!SDL_SetWindowRelativeMouseMode(static_cast(window)->_window, relativeMode)) LOG(Error, "Failed to set mouse relative mode: {0}", String(SDL_GetError())); if (!relativeMode) diff --git a/Source/Engine/Platform/SDL/SDLPlatform.cpp b/Source/Engine/Platform/SDL/SDLPlatform.cpp index acba67ea1..59048628c 100644 --- a/Source/Engine/Platform/SDL/SDLPlatform.cpp +++ b/Source/Engine/Platform/SDL/SDLPlatform.cpp @@ -442,7 +442,7 @@ DialogResult MessageBox::Show(Window* parent, const StringView& text, const Stri data.buttons = dataButtons; int result = -1; - if (SDL_ShowMessageBox(&data, &result) != 0) + if (!SDL_ShowMessageBox(&data, &result)) { #if PLATFORM_LINUX // Fallback to native messagebox implementation in case some system fonts are missing diff --git a/Source/Engine/Platform/SDL/SDLWindow.cpp b/Source/Engine/Platform/SDL/SDLWindow.cpp index aed9efb9f..e3c92a1ec 100644 --- a/Source/Engine/Platform/SDL/SDLWindow.cpp +++ b/Source/Engine/Platform/SDL/SDLWindow.cpp @@ -760,7 +760,7 @@ void SDLWindow::Show() if (_isTrackingMouse) { - if (SDL_CaptureMouse(true) != 0) + if (!SDL_CaptureMouse(true)) { if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError())); @@ -1232,7 +1232,7 @@ void SDLWindow::StartTrackingMouse(bool useMouseScreenOffset) if (_visible) { - if (SDL_CaptureMouse(true) != 0) + if (!SDL_CaptureMouse(true)) { if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError())); @@ -1253,7 +1253,7 @@ void SDLWindow::EndTrackingMouse() _isHorizontalFlippingMouse = false; _isVerticalFlippingMouse = false; - if (SDL_CaptureMouse(false) != 0) + if (!SDL_CaptureMouse(false)) { if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError()));