diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 17efa05e0a..708b48172f 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -5507,7 +5507,7 @@ const uint32 RideTypeTrackPaintFunctionsOld[91] = { 0x0076190C, // RIDE_TYPE_MERRY_GO_ROUND 0, // RIDE_TYPE_22 0, // RIDE_TYPE_INFORMATION_KIOSK - 0x00762D44, // RIDE_TYPE_TOILETS + 0, // RIDE_TYPE_TOILETS 0x008A8CC8, // RIDE_TYPE_FERRIS_WHEEL 0x00763520, // RIDE_TYPE_MOTION_SIMULATOR 0x0076554C, // RIDE_TYPE_3D_CINEMA @@ -5519,7 +5519,7 @@ const uint32 RideTypeTrackPaintFunctionsOld[91] = { 0, // RIDE_TYPE_CASH_MACHINE 0x0076D658, // RIDE_TYPE_TWIST 0x0076E7B0, // RIDE_TYPE_HAUNTED_HOUSE - 0x00762D44, // RIDE_TYPE_FIRST_AID + 0, // RIDE_TYPE_FIRST_AID 0x0076F8D4, // RIDE_TYPE_CIRCUS_SHOW 0x00770924, // RIDE_TYPE_GHOST_TRAIN 0x008AB2A0, // RIDE_TYPE_TWISTER_ROLLER_COASTER @@ -5602,7 +5602,7 @@ const uint32 RideTypeTrackPaintFunctions[91] = { 0, // RIDE_TYPE_MERRY_GO_ROUND (uint32)shop_track_paint_functions, // RIDE_TYPE_22 (uint32)shop_track_paint_functions, // RIDE_TYPE_INFORMATION_KIOSK - (uint32)shop_track_paint_functions, // RIDE_TYPE_TOILETS + (uint32)facility_track_paint_functions, // RIDE_TYPE_TOILETS 0, // RIDE_TYPE_FERRIS_WHEEL 0, // RIDE_TYPE_MOTION_SIMULATOR 0, // RIDE_TYPE_3D_CINEMA @@ -5614,7 +5614,7 @@ const uint32 RideTypeTrackPaintFunctions[91] = { (uint32)shop_track_paint_functions, // RIDE_TYPE_CASH_MACHINE 0, // RIDE_TYPE_TWIST 0, // RIDE_TYPE_HAUNTED_HOUSE - 0, // RIDE_TYPE_FIRST_AID + (uint32)facility_track_paint_functions, // RIDE_TYPE_FIRST_AID 0, // RIDE_TYPE_CIRCUS_SHOW 0, // RIDE_TYPE_GHOST_TRAIN 0, // RIDE_TYPE_TWISTER_ROLLER_COASTER diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index e075a16f93..35bca3c276 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -1107,6 +1107,7 @@ void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 dire } void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); +void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); /* 0x00761358 */ TRACK_PAINT_FUNCTION shop_base_functions[] = { @@ -1242,6 +1243,137 @@ TRACK_PAINT_FUNCTION* shop_track_paint_functions[] = { shop_base_functions // 121 }; +/* 0x00762F30 */ +TRACK_PAINT_FUNCTION facility_base_functions[] = { + facility_paint_setup, + facility_paint_setup, + facility_paint_setup, + facility_paint_setup, +}; + +/* 0x00762D44 */ +TRACK_PAINT_FUNCTION* facility_track_paint_functions[] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + facility_base_functions, // 118 +}; + /** * * rct2: 0x00761378 @@ -1302,3 +1434,81 @@ void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int RCT2_GLOBAL(0x00141E9DA, sint16) = 32; } } + +/** + * + * rct2: 0x00763234 + * rct2: 0x0076338C + * rct2: 0x00762F50 + * rct2: 0x007630DE + */ +void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) +{ + bool hasSupports = sub_6629BC(height, 0, RCT2_GLOBAL(0x00F441A4, uint32), direction & 1); + + RCT2_GLOBAL(0x0141E9D0, sint16) = -1; + RCT2_GLOBAL(0x0141E9C4, sint16) = -1; + RCT2_GLOBAL(0x0141E9CC, sint16) = -1; + RCT2_GLOBAL(0x0141E9B8, sint16) = -1; + RCT2_GLOBAL(0x0141E9BC, sint16) = -1; + RCT2_GLOBAL(0x0141E9B4, sint16) = -1; + RCT2_GLOBAL(0x0141E9C0, sint16) = -1; + RCT2_GLOBAL(0x0141E9C8, sint16) = -1; + RCT2_GLOBAL(0x0141E9D4, sint16) = -1; + + rct_ride *ride = GET_RIDE(rideIndex); + rct_ride_type *rideEntry = GET_RIDE_ENTRY(ride->subtype); + rct_ride_type_vehicle *firstVehicleEntry = &rideEntry->vehicles[0]; + + uint32 imageId = RCT2_GLOBAL(0x00F44198, uint32); + imageId |= firstVehicleEntry->base_image_id; + imageId += (direction + 2) & 3; + + sint16 height16 = (sint16)height; + int rotation = get_current_rotation(); + int lengthX = (direction & 1) == 0 ? 28 : 2; + int lengthY = (direction & 1) == 0 ? 2 : 28; + if (hasSupports) { + uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32); + foundationImageId |= 3395; + + RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2; + RCT2_GLOBAL(0x009DEA54, uint16) = direction == 0 ? 28 : 2; + RCT2_GLOBAL(0x009DEA56, sint16) = height16; + sub_98197C(0, 29, foundationImageId, 0, height, lengthY, lengthX, rotation); + + // Door image or base + RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2; + RCT2_GLOBAL(0x009DEA54, uint16) = direction == 0 ? 28 : 2; + RCT2_GLOBAL(0x009DEA56, sint16) = height16; + sub_98199C(0, 29, imageId, 0, height, lengthY, lengthX, rotation); + } else { + // Door image or base + RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2; + RCT2_GLOBAL(0x009DEA54, uint16) = direction == 0 ? 28 : 2; + RCT2_GLOBAL(0x009DEA56, sint16) = height16; + + sub_98197C(0, 29, imageId, 0, height, lengthY, lengthX, rotation); + } + + // Base image if door was drawn + if (direction == 1) { + imageId += 2; + RCT2_GLOBAL(0x009DEA52, uint16) = 28; + RCT2_GLOBAL(0x009DEA54, uint16) = 2; + RCT2_GLOBAL(0x009DEA56, sint16) = height16; + sub_98197C(0, 29, imageId, 0, height, 28, 2, rotation); + } else if (direction == 2) { + imageId += 4; + RCT2_GLOBAL(0x009DEA52, uint16) = 2; + RCT2_GLOBAL(0x009DEA54, uint16) = 28; + RCT2_GLOBAL(0x009DEA56, sint16) = height16; + sub_98197C(0, 29, imageId, 0, height, 2, 28, rotation); + } + + height16 += 32; + if (RCT2_GLOBAL(0x00141E9D8, sint16) < height16) { + RCT2_GLOBAL(0x00141E9D8, sint16) = height16; + RCT2_GLOBAL(0x00141E9DA, sint16) = 32; + } +} diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index cea5f99250..6b86f5d5d2 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -7,5 +7,6 @@ typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 extern TRACK_PAINT_FUNCTION* top_spin_track_paint_functions[]; extern TRACK_PAINT_FUNCTION* shop_track_paint_functions[]; +extern TRACK_PAINT_FUNCTION* facility_track_paint_functions[]; #endif \ No newline at end of file