refactor new track painter, reduce empty jump tables

This commit is contained in:
IntelOrca 2015-12-19 12:39:07 +00:00
parent 4f5f0820d5
commit 57207bac34
5 changed files with 77 additions and 448 deletions

View File

@ -1571,10 +1571,11 @@ void viewport_track_paint_setup(uint8 direction, int height, rct_map_element *ma
TRACK_PAINT_FUNCTION **trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctionsOld[ride->type]; TRACK_PAINT_FUNCTION **trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctionsOld[ride->type];
if (trackTypeList == NULL) { if (trackTypeList == NULL) {
trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctions[ride->type]; TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeTrackPaintFunctions[ride->type];
TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType, direction);
if (trackTypeList[trackType] != NULL) if (paintFunction != NULL) {
trackTypeList[trackType][direction](rideIndex, trackSequence, direction, height, mapElement); paintFunction(rideIndex, trackSequence, direction, height, mapElement);
}
} }
else { else {
uint32 *trackDirectionList = (uint32*)trackTypeList[trackType]; uint32 *trackDirectionList = (uint32*)trackTypeList[trackType];

View File

@ -5565,7 +5565,7 @@ const uint32 RideTypeTrackPaintFunctionsOld[91] = {
}; };
const uint32 RideTypeTrackPaintFunctions[91] = { const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = {
0, // RIDE_TYPE_SPIRAL_ROLLER_COASTER 0, // RIDE_TYPE_SPIRAL_ROLLER_COASTER
0, // RIDE_TYPE_STAND_UP_ROLLER_COASTER 0, // RIDE_TYPE_STAND_UP_ROLLER_COASTER
0, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER 0, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER
@ -5594,27 +5594,27 @@ const uint32 RideTypeTrackPaintFunctions[91] = {
0, // RIDE_TYPE_DODGEMS 0, // RIDE_TYPE_DODGEMS
0, // RIDE_TYPE_PIRATE_SHIP 0, // RIDE_TYPE_PIRATE_SHIP
0, // RIDE_TYPE_SWINGING_INVERTER_SHIP 0, // RIDE_TYPE_SWINGING_INVERTER_SHIP
(uint32)shop_track_paint_functions, // RIDE_TYPE_FOOD_STALL get_track_paint_function_shop, // RIDE_TYPE_FOOD_STALL
(uint32)shop_track_paint_functions, // RIDE_TYPE_1D get_track_paint_function_shop, // RIDE_TYPE_1D
(uint32)shop_track_paint_functions, // RIDE_TYPE_DRINK_STALL get_track_paint_function_shop, // RIDE_TYPE_DRINK_STALL
(uint32)shop_track_paint_functions, // RIDE_TYPE_1F get_track_paint_function_shop, // RIDE_TYPE_1F
(uint32)shop_track_paint_functions, // RIDE_TYPE_SHOP get_track_paint_function_shop, // RIDE_TYPE_SHOP
0, // RIDE_TYPE_MERRY_GO_ROUND 0, // RIDE_TYPE_MERRY_GO_ROUND
(uint32)shop_track_paint_functions, // RIDE_TYPE_22 get_track_paint_function_shop, // RIDE_TYPE_22
(uint32)shop_track_paint_functions, // RIDE_TYPE_INFORMATION_KIOSK get_track_paint_function_shop, // RIDE_TYPE_INFORMATION_KIOSK
(uint32)facility_track_paint_functions, // RIDE_TYPE_TOILETS get_track_paint_function_facility, // RIDE_TYPE_TOILETS
0, // RIDE_TYPE_FERRIS_WHEEL 0, // RIDE_TYPE_FERRIS_WHEEL
0, // RIDE_TYPE_MOTION_SIMULATOR 0, // RIDE_TYPE_MOTION_SIMULATOR
0, // RIDE_TYPE_3D_CINEMA 0, // RIDE_TYPE_3D_CINEMA
(uint32)top_spin_track_paint_functions, // RIDE_TYPE_TOP_SPIN get_track_paint_function_topspin, // RIDE_TYPE_TOP_SPIN
0, // RIDE_TYPE_SPACE_RINGS 0, // RIDE_TYPE_SPACE_RINGS
0, // RIDE_TYPE_REVERSE_FREEFALL_COASTER 0, // RIDE_TYPE_REVERSE_FREEFALL_COASTER
0, // RIDE_TYPE_LIFT 0, // RIDE_TYPE_LIFT
0, // RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER 0, // RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER
(uint32)shop_track_paint_functions, // RIDE_TYPE_CASH_MACHINE get_track_paint_function_shop, // RIDE_TYPE_CASH_MACHINE
0, // RIDE_TYPE_TWIST 0, // RIDE_TYPE_TWIST
0, // RIDE_TYPE_HAUNTED_HOUSE 0, // RIDE_TYPE_HAUNTED_HOUSE
(uint32)facility_track_paint_functions, // RIDE_TYPE_FIRST_AID get_track_paint_function_facility, // RIDE_TYPE_FIRST_AID
0, // RIDE_TYPE_CIRCUS_SHOW 0, // RIDE_TYPE_CIRCUS_SHOW
0, // RIDE_TYPE_GHOST_TRAIN 0, // RIDE_TYPE_GHOST_TRAIN
0, // RIDE_TYPE_TWISTER_ROLLER_COASTER 0, // RIDE_TYPE_TWISTER_ROLLER_COASTER

View File

@ -20,6 +20,7 @@
#include "../common.h" #include "../common.h"
#include "track.h" #include "track.h"
#include "track_paint.h"
// 0x009968BB, 0x009968BC, 0x009968BD, 0x009968BF, 0x009968C1, 0x009968C3 // 0x009968BB, 0x009968BC, 0x009968BD, 0x009968BF, 0x009968C1, 0x009968C3
extern const rct_track_coordinates TrackCoordinates[256]; extern const rct_track_coordinates TrackCoordinates[256];
@ -40,5 +41,5 @@ typedef struct {
extern const track_curve_chain gTrackCurveChain[256]; extern const track_curve_chain gTrackCurveChain[256];
extern const track_curve_chain gFlatRideTrackCurveChain[256]; extern const track_curve_chain gFlatRideTrackCurveChain[256];
extern const uint32 RideTypeTrackPaintFunctions[91]; extern const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91];
extern const uint32 RideTypeTrackPaintFunctionsOld[91]; extern const uint32 RideTypeTrackPaintFunctionsOld[91];

View File

@ -18,165 +18,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "../addresses.h" #include "../addresses.h"
#include "../config.h" #include "../config.h"
#include "../drawing/drawing.h" #include "../drawing/drawing.h"
#include "../localisation/localisation.h" #include "../localisation/localisation.h"
#include "ride_data.h"
#include "track_data.h"
#include "../sprites.h" #include "../sprites.h"
#include "../world/map.h" #include "../world/map.h"
#include "../world/sprite.h" #include "../world/sprite.h"
#include "../interface/viewport.h" #include "../interface/viewport.h"
#include "../interface/window.h" #include "../interface/window.h"
#include "ride_data.h"
#include "track_data.h"
#include "track_paint.h" #include "track_paint.h"
void top_spin_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement);
void top_spin_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement);
void top_spin_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement);
void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement);
/* 0x0076679C */
TRACK_PAINT_FUNCTION top_spin_base_functions[] = {
top_spin_paint_setup_rot_0,
top_spin_paint_setup_rot_1,
top_spin_paint_setup_rot_2,
top_spin_paint_setup_rot_3,
};
TRACK_PAINT_FUNCTION* top_spin_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,
NULL,
NULL,
NULL,
NULL,
NULL,
top_spin_base_functions // 123
};
/** /**
* *
* rct2: 0x0076687C * rct2: 0x0076687C
*/ */
void top_spin_paint_tile_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -205,7 +64,7 @@ void top_spin_paint_tile_0(uint8 rideIndex, uint8 trackSequence, uint8 direction
} }
/* rct2: 0x007667AE */ /* rct2: 0x007667AE */
rct_xy16 loc_7667AE[] = { static rct_xy16 loc_7667AE[] = {
{ .x = 0, .y = -1 }, { .x = 0, .y = -1 },
{ .x = 1, .y = 0 }, { .x = 1, .y = 0 },
{ .x = 0, .y = 1}, { .x = 0, .y = 1},
@ -213,7 +72,7 @@ rct_xy16 loc_7667AE[] = {
}; };
/* rct2: 0x007667AC */ /* rct2: 0x007667AC */
rct_xy16 loc_7667AC[] = { static rct_xy16 loc_7667AC[] = {
{ .x = -1, .y = 0 }, { .x = -1, .y = 0 },
{ .x = 0, .y = -1 }, { .x = 0, .y = -1 },
{ .x = 1, .y = 0 }, { .x = 1, .y = 0 },
@ -237,7 +96,7 @@ static sint8 TopSpinSeatPositionOffset[] = {
* *
* rct2: 0x0076750D * rct2: 0x0076750D
*/ */
void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction, int height, rct_map_element* mapElement) {
// As we will be drawing a vehicle we need to backup the mapElement that // As we will be drawing a vehicle we need to backup the mapElement that
// is assigned to the drawings. // is assigned to the drawings.
rct_map_element* curMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*); rct_map_element* curMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
@ -480,7 +339,7 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction
* *
* rct2: 0x0076693F * rct2: 0x0076693F
*/ */
void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -549,7 +408,7 @@ void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x00767033 * rct2: 0x00767033
*/ */
void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -599,7 +458,7 @@ void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x0076718D * rct2: 0x0076718D
*/ */
void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -649,7 +508,7 @@ void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x00766B4C * rct2: 0x00766B4C
*/ */
void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -718,7 +577,7 @@ void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x007672E7 * rct2: 0x007672E7
*/ */
void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -769,7 +628,7 @@ void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x00766D09 * rct2: 0x00766D09
*/ */
void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -838,7 +697,7 @@ void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x00766EC6 * rct2: 0x00766EC6
*/ */
void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -907,7 +766,7 @@ void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x007673FA * rct2: 0x007673FA
*/ */
void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32);
sub_6629BC(height, 0, image_id, direction & 1); sub_6629BC(height, 0, image_id, direction & 1);
@ -958,7 +817,7 @@ void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 direction
* *
* rct2: 0x007667BC * rct2: 0x007667BC
*/ */
void top_spin_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
switch (trackSequence) switch (trackSequence)
{ {
case 0: case 0:
@ -996,7 +855,7 @@ void top_spin_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 dire
* *
* rct2: 0x007667EC * rct2: 0x007667EC
*/ */
void top_spin_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
switch (trackSequence) switch (trackSequence)
{ {
case 0: case 0:
@ -1034,7 +893,7 @@ void top_spin_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 dire
* *
* rct2: 0x0076681C * rct2: 0x0076681C
*/ */
void top_spin_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
switch (trackSequence) switch (trackSequence)
{ {
case 0: case 0:
@ -1072,7 +931,7 @@ void top_spin_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 dire
* *
* rct2: 0x0076684C * rct2: 0x0076684C
*/ */
void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) { static void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) {
switch (trackSequence) switch (trackSequence)
{ {
case 0: case 0:
@ -1106,273 +965,21 @@ void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 dire
return; return;
} }
void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); /* 0x0076659C */
void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction)
{
/* 0x00761358 */ switch (trackType) {
TRACK_PAINT_FUNCTION shop_base_functions[] = { case 123:
shop_paint_setup, switch (direction) {
shop_paint_setup, case 0: return top_spin_paint_setup_rot_0;
shop_paint_setup, case 1: return top_spin_paint_setup_rot_1;
shop_paint_setup, case 2: return top_spin_paint_setup_rot_2;
}; case 3: return top_spin_paint_setup_rot_3;
}
/* 0x00761160 */ break;
TRACK_PAINT_FUNCTION* shop_track_paint_functions[] = { }
NULL, return 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,
shop_base_functions, // 118
NULL,
NULL,
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
};
/** /**
* *
@ -1381,7 +988,7 @@ TRACK_PAINT_FUNCTION* facility_track_paint_functions[] = {
* rct2: 0x0076163F * rct2: 0x0076163F
* rct2: 0x007617A5 * rct2: 0x007617A5
*/ */
void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) static void shop_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); bool hasSupports = sub_6629BC(height, 0, RCT2_GLOBAL(0x00F441A4, uint32), direction & 1);
@ -1435,6 +1042,16 @@ void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int
} }
} }
/* 0x00761160 */
TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction)
{
switch (trackType) {
case 118:
case 121: return shop_paint_setup;
}
return NULL;
}
/** /**
* *
* rct2: 0x00763234 * rct2: 0x00763234
@ -1442,7 +1059,7 @@ void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int
* rct2: 0x00762F50 * rct2: 0x00762F50
* rct2: 0x007630DE * rct2: 0x007630DE
*/ */
void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement) static 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); bool hasSupports = sub_6629BC(height, 0, RCT2_GLOBAL(0x00F441A4, uint32), direction & 1);
@ -1512,3 +1129,12 @@ void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction,
RCT2_GLOBAL(0x00141E9DA, sint16) = 32; RCT2_GLOBAL(0x00141E9DA, sint16) = 32;
} }
} }
/* 0x00762D44 */
TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction)
{
switch (trackType) {
case 118: return facility_paint_setup;
}
return NULL;
}

View File

@ -4,9 +4,10 @@
#include "../common.h" #include "../common.h"
typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement);
typedef TRACK_PAINT_FUNCTION (*TRACK_PAINT_FUNCTION_GETTER)(int trackType, int direction);
extern TRACK_PAINT_FUNCTION* top_spin_track_paint_functions[]; TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction);
extern TRACK_PAINT_FUNCTION* shop_track_paint_functions[]; TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction);
extern TRACK_PAINT_FUNCTION* facility_track_paint_functions[]; TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction);
#endif #endif