Draw flat track

This commit is contained in:
Marijn van der Werf 2016-05-24 20:44:59 +02:00
parent 1290d57b04
commit f618a67dc4
3 changed files with 163 additions and 1 deletions

View File

@ -13,3 +13,164 @@
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../track_paint.h"
#include "../track.h"
#include "../vehicle_paint.h"
#include "../../interface/viewport.h"
#include "../../paint/paint.h"
#include "../../paint/supports.h"
#include "../ride_data.h"
#include "../../world/map.h"
enum
{
SPR_GHOST_TRAIN_TRACK_FLAT_SW_NE = 28821,
SPR_GHOST_TRAIN_TRACK_FLAT_NW_SE = 28822,
};
static const uint32 ghost_train_track_pieces_flat[4] = {
SPR_GHOST_TRAIN_TRACK_FLAT_SW_NE,
SPR_GHOST_TRAIN_TRACK_FLAT_NW_SE,
SPR_GHOST_TRAIN_TRACK_FLAT_SW_NE,
SPR_GHOST_TRAIN_TRACK_FLAT_NW_SE,
};
/** rct2: 0x00770BEC */
static void paint_ghost_train_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)};
uint32 imageId = ghost_train_track_pieces_flat[direction] | RCT2_GLOBAL(0x00F44198, uint32);
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(3, 4, 0, height, RCT2_GLOBAL(0x00F4419C, uint32));
}
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);
}
/** rct2: 0x */
static void paint_ghost_train_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_right_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_left_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_left_quarter_turn_1_tile(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_right_quarter_turn_1_tile(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_spinning_tunnel(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/** rct2: 0x */
static void paint_ghost_train_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
}
/**
* rct2: 0x00770924
*/
TRACK_PAINT_FUNCTION get_track_paint_function_ghost_train(int trackType, int direction) {
switch(trackType) {
case TRACK_ELEM_FLAT:
return paint_ghost_train_track_flat;
case TRACK_ELEM_END_STATION:
case TRACK_ELEM_BEGIN_STATION:
case TRACK_ELEM_MIDDLE_STATION:
return paint_ghost_train_station;
case TRACK_ELEM_25_DEG_UP:
return paint_ghost_train_track_25_deg_up;
case TRACK_ELEM_FLAT_TO_25_DEG_UP:
return paint_ghost_train_track_flat_to_25_deg_up;
case TRACK_ELEM_25_DEG_UP_TO_FLAT:
return paint_ghost_train_track_25_deg_up_to_flat;
case TRACK_ELEM_25_DEG_DOWN:
return paint_ghost_train_track_25_deg_down;
case TRACK_ELEM_FLAT_TO_25_DEG_DOWN:
return paint_ghost_train_track_flat_to_25_deg_down;
case TRACK_ELEM_25_DEG_DOWN_TO_FLAT:
return paint_ghost_train_track_25_deg_down_to_flat;
case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES:
return paint_ghost_train_track_left_quarter_turn_3_tiles;
case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES:
return paint_ghost_train_track_right_quarter_turn_3_tiles;
case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE:
return paint_ghost_train_track_left_quarter_turn_1_tile;
case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE:
return paint_ghost_train_track_right_quarter_turn_1_tile;
case TRACK_ELEM_BRAKES:
return paint_ghost_train_track_brakes;
case TRACK_ELEM_SPINNING_TUNNEL:
return paint_ghost_train_track_spinning_tunnel;
}
return NULL;
}

View File

@ -5612,7 +5612,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = {
get_track_paint_function_haunted_house, // RIDE_TYPE_HAUNTED_HOUSE
get_track_paint_function_facility, // RIDE_TYPE_FIRST_AID
get_track_paint_function_circus_show, // RIDE_TYPE_CIRCUS_SHOW
0, // RIDE_TYPE_GHOST_TRAIN
get_track_paint_function_ghost_train, // RIDE_TYPE_GHOST_TRAIN
0, // RIDE_TYPE_TWISTER_ROLLER_COASTER
0, // RIDE_TYPE_WOODEN_ROLLER_COASTER
0, // RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER

View File

@ -230,6 +230,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direct
TRACK_PAINT_FUNCTION get_track_paint_function_twist(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_haunted_house(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_circus_show(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_ghost_train(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction);