1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-20 06:12:57 +01:00

Window function parameters match underlying type

This commit is contained in:
Michael Bernardi
2024-12-09 02:31:27 +11:00
parent 9c0cc28d7f
commit 1b4e611e2e
2 changed files with 8 additions and 8 deletions

View File

@@ -918,7 +918,7 @@ namespace OpenRCT2::Ui::Windows
return _currentTextBox; 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) if (dw == 0 && dh == 0)
return; return;
@@ -927,8 +927,8 @@ namespace OpenRCT2::Ui::Windows
w.Invalidate(); w.Invalidate();
// Clamp new size to minimum and maximum // Clamp new size to minimum and maximum
w.width = std::clamp<int32_t>(w.width + dw, w.min_width, w.max_width); w.width = std::clamp<int16_t>(w.width + dw, w.min_width, w.max_width);
w.height = std::clamp<int32_t>(w.height + dh, w.min_height, w.max_height); w.height = std::clamp<int16_t>(w.height + dh, w.min_height, w.max_height);
w.OnResize(); w.OnResize();
w.OnPrepareDraw(); 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_width = minWidth;
w.min_height = minHeight; w.min_height = minHeight;
@@ -1259,8 +1259,8 @@ namespace OpenRCT2::Ui::Windows
w.max_height = maxHeight; w.max_height = maxHeight;
// Clamp width and height to minimum and maximum // Clamp width and height to minimum and maximum
int32_t width = std::clamp<int32_t>(w.width, std::min(minWidth, maxWidth), std::max(minWidth, maxWidth)); int16_t width = std::clamp<int16_t>(w.width, std::min(minWidth, maxWidth), std::max(minWidth, maxWidth));
int32_t height = std::clamp<int32_t>(w.height, std::min(minHeight, maxHeight), std::max(minHeight, maxHeight)); int16_t height = std::clamp<int16_t>(w.height, std::min(minHeight, maxHeight), std::max(minHeight, maxHeight));
// Resize window if size has changed // Resize window if size has changed
if (w.width != width || w.height != height) if (w.width != width || w.height != height)

View File

@@ -130,7 +130,7 @@ namespace OpenRCT2::Ui::Windows
bool TextBoxCaretIsFlashed(); bool TextBoxCaretIsFlashed();
const WidgetIdentifier& GetCurrentTextBox(); 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 WindowInitScrollWidgets(WindowBase& w);
void WindowUpdateScrollWidgets(WindowBase& w); void WindowUpdateScrollWidgets(WindowBase& w);
@@ -139,7 +139,7 @@ namespace OpenRCT2::Ui::Windows
void WindowMoveAndSnap(WindowBase& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity); void WindowMoveAndSnap(WindowBase& w, ScreenCoordsXY newWindowCoords, int32_t snapProximity);
void WindowRelocateWindows(int32_t width, int32_t height); 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); bool WindowCanResize(const WindowBase& w);
void InvalidateAllWindowsAfterInput(); void InvalidateAllWindowsAfterInput();