Draw pier

This commit is contained in:
Marijn van der Werf 2016-05-20 21:22:47 +02:00
parent 790966d928
commit be666436f5
4 changed files with 58 additions and 33 deletions

View File

@ -302,6 +302,44 @@ bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const r
return true;
}
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)
{
bool hasFence;
uint32 imageId;
if (direction & 1) {
hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation());
imageId = (hasFence ? SPR_STATION_PIER_EDGE_NE_FENCED : SPR_STATION_PIER_EDGE_NE) | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98197C(imageId, 0, 0, 6, 32, 1, height, 2, 0, height, get_current_rotation());
track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, height);
imageId = SPR_STATION_PIER_EDGE_SW | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 24, 0, 8, 32, 1, height, get_current_rotation());
hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation());
if (hasFence) {
imageId = SPR_STATION_PIER_FENCE_SW | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 31, 0, 1, 32, 7, height + 2, get_current_rotation());
}
track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height);
} else {
hasFence = track_paint_util_has_fence(EDGE_NW, position, mapElement, ride, rotation);
imageId = (hasFence ? SPR_STATION_PIER_EDGE_NW_FENCED : SPR_STATION_PIER_EDGE_NW) | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98197C(imageId, 0, 0, 32, 6, 1, height, 0, 2, height, rotation);
track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, height);
imageId = SPR_STATION_PIER_EDGE_SE | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 0, 24, 32, 8, 1, height, rotation);
hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, rotation);
if (hasFence) {
imageId = SPR_STATION_PIER_FENCE_SE | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 0, 31, 32, 1, 7, height + 2, rotation);
}
track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height);
}
}
static const sint8 left_quarter_turn_3_tiles_sprite_map[] = {2, -1, 1, 0};
void track_paint_util_left_quarter_turn_3_tiles_paint(sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation)
{

View File

@ -159,6 +159,7 @@ void track_paint_util_paint_floor(uint8 edges, uint32 colourFlags, uint16 height
void track_paint_util_paint_fences(uint8 edges, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint32 colourFlags, uint16 height, const uint32 fenceSprites[4], uint8 rotation);
bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height);
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_left_quarter_turn_3_tiles_paint(sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation);
void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence);

View File

@ -51,9 +51,23 @@ static void paint_boat_ride_track_flat(uint8 rideIndex, uint8 trackSequence, uin
paint_util_set_general_support_height(height + 16, 0x20);
}
/** rct2: 0x */
/** rct2: 0x008B0E50 */
static void paint_boat_ride_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)};
rct_ride * ride = get_ride(rideIndex);
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
if (direction & 1) {
paint_util_push_tunnel_right(height, TUNNEL_6);
track_paint_util_draw_pier(ride, entranceStyle, position, direction, height, mapElement, get_current_rotation());
} else {
paint_util_push_tunnel_left(height, TUNNEL_6);
track_paint_util_draw_pier(ride, entranceStyle, position, direction, height, mapElement, get_current_rotation());
}
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 32, 0x20);
}
/** rct2: 0x */

View File

@ -73,47 +73,19 @@ static void submarine_ride_paint_track_station(uint8 rideIndex, uint8 trackSeque
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
int heightLower = height - 16;
uint32 imageId;
bool hasFence;
if (direction & 1) {
imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 20, 32, 3, heightLower, 6, 0, heightLower, get_current_rotation());
paint_util_push_tunnel_right(height, TUNNEL_6);
hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation());
imageId = (hasFence ? SPR_STATION_PIER_EDGE_NE_FENCED : SPR_STATION_PIER_EDGE_NE) | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98197C(imageId, 0, 0, 6, 32, 1, height, 2, 0, height, get_current_rotation());
track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, height);
imageId = SPR_STATION_PIER_EDGE_SW | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 24, 0, 8, 32, 1, height, get_current_rotation());
hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation());
if (hasFence) {
imageId = SPR_STATION_PIER_FENCE_SW | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 31, 0, 1, 32, 7, height + 2, get_current_rotation());
}
track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height);
track_paint_util_draw_pier(ride, entranceStyle, position, direction, height, mapElement, get_current_rotation());
} else {
imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 32, 20, 3, heightLower, 0, 6, heightLower, get_current_rotation());
paint_util_push_tunnel_left(height, TUNNEL_6);
hasFence = track_paint_util_has_fence(EDGE_NW, position, mapElement, ride, get_current_rotation());
imageId = (hasFence ? SPR_STATION_PIER_EDGE_NW_FENCED : SPR_STATION_PIER_EDGE_NW) | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98197C(imageId, 0, 0, 32, 6, 1, height, 0, 2, height, get_current_rotation());
track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, height);
imageId = SPR_STATION_PIER_EDGE_SE | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 0, 24, 32, 8, 1, height, get_current_rotation());
hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation());
if (hasFence) {
imageId = SPR_STATION_PIER_FENCE_SE | RCT2_GLOBAL(0x00F4419C, uint32);
sub_98196C(imageId, 0, 31, 32, 1, 7, height + 2, get_current_rotation());
}
track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height);
track_paint_util_draw_pier(ride, entranceStyle, position, direction, height, mapElement, get_current_rotation());
}
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);