1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 10:15:36 +01:00

Remove focus union and replace with typed focus (#15426)

* Remove focus union and replace with typed focus

This if for the NSF to allow for CoordsXYZ

* Remove legacy structures

* Rework viewport_create to deduplicate logic

* Simplify yet further

* Apply review comments

* Remove intermediate
This commit is contained in:
Duncan
2021-09-18 20:34:38 +01:00
committed by GitHub
parent c05068e8d1
commit fa57b6aea0
19 changed files with 140 additions and 270 deletions

View File

@@ -127,10 +127,10 @@ public:
// Create viewport
rct_widget& viewportWidget = window_sign_widgets[WIDX_VIEWPORT];
const auto focus = Focus2(CoordsXYZ{ signViewPosition, viewZ });
viewport_create(
this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1,
viewportWidget.height() - 1, 0, { signViewPosition, viewZ }, 0, SPRITE_INDEX_NULL);
viewportWidget.height() - 1, focus);
viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
Invalidate();
@@ -300,9 +300,10 @@ public:
// Create viewport
rct_widget* viewportWidget = &window_sign_widgets[WIDX_VIEWPORT];
const auto focus = Focus2(CoordsXYZ{ signViewPos });
viewport_create(
this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1,
viewportWidget->height() - 1, 0, signViewPos, 0, SPRITE_INDEX_NULL);
viewportWidget->height() - 1, focus);
if (viewport != nullptr)
viewport->flags = gConfigGeneral.always_show_gridlines ? VIEWPORT_FLAG_GRIDLINES : 0;
Invalidate();