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

refactor some of the track design place code

This commit is contained in:
Ted John
2016-04-28 19:43:20 +01:00
parent 68520765fc
commit e9935fee09
7 changed files with 203 additions and 285 deletions

View File

@@ -413,7 +413,7 @@ static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
// Load in a new preview image, calculate cost variable, calculate var_06
draw_track_preview(td6, (uint8**)_loadedTrackDesignPreview);
td6->cost = RCT2_GLOBAL(RCT2_ADDRESS_TRACK_DESIGN_COST, money32);
td6->cost = gTrackDesignCost;
td6->track_flags = RCT2_GLOBAL(0x00F44151, uint8) & 7;
_loadedTrackDesignIndex = trackIndex;

View File

@@ -307,7 +307,7 @@ static void window_track_place_clear_provisional()
if (_window_track_place_last_was_valid) {
sub_6D01B3(
gActiveTrackDesign,
6,
PTD_OPERATION_CLEAR_OUTLINES,
RCT2_GLOBAL(0x00F440EB, uint8),
_window_track_place_last_valid_x,
_window_track_place_last_valid_y,
@@ -342,7 +342,7 @@ static int window_track_place_get_base_z(int x, int y)
if (mapElement->properties.surface.terrain & 0x1F)
z = max(z, (mapElement->properties.surface.terrain & 0x1F) << 4);
return z + sub_6D01B3(gActiveTrackDesign, 3, 0, x, y, z);
return z + sub_6D01B3(gActiveTrackDesign, PTD_OPERATION_GET_PLACE_Z, 0, x, y, z);
}
static void window_track_place_attempt_placement(int x, int y, int z, int bl, money32 *cost, uint8 *rideIndex)
@@ -475,7 +475,7 @@ static void window_track_place_toolupdate(rct_window* w, int widgetIndex, int x,
// Check if tool map position has changed since last update
if (mapX == _window_track_place_last_x && mapY == _window_track_place_last_y) {
sub_6D01B3(gActiveTrackDesign, 0, 0, mapX, mapY, 0);
sub_6D01B3(gActiveTrackDesign, PTD_OPERATION_DRAW_OUTLINES, 0, mapX, mapY, 0);
return;
}
@@ -508,7 +508,7 @@ static void window_track_place_toolupdate(rct_window* w, int widgetIndex, int x,
widget_invalidate(w, WIDX_PRICE);
}
sub_6D01B3(gActiveTrackDesign, 0, 0, mapX, mapY, mapZ);
sub_6D01B3(gActiveTrackDesign, PTD_OPERATION_DRAW_OUTLINES, 0, mapX, mapY, mapZ);
}
/**