Draw 25 deg up to flat

This commit is contained in:
Marijn van der Werf 2016-05-24 21:07:35 +02:00
parent 75493a5433
commit 9fdb73452d

View file

@ -31,7 +31,10 @@ enum
SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_NW_SE = 28824,
SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_NE_SW = 28825,
SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_SE_NW = 28826,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_SW_NE = 28827,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_NW_SE = 28828,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_NE_SW = 28829,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_SE_NW = 28830,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_SW_NE = 28831,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_NW_SE = 28832,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_NE_SW = 28833,
@ -40,7 +43,10 @@ enum
SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_FRONT_NW_SE = 28836,
SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_FRONT_NE_SW = 28837,
SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_FRONT_SE_NW = 28838,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_SW_NE = 28839,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_NW_SE = 28840,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_NE_SW = 28841,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_SE_NW = 28842,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_FRONT_SW_NE = 28843,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_FRONT_NW_SE = 28844,
SPR_GHOST_TRAIN_TRACK_25_DEG_UP_FRONT_NE_SW = 28845,
@ -64,6 +70,13 @@ static const uint32 ghost_train_track_pieces_flat_to_25_deg_up[4][2] = {
{SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_SE_NW, SPR_GHOST_TRAIN_TRACK_FLAT_TO_25_DEG_UP_FRONT_SE_NW},
};
static const uint32 ghost_train_track_pieces_25_deg_up_to_flat[4][2] = {
{SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_SW_NE, SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_SW_NE},
{SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_NW_SE, SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_NW_SE},
{SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_NE_SW, SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_NE_SW},
{SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_SE_NW, SPR_GHOST_TRAIN_TRACK_25_DEG_UP_TO_FLAT_FRONT_SE_NW},
};
static const uint32 ghost_train_track_pieces_25_deg_up[4][2] = {
{SPR_GHOST_TRAIN_TRACK_25_DEG_UP_SW_NE, SPR_GHOST_TRAIN_TRACK_25_DEG_UP_FRONT_SW_NE},
{SPR_GHOST_TRAIN_TRACK_25_DEG_UP_NW_SE, SPR_GHOST_TRAIN_TRACK_25_DEG_UP_FRONT_NW_SE},
@ -190,9 +203,46 @@ static void paint_ghost_train_track_flat_to_25_deg_up(uint8 rideIndex, uint8 tra
paint_util_set_general_support_height(height + 48, 0x20);
}
/** rct2: 0x */
/** rct2: 0x00770C1C */
static void paint_ghost_train_track_25_deg_up_to_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_25_deg_up_to_flat[direction][0] | 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());
}
imageId = ghost_train_track_pieces_25_deg_up_to_flat[direction][1] | RCT2_GLOBAL(0x00F44198, uint32);
if (direction == 0 || direction == 2) {
sub_98197C(imageId, 0, 0, 32, 1, 15, height, 0, 27, height, get_current_rotation());
} else {
sub_98197C(imageId, 0, 0, 1, 32, 15, height, 27, 0, height, get_current_rotation());
}
if (track_paint_util_should_paint_supports(position)) {
metal_a_supports_paint_setup(3, 4, 6, height, RCT2_GLOBAL(0x00F4419C, uint32));
}
switch (direction) {
case 0:
paint_util_push_tunnel_left(height - 8, TUNNEL_0);
break;
case 1:
paint_util_push_tunnel_right(height + 8, TUNNEL_12);
break;
case 2:
paint_util_push_tunnel_left(height + 8, TUNNEL_12);
break;
case 3:
paint_util_push_tunnel_right(height - 8, TUNNEL_0);
break;
}
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 + 40, 0x20);
}
/** rct2: 0x */