/** rct2: 0x00811324 */ static void paint_virginia_reel_track_left_quarter_turn_1_tile( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { track_paint_util_left_quarter_turn_1_tile_paint( session, 2, height, 0, direction, session->TrackColours[SCHEME_TRACK], virginia_reel_track_pieces_flat_quarter_turn_1_tile, session->CurrentRotation); switch (direction) { case 0: wooden_a_supports_paint_setup(session, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_left(session, height, TUNNEL_6); break; case 1: wooden_a_supports_paint_setup(session, 2, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); break; case 2: wooden_a_supports_paint_setup(session, 3, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height, TUNNEL_6); break; case 3: wooden_a_supports_paint_setup(session, 4, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height, TUNNEL_6); paint_util_push_tunnel_left(session, height, TUNNEL_6); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
/** rct2: 0x00811324 */ static void paint_virginia_reel_track_left_quarter_turn_1_tile(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { track_paint_util_left_quarter_turn_1_tile_paint(2, height, 0, direction, gTrackColours[SCHEME_TRACK], virginia_reel_track_pieces_flat_quarter_turn_1_tile, get_current_rotation()); switch (direction) { case 0: wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_push_tunnel_left(height, TUNNEL_6); break; case 1: wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); break; case 2: wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_push_tunnel_right(height, TUNNEL_6); break; case 3: wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_push_tunnel_right(height, TUNNEL_6); paint_util_push_tunnel_left(height, TUNNEL_6); break; } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 32, 0x20); }
/** rct2: 0x00811294 */ static void paint_virginia_reel_track_25_deg_up_to_flat( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { const uint32 * sprites = virginia_reel_track_pieces_25_deg_up_to_flat; if (track_element_is_lift_hill(tileElement)) { sprites = virginia_reel_track_pieces_25_deg_up_to_flat_lift_hill; } uint32 imageId = sprites[direction] | session->TrackColours[SCHEME_TRACK]; paint_struct * ps; if (direction & 1) { ps = sub_98197C(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); } else { ps = sub_98197C(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); } if (direction == 1 || direction == 2) { session->WoodenSupportsPrependTo = ps; } switch (direction) { case 0: wooden_a_supports_paint_setup(session, 0, 5, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_left(session, height - 8, TUNNEL_6); break; case 1: wooden_a_supports_paint_setup(session, 1, 6, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height + 8, TUNNEL_14); break; case 2: wooden_a_supports_paint_setup(session, 0, 7, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_left(session, height + 8, TUNNEL_14); break; case 3: wooden_a_supports_paint_setup(session, 1, 8, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_right(session, height - 8, TUNNEL_6); break; } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 40, 0x20); }
/** rct2: 0x00770CCC */ static void paint_ghost_train_track_spinning_tunnel( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { uint32 imageId = ghost_train_track_pieces_spinning_tunnel_track[direction] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(session, imageId, 0, 0, 28, 20, 3, height, 2, 6, height); } else { sub_98197C(session, imageId, 0, 0, 20, 28, 3, height, 6, 2, height); } track_paint_util_spinning_tunnel_paint(session, 3, height, direction); if (direction == 0 || direction == 2) { paint_util_push_tunnel_left(session, height, TUNNEL_0); } else { paint_util_push_tunnel_right(session, height, TUNNEL_0); } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
/** rct2: 0x00811304 */ static void paint_virginia_reel_track_left_quarter_turn_3_tiles( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { track_paint_util_left_quarter_turn_3_tiles_paint( session, 2, height, direction, trackSequence, session->TrackColours[SCHEME_TRACK], virginia_reel_track_pieces_flat_quarter_turn_3_tiles, session->CurrentRotation); track_paint_util_left_quarter_turn_3_tiles_tunnel(session, height, TUNNEL_6, direction, trackSequence); switch (trackSequence) { case 2: paint_util_set_segment_support_height( session, paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); break; case 0: case 3: wooden_a_supports_paint_setup(session, virginia_reel_left_quarter_turn_supports[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; } paint_util_set_general_support_height(session, height + 32, 0x20); }
/** rct2: 0x00811264 */ static void paint_virginia_reel_track_flat( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { const uint32 * sprites = virginia_reel_track_pieces_flat; if (track_element_is_lift_hill(tileElement)) { sprites = virginia_reel_track_pieces_flat_lift_hill; } uint32 imageId = sprites[direction] | session->TrackColours[SCHEME_TRACK]; if (direction & 1) { sub_98197C(session, imageId, 0, 0, 27, 32, 2, height, 2, 0, height); paint_util_push_tunnel_right(session, height, TUNNEL_6); } else { sub_98197C(session, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); paint_util_push_tunnel_left(session, height, TUNNEL_6); } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
static void wooden_wild_mouse_track_station( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { static constexpr const uint32 imageIds[4][2] = { { SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, SPR_STATION_BASE_B_SW_NE }, { SPR_WOODEN_WILD_MOUSE_FLAT_NW_SE, SPR_STATION_BASE_B_NW_SE }, { SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, SPR_STATION_BASE_B_SW_NE }, { SPR_WOODEN_WILD_MOUSE_FLAT_NW_SE, SPR_STATION_BASE_B_NW_SE }, }; sub_98197C_rotated(session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height - 2, 0, 2, height); sub_98199C_rotated(session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height, 0, 0, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); track_paint_util_draw_station(session, rideIndex, trackSequence, direction, height, tileElement); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_6); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
/** rct2: 0x008112D4, 0x008112E4, 0x008112F4 */ static void paint_virginia_reel_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { uint32 imageId; if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | gTrackColours[SCHEME_MISC]; sub_98197C(imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height, get_current_rotation()); imageId = SPR_VIRGINIA_REEL_FLAT_SW_NE | gTrackColours[SCHEME_TRACK]; sub_98199C(imageId, 0, 0, 32, 20, 2, height, 0, 0, height, get_current_rotation()); paint_util_push_tunnel_left(height, TUNNEL_6); } else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | gTrackColours[SCHEME_MISC]; sub_98197C(imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height, get_current_rotation()); imageId = SPR_VIRGINIA_REEL_FLAT_NW_SE | gTrackColours[SCHEME_TRACK]; sub_98199C(imageId, 0, 0, 20, 32, 2, height, 0, 0, height, get_current_rotation()); paint_util_push_tunnel_right(height, TUNNEL_6); } wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); track_paint_util_draw_station(rideIndex, trackSequence, direction, height, mapElement); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 32, 0x20); }
/** rct2: 0x008A5464 */ static void wooden_wild_mouse_track_flat( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { static constexpr const uint32 imageIds[4] = { SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, SPR_WOODEN_WILD_MOUSE_FLAT_NW_SE, SPR_WOODEN_WILD_MOUSE_FLAT_SW_NE, SPR_WOODEN_WILD_MOUSE_FLAT_NW_SE, }; uint32 imageId = imageIds[direction] | session->TrackColours[SCHEME_TRACK]; sub_98196C_rotated(session, direction, imageId, 0, 6, 32, 20, 1, height); wooden_a_supports_paint_setup(session, direction & 1, 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0); paint_util_set_segment_support_height( session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D4, direction), height, 0x20); paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
static void wooden_wild_mouse_track_right_quarter_turn_3( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { static constexpr const sprite_bb imageIds[4][3] = { { { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SW_SE_PART_0, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SW_SE_PART_1, { 16, 16, 0 }, { 0, 0, 0 }, { 16, 16, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SW_SE_PART_2, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 1 } }, }, { { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_NW_SW_PART_0, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_NW_SW_PART_1, { 16, 0, 0 }, { 0, 0, 0 }, { 16, 16, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_NW_SW_PART_2, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 1 } }, }, { { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_NE_NW_PART_0, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_NE_NW_PART_1, { 0, 0, 0 }, { 0, 0, 0 }, { 16, 16, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_NE_NW_PART_2, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 1 } }, }, { { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_0, { 6, 0, 0 }, { 0, 0, 0 }, { 20, 32, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_1, { 0, 16, 0 }, { 0, 0, 0 }, { 16, 16, 1 } }, { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_3_SE_NE_PART_2, { 0, 6, 0 }, { 0, 0, 0 }, { 32, 20, 1 } }, } }; static uint8 supportType[] = { 4, 5, 2, 3 }; track_paint_util_right_quarter_turn_3_tiles_paint_4( session, height, direction, session->CurrentRotation, trackSequence, session->TrackColours[SCHEME_TRACK], imageIds); track_paint_util_right_quarter_turn_3_tiles_tunnel(session, height, direction, trackSequence, TUNNEL_0); switch (trackSequence) { case 0: case 3: wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); break; } sint32 blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENTS_ALL; break; case 2: blockedSegments = SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4; break; case 3: blockedSegments = SEGMENTS_ALL; break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
/** rct2: 0x00811294 */ static void paint_virginia_reel_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { const uint32 * sprites = virginia_reel_track_pieces_25_deg_up_to_flat; if (mapElement->type & 0x80) { sprites = virginia_reel_track_pieces_25_deg_up_to_flat_lift_hill; } uint32 imageId = sprites[direction] | gTrackColours[SCHEME_TRACK]; paint_struct * ps; if (direction & 1) { ps = sub_98197C(imageId, 0, 0, 27, 32, 2, height, 2, 0, height, get_current_rotation()); } else { ps = sub_98197C(imageId, 0, 0, 32, 27, 2, height, 0, 2, height, get_current_rotation()); } if (direction == 1 || direction == 2) { gWoodenSupportsPrependTo = ps; } switch (direction) { case 0: wooden_a_supports_paint_setup(0, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_push_tunnel_left(height - 8, TUNNEL_6); break; case 1: wooden_a_supports_paint_setup(1, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_push_tunnel_right(height + 8, TUNNEL_14); break; case 2: wooden_a_supports_paint_setup(0, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_push_tunnel_left(height + 8, TUNNEL_14); break; case 3: wooden_a_supports_paint_setup(1, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_push_tunnel_right(height - 8, TUNNEL_6); break; } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 40, 0x20); }
static void wooden_wild_mouse_track_60_deg_to_25_deg_up( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { static constexpr const uint32 imageIds[2][4][2] = { { { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_SW_NE, 0 }, { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_NW_SE, SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_FRONT_NW_SE }, { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_NE_SW, SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_FRONT_NE_SW }, { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_SE_NW, 0 }, }, { { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_CHAIN_SW_NE, 0 }, { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_CHAIN_NW_SE, SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_CHAIN_FRONT_NW_SE }, { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_CHAIN_NE_SW, SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_CHAIN_FRONT_NE_SW }, { SPR_WOODEN_WILD_MOUSE_60_DEG_TO_25_DEG_CHAIN_SE_NW, 0 }, }, }; uint8 isChained = track_element_is_lift_hill(tileElement) ? 1 : 0; uint32 imageId; if (direction == 0 || direction == 3) { imageId = imageIds[isChained][direction][0] | session->TrackColours[SCHEME_TRACK]; sub_98197C_rotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); } else { imageId = imageIds[isChained][direction][0] | session->TrackColours[SCHEME_TRACK]; session->WoodenSupportsPrependTo = sub_98197C_rotated(session, direction, imageId, 0, 6, 2, 24, 43, height, 28, 4, height + 2); imageId = imageIds[isChained][direction][1] | session->TrackColours[SCHEME_TRACK]; sub_98197C_rotated(session, direction, imageId, 0, 6, 32, 2, 43, height, 0, 4, height); } wooden_a_supports_paint_setup(session, direction & 1, 17 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1); } else { paint_util_push_tunnel_rotated(session, direction, height + 24, TUNNEL_2); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 72, 0x20); }
/** rct2: 0x00767C40 */ static void paint_space_rings(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { trackSequence = track_map_3x3[direction][trackSequence]; sint32 edges = edges_3x3[trackSequence]; rct_ride * ride = get_ride(rideIndex); rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; uint32 imageId; wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL); track_paint_util_paint_floor(edges, gTrackColours[SCHEME_TRACK], height, floorSpritesCork, get_current_rotation()); switch (trackSequence) { case 7: if (track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation())) { imageId = SPR_SPACE_RINGS_FENCE_SW | gTrackColours[SCHEME_MISC]; sub_98197C(imageId, 0, 0, 1, 28, 7, height, 29, 0, height + 2, get_current_rotation()); } if (track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation())) { imageId = SPR_SPACE_RINGS_FENCE_SE | gTrackColours[SCHEME_MISC]; sub_98197C(imageId, 0, 0, 28, 1, 7, height, 0, 29, height + 2, get_current_rotation()); } break; default: track_paint_util_paint_fences(edges, position, mapElement, ride, gTrackColours[SCHEME_MISC], height, space_rings_fence_sprites, get_current_rotation()); break; } switch (trackSequence) { case 0: paint_space_rings_structure(ride, direction, 0, height + 3); break; case 5: paint_space_rings_structure(ride, direction, 1, height + 3); break; case 7: paint_space_rings_structure(ride, direction, 2, height + 3); break; case 8: paint_space_rings_structure(ride, direction, 3, height + 3); break; } sint32 cornerSegments = 0; switch (trackSequence) { case 0: cornerSegments = 0; break; case 1: cornerSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 2: cornerSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 3: cornerSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 4: cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; break; case 5: cornerSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 6: cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; case 7: cornerSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break; case 8: cornerSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } paint_util_set_segment_support_height(cornerSegments, height + 2, 0x20); paint_util_set_segment_support_height(SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); }
/** rct2: 0x00886194 */ static void paint_roto_drop_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { trackSequence = track_map_3x3[direction][trackSequence]; int edges = edges_3x3[trackSequence]; rct_ride * ride = get_ride(rideIndex); rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL); uint32 imageId = SPR_FLOOR_METAL_B | gTrackColours[SCHEME_SUPPORTS]; sub_98197C(imageId, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); track_paint_util_paint_fences(edges, position, mapElement, ride, gTrackColours[SCHEME_TRACK], height, fenceSpritesMetalB, get_current_rotation()); if (trackSequence == 0) { imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_90_DEG : SPR_ROTO_DROP_TOWER_BASE) | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3, get_current_rotation()); imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 2, 2, 30, height + 32, 8, 8, height + 32, get_current_rotation()); imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 2, 2, 30, height + 64, 8, 8, height + 64, get_current_rotation()); paint_util_set_vertical_tunnel(height + 96); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); #ifdef __TESTPAINT__ paint_util_set_general_support_height(height + 32, 0x20); #else paint_util_set_general_support_height(height + 96, 0x20); #endif return; } int blockedSegments = 0; switch (trackSequence) { case 1: blockedSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 2: blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 3: blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 4: blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; break; case 5: blockedSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 6: blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; case 7: blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break; case 8: blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } paint_util_set_segment_support_height(blockedSegments, 0xFFFF, 0); paint_util_set_segment_support_height(SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); paint_util_set_general_support_height(height + 32, 0x20); }
/** rct2: 0x006FD1F8 */ static void paint_launched_freefall_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { trackSequence = track_map_3x3[direction][trackSequence]; sint32 edges = edges_3x3[trackSequence]; rct_ride * ride = get_ride(rideIndex); rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL); uint32 imageId = SPR_FLOOR_METAL | gTrackColours[SCHEME_SUPPORTS]; sub_98197C(imageId, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); track_paint_util_paint_fences(edges, position, mapElement, ride, gTrackColours[SCHEME_TRACK], height, launched_freefall_fence_sprites, get_current_rotation()); if (trackSequence == 0) { imageId = SPR_LAUNCHED_FREEFALL_TOWER_BASE | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3, get_current_rotation()); height += 32; imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation()); height += 32; imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation()); paint_util_set_vertical_tunnel(height + 32); height -= 64; } sint32 blockedSegments = 0; switch (trackSequence) { case 0: blockedSegments = SEGMENTS_ALL; break; case 1: blockedSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 2: blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 3: blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 4: blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; break; case 5: blockedSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 6: blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; case 7: blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break; case 8: blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } paint_util_set_segment_support_height(blockedSegments, 0xFFFF, 0); paint_util_set_segment_support_height(SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); paint_util_set_general_support_height(height + 32, 0x20); }
static void paint_crooked_house(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { trackSequence = track_map_3x3[direction][trackSequence]; int edges = edges_3x3[trackSequence]; rct_ride * ride = get_ride(rideIndex); rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL); track_paint_util_paint_floor(edges, gTrackColours[SCHEME_TRACK], height, floorSpritesCork, get_current_rotation()); track_paint_util_paint_fences(edges, position, mapElement, ride, gTrackColours[SCHEME_MISC], height, fenceSpritesRope, get_current_rotation()); switch(trackSequence) { case 3: sub_88ABA4(direction, 32, 224, 0, height); break; //case 5: sub_88ABA4(direction, 0, 224, 1, height); break; case 6: sub_88ABA4(direction, 224, 32, 4, height); break; case 7: sub_88ABA4(direction, 224, 224, 2, height); break; //case 8: sub_88ABA4(rideIndex, 224, 0, 3, height); break; } int cornerSegments = 0; switch (trackSequence) { case 1: // top cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; break; case 3: // right cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; break; case 6: // left cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; break; case 7: // bottom cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; break; } paint_util_set_segment_support_height(cornerSegments, height + 2, 0x20); paint_util_set_segment_support_height(SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); paint_util_set_general_support_height(height + 128, 0x20); }
/** rct2: 0x00811304 */ static void paint_virginia_reel_track_left_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { track_paint_util_left_quarter_turn_3_tiles_paint(2, height, direction, trackSequence, gTrackColours[SCHEME_TRACK], virginia_reel_track_pieces_flat_quarter_turn_3_tiles, get_current_rotation()); track_paint_util_left_quarter_turn_3_tiles_tunnel(height, TUNNEL_6, direction, trackSequence); switch (trackSequence) { case 2: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); break; case 0: case 3: wooden_a_supports_paint_setup(virginia_reel_left_quarter_turn_supports[direction], 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENTS_ALL, direction), 0xFFFF, 0); break; } paint_util_set_general_support_height(height + 32, 0x20); }
static void paint_splash_boats_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element *mapElement) { uint32 imageId = SplashBoats60DegUpTo25DegUpImageId[direction] | gTrackColours[SCHEME_TRACK]; uint32 frontImageId = SplashBoats60DegUpTo25DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; gWoodenSupportsPrependTo = sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 66, height, 0, 27, height); wooden_a_supports_paint_setup((direction & 1), 17 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); } else { paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 72, 0x20); }
/** * rct2: 0x008873D8 */ static void paint_flying_saucers(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { uint8 relativeTrackSequence = track_map_4x4[direction][trackSequence]; sint32 edges = edges_4x4[relativeTrackSequence]; rct_ride * ride = get_ride(rideIndex); rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; wooden_a_supports_paint_setup(direction & 1, 0, height, gTrackColours[SCHEME_MISC], NULL); uint32 imageId = SPR_FLYING_SAUCERS_FLOOR | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 30, 30, 1, height, 1, 1, height, get_current_rotation()); track_paint_util_paint_fences(edges, position, mapElement, ride, gTrackColours[SCHEME_TRACK], height, flying_saucers_fence_sprites, get_current_rotation()); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); }
static void paint_splash_boats_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element *mapElement) { uint32 imageId = SplashBoats25DegDownToFlatImageId[direction] | gTrackColours[SCHEME_TRACK]; uint32 frontImageId = SplashBoats25DegDownToFlatFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 42, height, 0, 27, height); static const uint8 specialSupport[] = { 3, 4, 1, 2 }; wooden_a_supports_paint_setup((direction & 1), specialSupport[direction], height, gTrackColours[SCHEME_SUPPORTS], NULL); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); } else { paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); }
/** rct2: 0x008A54C4 */ static void wooden_wild_mouse_track_25_deg_up_to_flat( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { static constexpr const uint32 imageIds[2][4] = { { SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_SW_NE, SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_NW_SE, SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_NE_SW, SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_SE_NW, }, { SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_CHAIN_SW_NE, SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_CHAIN_NW_SE, SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_CHAIN_NE_SW, SPR_WOODEN_WILD_MOUSE_25_DEG_TO_FLAT_CHAIN_SE_NW, }, }; uint8 isChained = track_element_is_lift_hill(tileElement) ? 1 : 0; uint32 imageId = imageIds[isChained][direction] | session->TrackColours[SCHEME_TRACK]; sub_98197C_rotated(session, direction, imageId, 0, 2, 32, 25, 1, height, 0, 3, height); wooden_a_supports_paint_setup(session, direction & 1, 5 + direction, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0); } else { paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 40, 0x20); }
/** rct2: 0x00811264 */ static void paint_virginia_reel_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { const uint32 * sprites = virginia_reel_track_pieces_flat; if (mapElement->type & 0x80) { sprites = virginia_reel_track_pieces_flat_lift_hill; } uint32 imageId = sprites[direction] | gTrackColours[SCHEME_TRACK]; if (direction & 1) { sub_98197C(imageId, 0, 0, 27, 32, 2, height, 2, 0, height, get_current_rotation()); paint_util_push_tunnel_right(height, TUNNEL_6); } else { sub_98197C(imageId, 0, 0, 32, 27, 2, height, 0, 2, height, get_current_rotation()); paint_util_push_tunnel_left(height, TUNNEL_6); } wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 32, 0x20); }
/** rct2: 0x00770CCC */ static void paint_ghost_train_track_spinning_tunnel(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { uint32 imageId = ghost_train_track_pieces_spinning_tunnel_track[direction] | gTrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(imageId, 0, 0, 28, 20, 3, height, 2, 6, height, get_current_rotation()); } else { sub_98197C(imageId, 0, 0, 20, 28, 3, height, 6, 2, height, get_current_rotation()); } track_paint_util_spinning_tunnel_paint(3, height, direction, get_current_rotation()); if (direction == 0 || direction == 2) { paint_util_push_tunnel_left(height, TUNNEL_0); } else { paint_util_push_tunnel_right(height, TUNNEL_0); } wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 32, 0x20); }
/** rct2: 0x008112D4, 0x008112E4, 0x008112F4 */ static void paint_virginia_reel_station( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { uint32 imageId; if (direction == 0 || direction == 2) { imageId = SPR_STATION_BASE_B_SW_NE | session->TrackColours[SCHEME_MISC]; sub_98197C(session, imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height); imageId = SPR_VIRGINIA_REEL_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; sub_98199C(session, imageId, 0, 0, 32, 20, 2, height, 0, 0, height); paint_util_push_tunnel_left(session, height, TUNNEL_6); } else if (direction == 1 || direction == 3) { imageId = SPR_STATION_BASE_B_NW_SE | session->TrackColours[SCHEME_MISC]; sub_98197C(session, imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height); imageId = SPR_VIRGINIA_REEL_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; sub_98199C(session, imageId, 0, 0, 20, 32, 2, height, 0, 0, height); paint_util_push_tunnel_right(session, height, TUNNEL_6); } wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); track_paint_util_draw_station(session, rideIndex, trackSequence, direction, height, tileElement); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
static void wooden_wild_mouse_track_left_quarter_turn_1( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { static constexpr const uint32 imageIds[4] = { SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_1_SW_NE, SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_1_NW_SE, SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_1_NE_SW, SPR_WOODEN_WILD_MOUSE_QUARTER_TURN_1_SE_NW, }; static uint8 supportType[] = { 5, 2, 3, 4 }; uint32 imageId = imageIds[direction] | session->TrackColours[SCHEME_TRACK]; switch (direction) { case 0: sub_98197C(session, imageId, 6, 0, 26, 24, 1, height, 6, 2, height); break; case 1: sub_98196C(session, imageId, 0, 0, 26, 26, 1, height); break; case 2: sub_98197C(session, imageId, 0, 6, 24, 26, 1, height, 2, 6, height); break; case 3: sub_98196C(session, imageId, 6, 6, 24, 24, 1, height); break; } wooden_a_supports_paint_setup(session, supportType[direction], 0, height, session->TrackColours[SCHEME_SUPPORTS], nullptr); track_paint_util_left_quarter_turn_1_tile_tunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 32, 0x20); }
/** * rct2: 0x0076E9B0 */ static void paint_haunted_house( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); track_paint_util_paint_floor( session, edges, session->TrackColours[SCHEME_TRACK], height, floorSpritesCork, session->CurrentRotation); track_paint_util_paint_fences( session, edges, position, tileElement, ride, session->TrackColours[SCHEME_MISC], height, fenceSpritesRope, session->CurrentRotation); switch (trackSequence) { case 3: paint_haunted_house_structure(session, rideIndex, direction, 32, -32, 0, height + 3); break; case 6: paint_haunted_house_structure(session, rideIndex, direction, -32, 32, 4, height + 3); break; case 7: paint_haunted_house_structure(session, rideIndex, direction, -32, -32, 2, height + 3); break; } sint32 cornerSegments = 0; switch (trackSequence) { case 1: // top cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; break; case 3: // right cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; break; case 6: // left cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; break; case 7: // bottom cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; break; } paint_util_set_segment_support_height(session, cornerSegments, height + 2, 0x20); paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 128, 0x20); }
/** * * rct2: 0x006658ED */ static void park_entrance_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) { if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) return; #ifdef __ENABLE_LIGHTFX__ if (lightfx_is_available()) { lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 0, 0, 155, LIGHTFX_LIGHT_TYPE_LANTERN_3); } #endif session->InteractionType = VIEWPORT_INTERACTION_ITEM_PARK; _unk9E32BC = 0; uint32_t image_id, ghost_id = 0; if (tile_element->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; ghost_id = CONSTRUCTION_MARKER; _unk9E32BC = ghost_id; } // Index to which part of the entrance // Middle, left, right uint8_t part_index = tile_element->AsEntrance()->GetSequenceIndex(); PathSurfaceEntry* path_entry = nullptr; // The left and right of the park entrance often have this set to 127. // So only attempt to get the footpath type if we're dealing with the middle bit of the entrance. if (part_index == 0) path_entry = get_path_surface_entry(tile_element->AsEntrance()->GetPathType()); rct_entrance_type* entrance; uint8_t di = ((direction / 2 + part_index / 2) & 1) ? 0x1A : 0x20; switch (part_index) { case 0: if (path_entry != nullptr) { image_id = (path_entry->image + 5 * (1 + (direction & 1))) | ghost_id; sub_98197C(session, image_id, 0, 0, 32, 0x1C, 0, height, 0, 2, height); } entrance = (rct_entrance_type*)object_entry_get_chunk(OBJECT_TYPE_PARK_ENTRANCE, 0); if (entrance == nullptr) { return; } image_id = (entrance->image_id + direction * 3) | ghost_id; sub_98197C(session, image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, 2, 2, height + 32); if ((direction + 1) & (1 << 1)) break; if (ghost_id != 0) break; { rct_string_id park_text_id = STR_BANNER_TEXT_CLOSED; set_format_arg(0, uint32_t, 0); set_format_arg(4, uint32_t, 0); if (gParkFlags & PARK_FLAGS_PARK_OPEN) { set_format_arg(0, rct_string_id, gParkName); set_format_arg(2, uint32_t, gParkNameArgs); park_text_id = STR_BANNER_TEXT_FORMAT; } utf8 park_name[256]; if (gConfigGeneral.upper_case_banners) { format_string_to_upper(park_name, sizeof(park_name), park_text_id, gCommonFormatArgs); } else { format_string(park_name, sizeof(park_name), park_text_id, gCommonFormatArgs); } gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; uint16_t string_width = gfx_get_string_width(park_name); uint16_t scroll = (gCurrentTicks / 2) % string_width; if (entrance->scrolling_mode == SCROLLING_MODE_NONE) break; int32_t stsetup = scrolling_text_setup(session, park_text_id, scroll, entrance->scrolling_mode + direction / 2); int32_t text_height = height + entrance->text_height; sub_98199C(session, stsetup, 0, 0, 0x1C, 0x1C, 0x2F, text_height, 2, 2, text_height); } break; case 1: case 2: entrance = (rct_entrance_type*)object_entry_get_chunk(OBJECT_TYPE_PARK_ENTRANCE, 0); if (entrance == nullptr) { return; } image_id = (entrance->image_id + part_index + direction * 3) | ghost_id; sub_98197C(session, image_id, 0, 0, 0x1A, di, 0x4F, height, 3, 3, height); break; } image_id = ghost_id; if (image_id == 0) { image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); } wooden_a_supports_paint_setup(session, direction & 1, 0, height, image_id, nullptr); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(session, height + 80, 0x20); }
/** * * rct2: 0x0066508C, 0x00665540 */ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) { uint8_t is_exit = tile_element->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT; if (gTrackDesignSaveMode || (session->ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { if (tile_element->AsEntrance()->GetRideIndex() != gTrackDesignSaveRideIndex) return; } #ifdef __ENABLE_LIGHTFX__ if (lightfx_is_available()) { if (!is_exit) { lightfx_add_3d_light_magic_from_drawing_tile(session->MapPosition, 0, 0, height + 45, LIGHTFX_LIGHT_TYPE_LANTERN_3); } switch (tile_element->GetDirection()) { case 0: lightfx_add_3d_light_magic_from_drawing_tile( session->MapPosition, 16, 0, height + 16, LIGHTFX_LIGHT_TYPE_LANTERN_2); break; case 1: lightfx_add_3d_light_magic_from_drawing_tile( session->MapPosition, 0, -16, height + 16, LIGHTFX_LIGHT_TYPE_LANTERN_2); break; case 2: lightfx_add_3d_light_magic_from_drawing_tile( session->MapPosition, -16, 0, height + 16, LIGHTFX_LIGHT_TYPE_LANTERN_2); break; case 3: lightfx_add_3d_light_magic_from_drawing_tile( session->MapPosition, 0, 16, height + 16, LIGHTFX_LIGHT_TYPE_LANTERN_2); break; }; } #endif Ride* ride = get_ride(tile_element->AsEntrance()->GetRideIndex()); auto stationObj = ride_get_station_object(ride); if (stationObj == nullptr || stationObj->BaseImageId == 0) { return; } uint8_t colour_1, colour_2; uint32_t transparant_image_id = 0, image_id = 0; if (stationObj->Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT) { colour_1 = GlassPaletteIds[ride->track_colour[0].main]; transparant_image_id = (colour_1 << 19) | IMAGE_TYPE_TRANSPARENT; } colour_1 = ride->track_colour[0].main; colour_2 = ride->track_colour[0].additional; image_id = (colour_1 << 19) | (colour_2 << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS; session->InteractionType = VIEWPORT_INTERACTION_ITEM_RIDE; _unk9E32BC = 0; if (tile_element->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; image_id = CONSTRUCTION_MARKER; _unk9E32BC = image_id; if (transparant_image_id) transparant_image_id = image_id; } if (is_exit) { image_id |= stationObj->BaseImageId + direction + 8; } else { image_id |= stationObj->BaseImageId + direction; } // Format modified to stop repeated code // Each entrance is split into 2 images for drawing // Certain entrance styles have another 2 images to draw for coloured windows int8_t ah = is_exit ? 0x23 : 0x33; int16_t lengthY = (direction & 1) ? 28 : 2; int16_t lengthX = (direction & 1) ? 2 : 28; sub_98197C(session, image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height); if (transparant_image_id) { if (is_exit) { transparant_image_id |= stationObj->BaseImageId + direction + 24; } else { transparant_image_id |= stationObj->BaseImageId + direction + 16; } sub_98199C(session, transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height); } image_id += 4; sub_98197C( session, image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height); if (transparant_image_id) { transparant_image_id += 4; sub_98199C( session, transparant_image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height); } if (direction & 1) { paint_util_push_tunnel_right(session, height, TUNNEL_6); } else { paint_util_push_tunnel_left(session, height, TUNNEL_6); } if (!is_exit && !(tile_element->IsGhost()) && tile_element->AsEntrance()->GetRideIndex() != RIDE_ID_NULL && stationObj->ScrollingMode != SCROLLING_MODE_NONE) { set_format_arg(0, uint32_t, 0); set_format_arg(4, uint32_t, 0); rct_string_id string_id = STR_RIDE_ENTRANCE_CLOSED; if (ride->status == RIDE_STATUS_OPEN && !(ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN)) { set_format_arg(0, rct_string_id, ride->name); set_format_arg(2, uint32_t, ride->name_arguments); string_id = STR_RIDE_ENTRANCE_NAME; } utf8 entrance_string[256]; if (gConfigGeneral.upper_case_banners) { format_string_to_upper(entrance_string, sizeof(entrance_string), string_id, gCommonFormatArgs); } else { format_string(entrance_string, sizeof(entrance_string), string_id, gCommonFormatArgs); } gCurrentFontSpriteBase = FONT_SPRITE_BASE_TINY; uint16_t string_width = gfx_get_string_width(entrance_string); uint16_t scroll = (gCurrentTicks / 2) % string_width; sub_98199C( session, scrolling_text_setup(session, string_id, scroll, stationObj->ScrollingMode), 0, 0, 0x1C, 0x1C, 0x33, height + stationObj->Height, 2, 2, height + stationObj->Height); } image_id = _unk9E32BC; if (image_id == 0) { image_id = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_SATURATED_BROWN); } wooden_a_supports_paint_setup(session, direction & 1, 0, height, image_id, nullptr); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); height += is_exit ? 40 : 56; paint_util_set_general_support_height(session, height, 0x20); }
/** rct2: 0x0070DD6C */ static void paint_observation_tower_base( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { trackSequence = track_map_3x3[direction][trackSequence]; sint32 edges = edges_3x3[trackSequence]; Ride * ride = get_ride(rideIndex); LocationXY16 position = session->MapPosition; wooden_a_supports_paint_setup(session, (direction & 1), 0, height, session->TrackColours[SCHEME_MISC], nullptr); uint32 imageId = SPR_FLOOR_METAL_B | session->TrackColours[SCHEME_SUPPORTS]; sub_98197C(session, imageId, 0, 0, 32, 32, 1, height, 0, 0, height); track_paint_util_paint_fences( session, edges, position, tileElement, ride, session->TrackColours[SCHEME_TRACK], height, fenceSpritesMetalB, session->CurrentRotation); if (trackSequence == 0) { imageId = SPR_OBSERVATION_TOWER_SEGMENT_BASE | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 2, 2, 27, height, 8, 8, height + 3); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 2, 2, 30, height + 32, 8, 8, height + 32); imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 2, 2, 30, height + 64, 8, 8, height + 64); paint_util_set_vertical_tunnel(session, height + 96); paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); #ifdef __TESTPAINT__ paint_util_set_general_support_height(session, height + 32, 0x20); #else paint_util_set_general_support_height(session, height + 96, 0x20); #endif return; } sint32 blockedSegments = 0; switch (trackSequence) { case 1: blockedSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 2: blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; break; case 3: blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 4: blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; break; case 5: blockedSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; break; case 6: blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; case 7: blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; break; case 8: blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; break; } paint_util_set_segment_support_height(session, blockedSegments, 0xFFFF, 0); paint_util_set_segment_support_height(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); paint_util_set_general_support_height(session, height + 32, 0x20); }