1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 19:56:13 +01:00

Refactor viewport_coord_to_map_coord to return a CoordXY

This commit is contained in:
duncanspumpkin
2019-10-30 20:24:13 +00:00
parent 9bf2cffbb7
commit 5ca553dd08
5 changed files with 27 additions and 30 deletions

View File

@@ -1612,10 +1612,9 @@ void input_scroll_viewport(ScreenCoordsXY scrollScreenCoords)
int32_t x = mainWindow->saved_view_x + viewport->view_width / 2 + dx;
int32_t y = mainWindow->saved_view_y + viewport->view_height / 2;
int32_t y_dy = mainWindow->saved_view_y + viewport->view_height / 2 + dy;
LocationXY16 mapCoord, mapCoord_dy;
mapCoord = viewport_coord_to_map_coord(x, y, 0);
mapCoord_dy = viewport_coord_to_map_coord(x, y_dy, 0);
auto mapCoord = viewport_coord_to_map_coord(x, y, 0);
auto mapCoord_dy = viewport_coord_to_map_coord(x, y_dy, 0);
// Check if we're crossing the boundary
// Clamp to the map minimum value