static void submarine_ride_paint_track_flat( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { LocationXY16 position = session->MapPosition; sint32 heightLower = height - 16; uint32 imageId; if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 20, 32, 3, heightLower, 6, 0, heightLower); paint_util_push_tunnel_right(session, heightLower, TUNNEL_0); } else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 32, 20, 3, heightLower, 0, 6, heightLower); paint_util_push_tunnel_left(session, heightLower, TUNNEL_0); } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup(session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, -1, heightLower, session->TrackColours[SCHEME_SUPPORTS]); } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 16, 0x20); }
/** rct2: 0x */ static void paint_mini_helicopters_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 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, 1, height - 2, 0, 2, height, get_current_rotation()); imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | gTrackColours[SCHEME_TRACK]; sub_98199C(imageId, 0, 0, 32, 20, 1, height, 0, 0, height, get_current_rotation()); metal_a_supports_paint_setup(METAL_SUPPORTS_BOXED, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(METAL_SUPPORTS_BOXED, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); 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, 1, height - 2, 2, 0, height, get_current_rotation()); imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | gTrackColours[SCHEME_TRACK]; sub_98199C(imageId, 0, 0, 20, 32, 1, height, 0, 0, height, get_current_rotation()); metal_a_supports_paint_setup(METAL_SUPPORTS_BOXED, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(METAL_SUPPORTS_BOXED, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); paint_util_push_tunnel_right(height, TUNNEL_6); } 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: 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); }
/** rct2: 0x0081F368 */ static void paint_mini_helicopters_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; uint32 imageId; switch (direction) { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SW_NE | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 32, 20, 3, height, 0, 6, height, get_current_rotation()); paint_util_push_tunnel_left(height, TUNNEL_0); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NW_SE | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 20, 32, 3, height, 6, 0, height, get_current_rotation()); paint_util_push_tunnel_right(height, TUNNEL_2); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_NE_SW | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 32, 20, 3, height, 0, 6, height, get_current_rotation()); paint_util_push_tunnel_left(height, TUNNEL_2); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_TO_25_DEG_UP_SE_NW | gTrackColours[SCHEME_TRACK]; sub_98197C(imageId, 0, 0, 20, 32, 3, height, 6, 0, height, get_current_rotation()); paint_util_push_tunnel_right(height, TUNNEL_0); break; } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup(METAL_SUPPORTS_STICK, 4, -4, height, gTrackColours[SCHEME_SUPPORTS]); } paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 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: 0x00770CDC */ static void paint_ghost_train_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; uint32 imageId = ghost_train_track_pieces_brakes[direction] | gTrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(imageId, 0, 0, 32, 20, 3, height, 0, 6, height, get_current_rotation()); } else { sub_98197C(imageId, 0, 0, 20, 32, 3, height, 6, 0, height, 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); } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup(METAL_SUPPORTS_BOXED, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); } paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); paint_util_set_general_support_height(height + 32, 0x20); }
static void paint_ghost_train_track_25_deg_up_to_flat_shared(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; uint32 imageId = ghost_train_track_pieces_25_deg_up_to_flat[direction][0] | gTrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(imageId, 0, 0, 32, 20, 3, height, 0, 6, height, get_current_rotation()); } else { sub_98197C(imageId, 0, 0, 20, 32, 3, height, 6, 0, height, get_current_rotation()); } imageId = ghost_train_track_pieces_25_deg_up_to_flat[direction][1] | gTrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(imageId, 0, 0, 32, 1, 15, height, 0, 27, height, get_current_rotation()); } else { sub_98197C(imageId, 0, 0, 1, 32, 15, height, 27, 0, height, get_current_rotation()); } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup(METAL_SUPPORTS_BOXED, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); } paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); paint_util_set_general_support_height(height + 40, 0x20); }
/** rct2: 0x0081F348 */ static void paint_mini_helicopters_track_flat( paint_session* session, ride_id_t rideIndex, uint8_t trackSequence, uint8_t direction, int32_t height, const TileElement* tileElement) { LocationXY16 position = session->MapPosition; uint32_t imageId; if (direction & 1) { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); paint_util_push_tunnel_right(session, height, TUNNEL_0); } else { imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); paint_util_push_tunnel_left(session, height, TUNNEL_0); } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup( session, (direction & 1) ? METAL_SUPPORTS_STICK_ALT : METAL_SUPPORTS_STICK, 4, -1, height, session->TrackColours[SCHEME_SUPPORTS]); } paint_util_set_segment_support_height( session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 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: 0x00770C5C, 0x00770C6C, 0x00770C7C */ static void paint_ghost_train_station( paint_session * session, uint8 rideIndex, [[maybe_unused]] 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, 3, height - 2, 0, 2, height); } 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, 3, height - 2, 2, 0, height); } imageId = ghost_train_track_pieces_flat[direction] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98199C(session, imageId, 0, 0, 32, 20, 3, height, 0, 0, height); } else { sub_98199C(session, imageId, 0, 0, 20, 32, 3, height, 0, 0, height); } if (direction == 0 || direction == 2) { paint_util_push_tunnel_left(session, height, TUNNEL_6); } else { paint_util_push_tunnel_right(session, height, TUNNEL_6); } if (direction == 0 || direction == 2) { metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 5, 0, height, session->TrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 8, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } else { metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 6, 0, height, session->TrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 7, 0, height, session->TrackColours[SCHEME_SUPPORTS]); } track_paint_util_draw_station(session, rideIndex, 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 paint_lift_cage(sint8 index, uint32 colourFlags, sint32 height, uint8 rotation) { uint32 imageId; imageId = lift_cage_sprites[1 + index][0] | colourFlags; sub_98197C(imageId, 0, 0, 2, 2, 30, height, 2, 2, height, get_current_rotation()); imageId = lift_cage_sprites[1 + index][1] | colourFlags; sub_98197C(imageId, 0, 0, 2, 2, 30, height, 28, 28, height, get_current_rotation()); }
static void paint_swinging_inverter_ship_structure(rct_ride * ride, uint8 direction, sint8 axisOffset, uint16 height) { rct_map_element * savedMapElement = g_currently_drawn_item; rct_ride_entry * rideType = get_ride_entry(ride->subtype); rct_vehicle * vehicle = NULL; sint8 xOffset = !(direction & 1) ? axisOffset : 0; sint8 yOffset = (direction & 1) ? axisOffset : 0; if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && ride->vehicles[0] != SPRITE_INDEX_NULL) { vehicle = GET_VEHICLE(ride->vehicles[0]); gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE; g_currently_drawn_item = vehicle; } uint32 vehicleImageId = rideType->vehicles[0].base_image_id + swinging_inverter_ship_base_sprite_offset[direction]; if (vehicle != NULL) { sint32 rotation = (sint8) vehicle->vehicle_sprite_type; if (rotation != 0) { vehicleImageId = rideType->vehicles[0].base_image_id + swinging_inverter_ship_animating_base_sprite_offset[direction]; if (direction & 2) { rotation = -rotation; } if (rotation < 0) { rotation += 72; } vehicleImageId += (rotation - 1) << 1; } } uint32 colourFlags = gTrackColours[SCHEME_MISC]; if (colourFlags == 0x20000000) { colourFlags = ride->vehicle_colours[0].body_colour << 19 | ride->vehicle_colours[0].trim_colour << 24 | 0xA0000000; } swinging_inverter_ship_bound_box boundBox = swinging_inverter_ship_bounds[direction]; vehicleImageId = vehicleImageId | colourFlags; uint32 frameImageId = swinging_inverter_ship_frame_sprites[direction] | gTrackColours[SCHEME_TRACK]; if (direction & 2) { sub_98197C(vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation()); sub_98199C(frameImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation()); } else { sub_98197C(frameImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation()); sub_98199C(vehicleImageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height, get_current_rotation()); } g_currently_drawn_item = savedMapElement; gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_RIDE; }
/** rct2: 0x00770C0C */ static void paint_ghost_train_track_flat_to_25_deg_up( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { LocationXY16 position = session->MapPosition; uint32 imageId = ghost_train_track_pieces_flat_to_25_deg_up[direction][0] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); } else { sub_98197C(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); } imageId = ghost_train_track_pieces_flat_to_25_deg_up[direction][1] | session->TrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(session, imageId, 0, 0, 32, 1, 15, height, 0, 27, height); } else { sub_98197C(session, imageId, 0, 0, 1, 32, 15, height, 27, 0, height); } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup(session, METAL_SUPPORTS_BOXED, 4, 3, height, session->TrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 0: paint_util_push_tunnel_left(session, height, TUNNEL_0); break; case 1: paint_util_push_tunnel_right(session, height, TUNNEL_2); break; case 2: paint_util_push_tunnel_left(session, height, TUNNEL_2); break; case 3: paint_util_push_tunnel_right(session, height, TUNNEL_0); break; } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 48, 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: 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: 0x006D44D5 */ void vehicle_visual_submarine(paint_session * session, sint32 x, sint32 imageDirection, sint32 y, sint32 z, rct_vehicle * vehicle, const rct_ride_entry_vehicle * vehicleEntry) { sint32 baseImage_id = imageDirection; sint32 image_id; if (vehicle->restraints_position >= 64) { if ((vehicleEntry->sprite_flags & VEHICLE_SPRITE_FLAG_RESTRAINT_ANIMATION) && !(imageDirection & 3)) { baseImage_id /= 8; baseImage_id += ((vehicle->restraints_position - 64) / 64) * 4; baseImage_id *= vehicleEntry->base_num_frames; baseImage_id += vehicleEntry->restraint_image_id; } } else { if (vehicleEntry->flags & VEHICLE_ENTRY_FLAG_11) { baseImage_id /= 2; } if (vehicleEntry->sprite_flags & VEHICLE_SPRITE_FLAG_15) { baseImage_id /= 8; } baseImage_id *= vehicleEntry->base_num_frames; baseImage_id += vehicleEntry->base_image_id; baseImage_id += vehicle->swing_sprite; } vehicle_boundbox bb = VehicleBoundboxes[vehicleEntry->draw_order][imageDirection / 2]; image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | IMAGE_TYPE_REMAP_2_PLUS; paint_struct * ps = sub_98197C( session, image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; } image_id = (baseImage_id + 1) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | IMAGE_TYPE_REMAP_2_PLUS; ps = sub_98197C(session, image_id, 0, 0, bb.length_x, bb.length_y, 2, z, bb.offset_x, bb.offset_y, bb.offset_z + z - 10); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; } assert(vehicleEntry->effect_visual == 1); }
/** 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 paint_struct * paint_monorail_cycles_util_7c( bool flip, uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation ) { if (flip) { return sub_98197C(image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, bound_box_offset_y, bound_box_offset_x, bound_box_offset_z, rotation); } return sub_98197C(image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, bound_box_offset_x, bound_box_offset_y, bound_box_offset_z, rotation); }
/** rct2: 0x0070DD7C */ static void paint_observation_tower_section( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { if (trackSequence == 1) { return; } uint32 imageId = SPR_OBSERVATION_TOWER_SEGMENT | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); const rct_tile_element * nextTileElement = tileElement + 1; if (tileElement->IsLastForTile() || tileElement->clearance_height != nextTileElement->base_height) { imageId = SPR_OBSERVATION_TOWER_SEGMENT_TOP | session->TrackColours[SCHEME_TRACK]; sub_98199C(session, imageId, 0, 0, 2, 2, 30, height, 8, 8, height); } paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_vertical_tunnel(session, height + 32); paint_util_set_general_support_height(session, height + 32, 0x20); }
/** * rct2: 0x0088ABA4 * @param (edi) direction * @param (al) al * @param (cl) cl * @param (ebx) image_id * @param (edx) height */ static void paint_crooked_house_structure(paint_session * session, uint8 direction, uint8 x_offset, uint8 y_offset, uint32 segment, sint32 height) { const rct_tile_element * original_tile_element = static_cast<const rct_tile_element *>(session->CurrentlyDrawnItem); Ride * ride = get_ride(track_element_get_ride_index(original_tile_element)); rct_ride_entry * rideEntry = get_ride_entry(ride->subtype); if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) { if (ride->vehicles[0] != SPRITE_INDEX_NULL) { rct_sprite * sprite = get_sprite(ride->vehicles[0]); session->InteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE; session->CurrentlyDrawnItem = sprite; } } uint32 image_id = (direction + rideEntry->vehicles[0].base_image_id) | session->TrackColours[SCHEME_MISC]; rct_crooked_house_bound_box boundBox = crooked_house_data[segment]; sub_98197C( session, image_id, x_offset, y_offset, boundBox.length_x, boundBox.length_y, 127, height + 3, boundBox.offset_x, boundBox.offset_y, height + 3); }
/** * * rct2: 0x00664FD4 */ void entrance_paint(paint_session* session, uint8_t direction, int32_t height, const TileElement* tile_element) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_LABEL; rct_drawpixelinfo* dpi = session->DPI; if (session->ViewFlags & VIEWPORT_FLAG_PATH_HEIGHTS && dpi->zoom_level == 0) { if (entrance_get_directions(tile_element) & 0xF) { int32_t z = tile_element->base_height * 8 + 3; uint32_t image_id = 0x20101689 + get_height_marker_offset() + (z / 16); image_id -= gMapBaseZ; sub_98197C(session, image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64); } } switch (tile_element->AsEntrance()->GetEntranceType()) { case ENTRANCE_TYPE_RIDE_ENTRANCE: case ENTRANCE_TYPE_RIDE_EXIT: ride_entrance_exit_paint(session, direction, height, tile_element); break; case ENTRANCE_TYPE_PARK_ENTRANCE: park_entrance_paint(session, direction, height, tile_element); break; } }
/** * * rct2: 0x006D5DA9 */ void vehicle_visual_roto_drop(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) { int image_id; int baseImage_id = (vehicleEntry->base_image_id + 4) + ((vehicle->var_C5 / 4) & 0x3); if (vehicle->restraints_position >= 64) { baseImage_id += 7; baseImage_id += (vehicle->restraints_position / 64); } const uint8 rotation = get_current_rotation(); // Draw back: image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, rotation); // Draw front: image_id = (baseImage_id + 4) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, rotation); uint8 riding_peep_sprites[64]; memset(riding_peep_sprites, 0xFF, sizeof(riding_peep_sprites)); for (int i = 0; i < vehicle->num_peeps; i++) { uint8 cl = (i & 3) * 16; cl += (i & 0xFC); cl += vehicle->var_C5 / 4; cl += (imageDirection / 8) * 16; cl &= 0x3F; riding_peep_sprites[cl] = vehicle->peep_tshirt_colours[i]; } // Draw riding peep sprites in back to front order: for (int j = 0; j <= 48; j++) { int i = (j % 2) ? (48 - (j / 2)) : (j / 2); if (riding_peep_sprites[i] != 0xFF) { baseImage_id = vehicleEntry->base_image_id + 20 + i; if (vehicle->restraints_position >= 64) { baseImage_id += 64; baseImage_id += vehicle->restraints_position / 64; } image_id = baseImage_id | (riding_peep_sprites[i] << 19) | 0x20000000; sub_98199C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, rotation); } }; assert(vehicleEntry->effect_visual == 1); // Although called in original code, effect_visual (splash effects) are not used for many rides and does not make sense so it was taken out }
/** rct2: 0x0081F378 */ static void paint_mini_helicopters_track_25_deg_up_to_flat( paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, const rct_tile_element * tileElement) { LocationXY16 position = session->MapPosition; uint32 imageId; switch (direction) { case 0: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SW_NE | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); paint_util_push_tunnel_left(session, height - 8, TUNNEL_0); break; case 1: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NW_SE | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); paint_util_push_tunnel_right(session, height + 8, TUNNEL_12); break; case 2: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_NE_SW | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 32, 20, 3, height, 0, 6, height); paint_util_push_tunnel_left(session, height + 8, TUNNEL_12); break; case 3: imageId = SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_25_DEG_UP_TO_FLAT_SE_NW | session->TrackColours[SCHEME_TRACK]; sub_98197C(session, imageId, 0, 0, 20, 32, 3, height, 6, 0, height); paint_util_push_tunnel_right(session, height - 8, TUNNEL_0); break; } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup(session, METAL_SUPPORTS_STICK, 4, -7, height, session->TrackColours[SCHEME_SUPPORTS]); } paint_util_set_segment_support_height(session, paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); paint_util_set_general_support_height(session, height + 40, 0x20); }
/** * * rct2: 0x006D6258 */ void vehicle_visual_observation_tower(paint_session * session, sint32 x, sint32 imageDirection, sint32 y, sint32 z, const rct_vehicle * vehicle, const rct_ride_entry_vehicle * vehicleEntry) { sint32 image_id; sint32 baseImage_id = (vehicle->restraints_position / 64); if (vehicle->restraints_position >= 64) { if ((imageDirection / 8) && (imageDirection / 8) != 3) { baseImage_id *= 2; baseImage_id += vehicleEntry->base_image_id + 28; if ((imageDirection / 8) != 1) { baseImage_id -= 6; } } else { baseImage_id = vehicleEntry->base_image_id + 8; } } else { baseImage_id = (vehicle->animation_frame * 2) + vehicleEntry->base_image_id + 8; } image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | IMAGE_TYPE_REMAP_2_PLUS; paint_struct * ps = sub_98197C(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; } image_id++; ps = sub_98197C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1); if (ps != nullptr) { ps->tertiary_colour = vehicle->colours_extended; } assert(vehicleEntry->effect_visual == 1); }
/** 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); }
/** rct2: 0x00770BFC */ static void paint_ghost_train_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_map_element * mapElement) { rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; uint32 imageId = ghost_train_track_pieces_25_deg_up[direction][0] | gTrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(imageId, 0, 0, 32, 20, 3, height, 0, 6, height, get_current_rotation()); } else { sub_98197C(imageId, 0, 0, 20, 32, 3, height, 6, 0, height, get_current_rotation()); } imageId = ghost_train_track_pieces_25_deg_up[direction][1] | gTrackColours[SCHEME_TRACK]; if (direction == 0 || direction == 2) { sub_98197C(imageId, 0, 0, 32, 1, 23, height, 0, 27, height, get_current_rotation()); } else { sub_98197C(imageId, 0, 0, 1, 32, 23, height, 27, 0, height, get_current_rotation()); } if (track_paint_util_should_paint_supports(position)) { metal_a_supports_paint_setup(METAL_SUPPORTS_BOXED, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); } switch (direction) { case 0: paint_util_push_tunnel_left(height - 8, TUNNEL_1); break; case 1: paint_util_push_tunnel_right(height + 8, TUNNEL_2); break; case 2: paint_util_push_tunnel_left(height + 8, TUNNEL_2); break; case 3: paint_util_push_tunnel_right(height - 8, TUNNEL_1); break; } paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); paint_util_set_general_support_height(height + 56, 0x20); }
/** * rct2: 0x0076F72C */ static void paint_haunted_house_structure(paint_session * session, uint8 rideIndex, uint8 direction, sint8 xOffset, sint8 yOffset, uint8 part, uint16 height) { const rct_tile_element * savedTileElement = static_cast<const rct_tile_element *>(session->CurrentlyDrawnItem); uint8 frameNum = 0; Ride * ride = get_ride(rideIndex); rct_ride_entry * rideEntry = get_ride_entry(ride->subtype); uint32 baseImageId = rideEntry->vehicles[0].base_image_id; if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK && ride->vehicles[0] != SPRITE_INDEX_NULL) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_SPRITE; rct_vehicle * vehicle = GET_VEHICLE(ride->vehicles[0]); session->CurrentlyDrawnItem = vehicle; frameNum = vehicle->vehicle_sprite_type; } uint32 imageId = (baseImageId + direction) | session->TrackColours[SCHEME_MISC]; haunted_house_bound_box boundBox = haunted_house_data[part]; sub_98197C( session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height); rct_drawpixelinfo * dpi = session->Unk140E9A8; if (dpi->zoom_level == 0 && frameNum != 0) { switch (direction) { case 0: imageId = baseImageId + 3 + frameNum; break; case 1: imageId = baseImageId + 21 + frameNum; break; case 2: imageId = baseImageId + 39 + frameNum; break; case 3: imageId = baseImageId + 57 + frameNum; break; } imageId = imageId | session->TrackColours[SCHEME_MISC]; sub_98199C( session, imageId, xOffset, yOffset, boundBox.length_x, boundBox.length_y, 127, height, boundBox.offset_x, boundBox.offset_y, height); } session->CurrentlyDrawnItem = savedTileElement; session->InteractionType = VIEWPORT_INTERACTION_ITEM_RIDE; }
/** * * rct2: 0x006D5B48 */ void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry) { int image_id; int baseImage_id = imageDirection; const uint8 rotation = get_current_rotation(); int ecx = ((vehicle->var_BA / 8) + (rotation * 8)) & 31; int j = 0; if (vehicle->vehicle_sprite_type == 0) { baseImage_id = ecx & 7; } else { if (vehicle->vehicle_sprite_type == 1 || vehicle->vehicle_sprite_type == 5) { if (vehicle->vehicle_sprite_type == 5){ baseImage_id = imageDirection ^ 16; } baseImage_id &= 24; j = (baseImage_id / 8) + 1; baseImage_id += (ecx & 7); baseImage_id += 8; } else if (vehicle->vehicle_sprite_type == 2 || vehicle->vehicle_sprite_type == 6) { if (vehicle->vehicle_sprite_type == 6){ baseImage_id = imageDirection ^ 16; } baseImage_id &= 24; j = (baseImage_id / 8) + 5; baseImage_id += (ecx & 7); baseImage_id += 40; } else { baseImage_id = ecx & 7; } } baseImage_id += vehicleEntry->base_image_id; const vehicle_boundbox *bb = &_virginiaReelBoundbox[j]; image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0xA0000000; sub_98197C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, rotation); if (unk_140E9A8->zoom_level < 2 && vehicle->num_peeps > 0) { uint8 riding_peep_sprites[4] = {0xFF, 0xFF, 0xFF, 0xFF}; for (int i = 0; i < vehicle->num_peeps; i++) { riding_peep_sprites[((ecx / 8) + i) & 3] = vehicle->peep_tshirt_colours[i]; } int draw_order[4] = {0, 1, 3, 2}; for (int i = 0; i < countof(draw_order); i++) { if (riding_peep_sprites[draw_order[i]] != 0xFF) { image_id = (baseImage_id + ((draw_order[i] + 1) * 72)) | (riding_peep_sprites[draw_order[i]] << 19) | 0x20000000; sub_98199C(image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z, rotation); } } } assert(vehicleEntry->effect_visual == 1); }
/** 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); }