From 1b4e611e2e80ed4c9d842b54f135b8792694166c Mon Sep 17 00:00:00 2001 From: Michael Bernardi Date: Mon, 9 Dec 2024 02:31:27 +1100 Subject: [PATCH] Window function parameters match underlying type --- src/openrct2-ui/interface/Window.cpp | 12 ++++++------ src/openrct2-ui/interface/Window.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 5d0a27e8aa..35ce40407a 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -918,7 +918,7 @@ namespace OpenRCT2::Ui::Windows return _currentTextBox; } - void WindowResize(WindowBase& w, int32_t dw, int32_t dh) + void WindowResize(WindowBase& w, int16_t dw, int16_t dh) { if (dw == 0 && dh == 0) return; @@ -927,8 +927,8 @@ namespace OpenRCT2::Ui::Windows w.Invalidate(); // Clamp new size to minimum and maximum - w.width = std::clamp(w.width + dw, w.min_width, w.max_width); - w.height = std::clamp(w.height + dh, w.min_height, w.max_height); + w.width = std::clamp(w.width + dw, w.min_width, w.max_width); + w.height = std::clamp(w.height + dh, w.min_height, w.max_height); w.OnResize(); w.OnPrepareDraw(); @@ -1251,7 +1251,7 @@ namespace OpenRCT2::Ui::Windows }); } - void WindowSetResize(WindowBase& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight) + void WindowSetResize(WindowBase& w, int16_t minWidth, int16_t minHeight, int16_t maxWidth, int16_t maxHeight) { w.min_width = minWidth; w.min_height = minHeight; @@ -1259,8 +1259,8 @@ namespace OpenRCT2::Ui::Windows w.max_height = maxHeight; // Clamp width and height to minimum and maximum - int32_t width = std::clamp(w.width, std::min(minWidth, maxWidth), std::max(minWidth, maxWidth)); - int32_t height = std::clamp(w.height, std::min(minHeight, maxHeight), std::max(minHeight, maxHeight)); + int16_t width = std::clamp(w.width, std::min(minWidth, maxWidth), std::max(minWidth, maxWidth)); + int16_t height = std::clamp(w.height, std::min(minHeight, maxHeight), std::max(minHeight, maxHeight)); // Resize window if size has changed if (w.width != width || w.height != height) diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index fc6ca7893d..47124a7409 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -130,7 +130,7 @@ namespace OpenRCT2::Ui::Windows bool TextBoxCaretIsFlashed(); const WidgetIdentifier& GetCurrentTextBox(); - void WindowResize(WindowBase& w, int32_t dw, int32_t dh); + void WindowResize(WindowBase& w, int16_t dw, int16_t dh); void WindowInitScrollWidgets(WindowBase& w); void WindowUpdateScrollWidgets(WindowBase& w); @@ -139,7 +139,7 @@ namespace OpenRCT2::Ui::Windows void WindowMoveAndSnap(WindowBase& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity); void WindowRelocateWindows(int32_t width, int32_t height); - void WindowSetResize(WindowBase& w, int32_t minWidth, int32_t minHeight, int32_t maxWidth, int32_t maxHeight); + void WindowSetResize(WindowBase& w, int16_t minWidth, int16_t minHeight, int16_t maxWidth, int16_t maxHeight); bool WindowCanResize(const WindowBase& w); void InvalidateAllWindowsAfterInput();