mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-01 11:15:13 +01:00
Close #12245: Use coords objects for SetLocation (Window_internal.h)
This commit is contained in:
@@ -478,7 +478,7 @@ private:
|
||||
// Prevent scroll adjustment due to window placement when in-game
|
||||
auto oldScreenFlags = gScreenFlags;
|
||||
gScreenFlags = SCREEN_FLAGS_TITLE_DEMO;
|
||||
w->SetLocation(loc.x, loc.y, z);
|
||||
w->SetLocation({ loc, z });
|
||||
gScreenFlags = oldScreenFlags;
|
||||
|
||||
viewport_update_position(w);
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Editor
|
||||
gS6Info.category = SCENARIO_CATEGORY_OTHER;
|
||||
viewport_init_all();
|
||||
rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN);
|
||||
mainWindow->SetLocation(2400, 2400, 112);
|
||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||
load_palette();
|
||||
gScreenAge = 0;
|
||||
gScenarioName = language_get_string(STR_MY_NEW_SCENARIO);
|
||||
@@ -163,7 +163,7 @@ namespace Editor
|
||||
gS6Info.editor_step = EDITOR_STEP_OBJECT_SELECTION;
|
||||
viewport_init_all();
|
||||
rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN);
|
||||
mainWindow->SetLocation(2400, 2400, 112);
|
||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||
load_palette();
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace Editor
|
||||
gS6Info.editor_step = EDITOR_STEP_OBJECT_SELECTION;
|
||||
viewport_init_all();
|
||||
rct_window* mainWindow = context_open_window_view(WV_EDITOR_MAIN);
|
||||
mainWindow->SetLocation(2400, 2400, 112);
|
||||
mainWindow->SetLocation(TileCoordsXYZ{ 75, 75, 14 }.ToCoordsXYZ());
|
||||
load_palette();
|
||||
}
|
||||
|
||||
|
||||
@@ -909,7 +909,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
|
||||
{
|
||||
auto location = TileCoordsXYZ(int_val[0], int_val[1], 0).ToCoordsXYZ().ToTileCentre();
|
||||
location.z = tile_element_height(location);
|
||||
w->SetLocation(location.x, location.y, location.z);
|
||||
w->SetLocation(location);
|
||||
viewport_update_position(w);
|
||||
console.Execute("get location");
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
#include "../world/Sprite.h"
|
||||
|
||||
void rct_window::SetLocation(int32_t newX, int32_t newY, int32_t newZ)
|
||||
void rct_window::SetLocation(const CoordsXYZ& coords)
|
||||
{
|
||||
window_scroll_to_location(this, { newX, newY, newZ });
|
||||
window_scroll_to_location(this, coords);
|
||||
flags &= ~WF_SCROLLING_TO_LOCATION;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ struct rct_window
|
||||
uint8_t visibility;
|
||||
uint16_t viewport_smart_follow_sprite; // Handles setting viewport target sprite etc
|
||||
|
||||
void SetLocation(int32_t x, int32_t y, int32_t z);
|
||||
void SetLocation(const CoordsXYZ& coords);
|
||||
void ScrollToViewport();
|
||||
void Invalidate();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user