1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 17:54:50 +01:00

Make CursorState store a ScreenCoordsXY object

This commit is contained in:
Tulio Leao
2019-12-14 23:30:55 -03:00
parent 9d09f1b95c
commit 2cd3add373
9 changed files with 32 additions and 41 deletions

View File

@@ -126,10 +126,10 @@ rct_window* window_error_open(rct_string_id title, rct_string_id message)
int32_t screenWidth = context_get_width();
int32_t screenHeight = context_get_height();
const CursorState* state = context_get_cursor_state();
x = state->x - (width / 2);
x = state->position.x - (width / 2);
x = std::clamp(x, 0, screenWidth);
y = state->y + 26;
y = state->position.y + 26;
y = std::max(22, y);
maxY = screenHeight - height;
if (y > maxY)