Add constants for flat ride tracks (#4209)

This commit is contained in:
Marijn van der Werf 2016-08-04 00:36:42 +02:00 committed by Michał Janiszewski
parent 70853d65d6
commit 69027a81e4
23 changed files with 56 additions and 24 deletions

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
/**
* rct2: 0x0077084A
@ -102,7 +103,7 @@ static void paint_circus_show(uint8 rideIndex, uint8 trackSequence, uint8 direct
*/
TRACK_PAINT_FUNCTION get_track_paint_function_circus_show(int trackType, int direction)
{
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
typedef struct rct_crooked_house_bound_box {
sint16 offset_x;
@ -121,7 +122,7 @@ static void paint_crooked_house(uint8 rideIndex, uint8 trackSequence, uint8 dire
}
TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int direction) {
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
enum {
SPR_DODGEMS_FLOOR = 21925,
@ -92,7 +93,7 @@ static void paint_dodgems(uint8 rideIndex, uint8 trackSequence, uint8 direction,
* rct2:
*/
TRACK_PAINT_FUNCTION get_track_paint_function_dodgems(int trackType, int direction) {
if (trackType != 111) {
if (trackType != FLAT_TRACK_ELEM_4_X_4) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
static const uint8 edges_1x4_ne_sw[] = {
EDGE_NW | EDGE_SE,
@ -182,7 +183,7 @@ static void paint_ferris_wheel(uint8 rideIndex, uint8 trackSequence, uint8 direc
*/
TRACK_PAINT_FUNCTION get_track_paint_function_ferris_wheel(int trackType, int direction)
{
if (trackType != 122) {
if (trackType != FLAT_TRACK_ELEM_1_X_4_C) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
enum
{
@ -62,7 +63,7 @@ static void paint_flying_saucers(uint8 rideIndex, uint8 trackSequence, uint8 dir
*/
TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction)
{
if (trackType != 111) {
if (trackType != FLAT_TRACK_ELEM_4_X_4) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
typedef struct haunted_house_bound_box
@ -133,7 +134,7 @@ static void paint_haunted_house(uint8 rideIndex, uint8 trackSequence, uint8 dire
*/
TRACK_PAINT_FUNCTION get_track_paint_function_haunted_house(int trackType, int direction)
{
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -22,6 +22,7 @@
#include "../../world/map.h"
#include "../track_paint.h"
#include "../../paint/map_element/surface.h"
#include "../track.h"
enum {
SPR_MAZE_BASE_HEDGE = 21938,
@ -178,7 +179,7 @@ static void maze_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
* rct2: 0x008A81E8
*/
TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction) {
if (trackType != 101) {
if (trackType != TRACK_ELEM_MAZE) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
/** rct2: 0x0142805C */
static const uint32 merry_go_round_rider_offsets[] = {
@ -155,7 +156,7 @@ static void paint_merry_go_round(uint8 rideIndex, uint8 trackSequence, uint8 dir
*/
TRACK_PAINT_FUNCTION get_track_paint_function_merry_go_round(int trackType, int direction)
{
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -19,6 +19,7 @@
#include "../track_paint.h"
#include "../../paint/supports.h"
#include "../../paint/paint.h"
#include "../track.h"
enum
{
@ -142,7 +143,7 @@ static void paint_space_rings(uint8 rideIndex, uint8 trackSequence, uint8 direct
*/
TRACK_PAINT_FUNCTION get_track_paint_function_space_rings(int trackType, int direction)
{
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
enum {
SPIRAL_SLIDE_LEFT_R0 = 20548,
@ -191,7 +192,7 @@ static void paint_spiral_slide(uint8 rideIndex, uint8 trackSequence, uint8 direc
* rct2: 0x0074840C
*/
TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int direction) {
if (trackType != 110) {
if (trackType != FLAT_TRACK_ELEM_2_X_2) {
return NULL;
}

View File

@ -4586,8 +4586,8 @@ static rct_vehicle *vehicle_create_car(
direction = 4;
} else {
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_16)) {
if (RCT2_GLOBAL(0x0097CC68 + (ride->type * 2), uint8) != 119) {
if (RCT2_GLOBAL(0x0097CC68 + (ride->type * 2), uint8) != 95) {
if (RCT2_GLOBAL(0x0097CC68 + (ride->type * 2), uint8) != FLAT_TRACK_ELEM_1_X_4_B) {
if (RCT2_GLOBAL(0x0097CC68 + (ride->type * 2), uint8) != FLAT_TRACK_ELEM_1_X_4_A) {
if (ride->type == RIDE_TYPE_ENTERPRISE) {
direction += 5;
} else {

View File

@ -21,6 +21,7 @@
#include "../../sprites.h"
#include "../../world/map.h"
#include "../track_paint.h"
#include "../track.h"
/**
*
@ -72,7 +73,7 @@ static void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 dir
TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction)
{
switch (trackType) {
case 118: return facility_paint_setup;
case FLAT_TRACK_ELEM_1_X_1_A: return facility_paint_setup;
}
return NULL;
}

View File

@ -21,6 +21,7 @@
#include "../../sprites.h"
#include "../../world/map.h"
#include "../track_paint.h"
#include "../track.h"
/**
*
@ -61,8 +62,8 @@ static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction)
{
switch (trackType) {
case 118:
case 121: return shop_paint_setup;
case FLAT_TRACK_ELEM_1_X_1_A:
case FLAT_TRACK_ELEM_1_X_1_B: return shop_paint_setup;
}
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
/**
* rct2: 0x007664C2
@ -103,7 +104,7 @@ static void paint_3d_cinema(uint8 rideIndex, uint8 trackSequence, uint8 directio
/* 0x0076554C */
TRACK_PAINT_FUNCTION get_track_paint_function_3d_cinema(int trackType, int direction)
{
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -19,6 +19,7 @@
#include "../track_paint.h"
#include "../../paint/supports.h"
#include "../../paint/paint.h"
#include "../track.h"
/** rct2: 0x008A2ABC */
static void paint_enterprise_structure(rct_ride * ride, sint8 xOffset, sint8 yOffset, uint16 height, rct_map_element * mapElement)
@ -123,7 +124,7 @@ static void paint_enterprise(uint8 rideIndex, uint8 trackSequence, uint8 directi
*/
TRACK_PAINT_FUNCTION get_track_paint_function_enterprise(int trackType, int direction)
{
if (trackType != 111) {
if (trackType != FLAT_TRACK_ELEM_4_X_4) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
enum {
PLANE_BACK,
@ -224,7 +225,7 @@ static void paint_magic_carpet(uint8 rideIndex, uint8 trackSequence, uint8 direc
TRACK_PAINT_FUNCTION get_track_paint_function_magic_carpet(int trackType, int direction)
{
switch (trackType) {
case 95: return paint_magic_carpet;
case FLAT_TRACK_ELEM_1_X_4_A: return paint_magic_carpet;
}
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
enum {
SPR_MOTION_SIMULATOR_STAIRS_R0 = 22154,
@ -152,7 +153,7 @@ static void paint_motionsimulator(uint8 rideIndex, uint8 trackSequence, uint8 di
TRACK_PAINT_FUNCTION get_track_paint_function_motionsimulator(int trackType, int direction)
{
switch (trackType) {
case 110: return paint_motionsimulator;
case FLAT_TRACK_ELEM_2_X_2: return paint_motionsimulator;
}
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
// 1 2 0 3 4
static const uint8 track_map_1x5[][5] = {
@ -262,7 +263,7 @@ static void paint_pirate_ship(uint8 rideIndex, uint8 trackSequence, uint8 direct
*/
TRACK_PAINT_FUNCTION get_track_paint_function_pirate_ship(int trackType, int direction)
{
if (trackType != 116) {
if (trackType != FLAT_TRACK_ELEM_1_X_5) {
return NULL;
}

View File

@ -18,6 +18,7 @@
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../track_paint.h"
#include "../track.h"
/** rct2: 0x01428010 */
static const uint32 swinging_inverter_ship_base_sprite_offset[] = {
@ -173,7 +174,7 @@ static void paint_swinging_inverter_ship(uint8 rideIndex, uint8 trackSequence, u
*/
TRACK_PAINT_FUNCTION get_track_paint_function_swinging_inverter_ship(int trackType, int direction)
{
if (trackType != 119) {
if (trackType != FLAT_TRACK_ELEM_1_X_4_B) {
return NULL;
}

View File

@ -305,7 +305,7 @@ static void paint_top_spin(uint8 rideIndex, uint8 trackSequence, uint8 direction
/* 0x0076659C */
TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction)
{
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -19,6 +19,7 @@
#include "../track_paint.h"
#include "../../paint/supports.h"
#include "../../paint/paint.h"
#include "../track.h"
/** rct2: 0x0076E5C9 */
static void paint_twist_structure(rct_ride * ride, uint8 direction, sint8 xOffset, sint8 yOffset, uint16 height)
@ -146,7 +147,7 @@ static void paint_twist(uint8 rideIndex, uint8 trackSequence, uint8 direction, i
*/
TRACK_PAINT_FUNCTION get_track_paint_function_twist(int trackType, int direction)
{
if (trackType != 123) {
if (trackType != FLAT_TRACK_ELEM_3_X_3) {
return NULL;
}

View File

@ -292,6 +292,7 @@ enum {
TRACK_ELEM_BRAKES,
TRACK_ELEM_ROTATION_CONTROL_TOGGLE = 100,
TRACK_ELEM_INVERTED_90_DEG_UP_TO_FLAT_QUARTER_LOOP,
TRACK_ELEM_MAZE = 101,
TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_UP,
TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_UP,
TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_DOWN,
@ -447,6 +448,18 @@ enum {
TRACK_ELEM_MULTIDIM_FLAT_TO_90_DEG_DOWN_QUARTER_LOOP,
};
enum {
FLAT_TRACK_ELEM_1_X_4_A = 95,
FLAT_TRACK_ELEM_2_X_2 = 110,
FLAT_TRACK_ELEM_4_X_4 = 111,
FLAT_TRACK_ELEM_1_X_5 = 116,
FLAT_TRACK_ELEM_1_X_1_A = 118,
FLAT_TRACK_ELEM_1_X_4_B = 119,
FLAT_TRACK_ELEM_1_X_1_B = 121,
FLAT_TRACK_ELEM_1_X_4_C = 122,
FLAT_TRACK_ELEM_3_X_3 = 123,
};
enum {
TRACK_ELEMENT_LOCATION_IS_UNDERGROUND = 2,
};

View File

@ -1599,7 +1599,7 @@ static money32 place_maze_design(uint8 flags, uint8 rideIndex, uint16 mazeEntry,
rct_map_element *mapElement = map_element_insert(fx >> 5, fy >> 5, fz, 15);
mapElement->clearance_height = fz + 4;
mapElement->type = MAP_ELEMENT_TYPE_TRACK;
mapElement->properties.track.type = 101;
mapElement->properties.track.type = TRACK_ELEM_MAZE;
mapElement->properties.track.ride_index = rideIndex;
mapElement->properties.track.maze_entry = mazeEntry;
if (flags & GAME_COMMAND_FLAG_GHOST) {