From 57207bac34a08726c18f5e774c492f629c15df96 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sat, 19 Dec 2015 12:39:07 +0000 Subject: [PATCH] refactor new track painter, reduce empty jump tables --- src/interface/viewport.c | 9 +- src/ride/track_data.c | 24 +- src/ride/track_data.h | 3 +- src/ride/track_paint.c | 482 +++++---------------------------------- src/ride/track_paint.h | 7 +- 5 files changed, 77 insertions(+), 448 deletions(-) diff --git a/src/interface/viewport.c b/src/interface/viewport.c index 0f6b061bcd..bd42241590 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -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]; if (trackTypeList == NULL) { - trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctions[ride->type]; - - if (trackTypeList[trackType] != NULL) - trackTypeList[trackType][direction](rideIndex, trackSequence, direction, height, mapElement); + TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeTrackPaintFunctions[ride->type]; + TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType, direction); + if (paintFunction != NULL) { + paintFunction(rideIndex, trackSequence, direction, height, mapElement); + } } else { uint32 *trackDirectionList = (uint32*)trackTypeList[trackType]; diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 708b48172f..95d35a213f 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -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_STAND_UP_ROLLER_COASTER 0, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER @@ -5594,27 +5594,27 @@ const uint32 RideTypeTrackPaintFunctions[91] = { 0, // RIDE_TYPE_DODGEMS 0, // RIDE_TYPE_PIRATE_SHIP 0, // RIDE_TYPE_SWINGING_INVERTER_SHIP - (uint32)shop_track_paint_functions, // RIDE_TYPE_FOOD_STALL - (uint32)shop_track_paint_functions, // RIDE_TYPE_1D - (uint32)shop_track_paint_functions, // RIDE_TYPE_DRINK_STALL - (uint32)shop_track_paint_functions, // RIDE_TYPE_1F - (uint32)shop_track_paint_functions, // RIDE_TYPE_SHOP + get_track_paint_function_shop, // RIDE_TYPE_FOOD_STALL + get_track_paint_function_shop, // RIDE_TYPE_1D + get_track_paint_function_shop, // RIDE_TYPE_DRINK_STALL + get_track_paint_function_shop, // RIDE_TYPE_1F + get_track_paint_function_shop, // RIDE_TYPE_SHOP 0, // RIDE_TYPE_MERRY_GO_ROUND - (uint32)shop_track_paint_functions, // RIDE_TYPE_22 - (uint32)shop_track_paint_functions, // RIDE_TYPE_INFORMATION_KIOSK - (uint32)facility_track_paint_functions, // RIDE_TYPE_TOILETS + get_track_paint_function_shop, // RIDE_TYPE_22 + get_track_paint_function_shop, // RIDE_TYPE_INFORMATION_KIOSK + get_track_paint_function_facility, // RIDE_TYPE_TOILETS 0, // RIDE_TYPE_FERRIS_WHEEL 0, // RIDE_TYPE_MOTION_SIMULATOR 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_REVERSE_FREEFALL_COASTER 0, // RIDE_TYPE_LIFT 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_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_GHOST_TRAIN 0, // RIDE_TYPE_TWISTER_ROLLER_COASTER diff --git a/src/ride/track_data.h b/src/ride/track_data.h index 366e642589..11a7ec84b8 100644 --- a/src/ride/track_data.h +++ b/src/ride/track_data.h @@ -20,6 +20,7 @@ #include "../common.h" #include "track.h" +#include "track_paint.h" // 0x009968BB, 0x009968BC, 0x009968BD, 0x009968BF, 0x009968C1, 0x009968C3 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 gFlatRideTrackCurveChain[256]; -extern const uint32 RideTypeTrackPaintFunctions[91]; +extern const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91]; extern const uint32 RideTypeTrackPaintFunctionsOld[91]; diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 35bca3c276..a5b339e18d 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -18,165 +18,24 @@ * along with this program. If not, see . *****************************************************************************/ - #include "../addresses.h" #include "../config.h" #include "../drawing/drawing.h" #include "../localisation/localisation.h" -#include "ride_data.h" -#include "track_data.h" #include "../sprites.h" #include "../world/map.h" #include "../world/sprite.h" #include "../interface/viewport.h" #include "../interface/window.h" +#include "ride_data.h" +#include "track_data.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 */ -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); 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 */ -rct_xy16 loc_7667AE[] = { +static rct_xy16 loc_7667AE[] = { { .x = 0, .y = -1 }, { .x = 1, .y = 0 }, { .x = 0, .y = 1}, @@ -213,7 +72,7 @@ rct_xy16 loc_7667AE[] = { }; /* rct2: 0x007667AC */ -rct_xy16 loc_7667AC[] = { +static rct_xy16 loc_7667AC[] = { { .x = -1, .y = 0 }, { .x = 0, .y = -1 }, { .x = 1, .y = 0 }, @@ -237,7 +96,7 @@ static sint8 TopSpinSeatPositionOffset[] = { * * 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 // is assigned to the drawings. 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 */ -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); 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 */ -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); 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 */ -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); 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 */ -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); 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 */ -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); 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 */ -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); 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 */ -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); 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 */ -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); 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 */ -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) { case 0: @@ -996,7 +855,7 @@ void top_spin_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 dire * * 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) { case 0: @@ -1034,7 +893,7 @@ void top_spin_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 dire * * 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) { case 0: @@ -1072,7 +931,7 @@ void top_spin_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 dire * * 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) { case 0: @@ -1106,273 +965,21 @@ void top_spin_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 dire return; } -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[] = { - shop_paint_setup, - shop_paint_setup, - shop_paint_setup, - shop_paint_setup, -}; - -/* 0x00761160 */ -TRACK_PAINT_FUNCTION* shop_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, - 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 -}; +/* 0x0076659C */ +TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction) +{ + switch (trackType) { + case 123: + switch (direction) { + case 0: return top_spin_paint_setup_rot_0; + case 1: return top_spin_paint_setup_rot_1; + case 2: return top_spin_paint_setup_rot_2; + case 3: return top_spin_paint_setup_rot_3; + } + break; + } + return NULL; +} /** * @@ -1381,7 +988,7 @@ TRACK_PAINT_FUNCTION* facility_track_paint_functions[] = { * rct2: 0x0076163F * 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); @@ -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 @@ -1442,7 +1059,7 @@ void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, int * rct2: 0x00762F50 * 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); @@ -1512,3 +1129,12 @@ void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 direction, 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; +} diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 6b86f5d5d2..30d394cd23 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -4,9 +4,10 @@ #include "../common.h" 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[]; -extern TRACK_PAINT_FUNCTION* shop_track_paint_functions[]; -extern TRACK_PAINT_FUNCTION* facility_track_paint_functions[]; +TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction); #endif \ No newline at end of file