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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user