1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 14:02:59 +01:00

Implement station

This commit is contained in:
Ted John
2016-10-04 18:39:22 +01:00
parent 67d04a26ee
commit 461680be46
3 changed files with 40 additions and 0 deletions

View File

@@ -29,6 +29,10 @@
enum {
SPR_WILD_MOUSE_FLAT_SW_NE = 16900,
SPR_WILD_MOUSE_FLAT_NW_SE = 16901,
SPR_WILD_MOUSE_STATION_SW_NE = 16902,
SPR_WILD_MOUSE_STATION_NW_SE = 16903,
SPR_WILD_MOUSE_STATION_END_SW_NE = 16904,
SPR_WILD_MOUSE_STATION_END_NW_SE = 16905,
};
static void wild_mouse_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
@@ -50,11 +54,35 @@ static void wild_mouse_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 di
paint_util_set_general_support_height(height + 32, 0x20);
}
static void wild_mouse_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
static const uint32 imageIds[4][3] = {
{ SPR_WILD_MOUSE_STATION_SW_NE, SPR_WILD_MOUSE_STATION_END_SW_NE, SPR_STATION_BASE_B_SW_NE },
{ SPR_WILD_MOUSE_STATION_NW_SE, SPR_WILD_MOUSE_STATION_END_NW_SE, SPR_STATION_BASE_B_NW_SE },
{ SPR_WILD_MOUSE_STATION_SW_NE, SPR_WILD_MOUSE_STATION_END_SW_NE, SPR_STATION_BASE_B_SW_NE },
{ SPR_WILD_MOUSE_STATION_NW_SE, SPR_WILD_MOUSE_STATION_END_NW_SE, SPR_STATION_BASE_B_NW_SE },
};
int trackType = mapElement->properties.track.type;
int t = (trackType == TRACK_ELEM_END_STATION ? 1 : 0);
sub_98197C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 2, height - 2, 0, 2, height);
sub_98199C_rotated(direction, imageIds[direction][t] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 2, height, 0, 0, height);
track_paint_util_draw_station_metal_supports(direction, height, gTrackColours[SCHEME_SUPPORTS]);
track_paint_util_draw_station(rideIndex, trackSequence, direction, height, mapElement);
paint_util_push_tunnel_rotated(direction, height, TUNNEL_6);
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 32, 0x20);
}
TRACK_PAINT_FUNCTION get_track_paint_function_wild_mouse(int trackType, int direction)
{
switch (trackType) {
case TRACK_ELEM_FLAT:
return wild_mouse_track_flat;
case TRACK_ELEM_END_STATION:
case TRACK_ELEM_BEGIN_STATION:
case TRACK_ELEM_MIDDLE_STATION:
return wild_mouse_track_station;
}
return NULL;
}

View File

@@ -554,6 +554,17 @@ void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definit
}
}
void track_paint_util_draw_station_metal_supports(uint8 direction, uint16 height, uint32 colour)
{
if (direction & 1) {
metal_a_supports_paint_setup(3, 6, 0, height, colour);
metal_a_supports_paint_setup(3, 7, 0, height, colour);
} else {
metal_a_supports_paint_setup(3, 5, 0, height, colour);
metal_a_supports_paint_setup(3, 8, 0, height, colour);
}
}
const rct_xy16 defaultRightHelixUpSmallQuarterBoundLengths[4][3][2] = {
{
{32, 20},

View File

@@ -228,6 +228,7 @@ void track_paint_util_draw_station_platform(rct_ride *ride, uint8 direction, int
void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement);
bool track_paint_util_should_paint_supports(rct_xy16 position);
void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definition * entranceStyle, rct_xy16 position, uint8 direction, int height, rct_map_element * mapElement, uint8 rotation);
void track_paint_util_draw_station_metal_supports(uint8 direction, uint16 height, uint32 colour);
void track_paint_util_right_quarter_turn_5_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const rct_xy16 offsets[4][5], const rct_xy16 boundsLengths[4][5], const rct_xyz16 boundsOffsets[4][5], uint8 rotation);
void track_paint_util_right_quarter_turn_5_tiles_paint_2(sint16 height, int direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[][5]);