mirror of https://github.com/OpenRCT2/OpenRCT2.git
Draw 3-tile turns
This commit is contained in:
parent
ed08deaac1
commit
7e92395bf5
|
@ -61,6 +61,18 @@ enum {
|
|||
SPR_CAR_RIDE_QUARTER_TURN_1_TILE_NW_NE = 28806,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_1_TILE_NE_SE = 28807,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_1_TILE_SE_SW = 28808,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_0 = 28809,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_1 = 28810,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_2 = 28811,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_0 = 28812,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_1 = 28813,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_2 = 28814,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_0 = 28815,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_1 = 28816,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_2 = 28817,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_0 = 28818,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_1 = 28819,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_2 = 28820,
|
||||
};
|
||||
|
||||
static const uint32 car_ride_track_pieces_flat[4] = {
|
||||
|
@ -126,6 +138,29 @@ static const uint32 car_ride_track_pieces_left_quarter_turn_1_tile[4] = {
|
|||
SPR_CAR_RIDE_QUARTER_TURN_1_TILE_SE_SW,
|
||||
};
|
||||
|
||||
static const uint32 car_ride_track_pieces_quarter_turn_3_tiles[4][3] = {
|
||||
{
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_0,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_1,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SW_SE_PART_2
|
||||
},
|
||||
{
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_0,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_1,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NW_SW_PART_2
|
||||
},
|
||||
{
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_0,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_1,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_NE_NW_PART_2
|
||||
},
|
||||
{
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_0,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_1,
|
||||
SPR_CAR_RIDE_QUARTER_TURN_3_TILES_SE_NE_PART_2
|
||||
}
|
||||
};
|
||||
|
||||
static const uint32 car_ride_track_pieces_tunnel[2][2][4] = {
|
||||
{
|
||||
{
|
||||
|
@ -295,14 +330,36 @@ static void paint_car_ride_station(uint8 rideIndex, uint8 trackSequence, uint8 d
|
|||
{
|
||||
}
|
||||
|
||||
/** rct2: 0x */
|
||||
/** rct2: 0x006F7378 */
|
||||
static void paint_car_ride_track_right_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||
{
|
||||
track_paint_util_right_quarter_turn_3_tiles_paint(3, height, direction, trackSequence, RCT2_GLOBAL(0x00F44198, uint32), car_ride_track_pieces_quarter_turn_3_tiles, defaultRightQuarterTurn3TilesOffsets, defaultRightQuarterTurn3TilesBoundLengths, NULL, get_current_rotation());
|
||||
track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence);
|
||||
|
||||
switch (trackSequence) {
|
||||
case 0:
|
||||
case 3:
|
||||
metal_a_supports_paint_setup(3, 4, 0, height, RCT2_GLOBAL(0x00F4419C, uint32));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
int blockedSegments = 0;
|
||||
switch (trackSequence) {
|
||||
case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; break;
|
||||
case 2: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; break;
|
||||
case 3: blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break;
|
||||
}
|
||||
paint_util_set_segment_support_height(paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0);
|
||||
|
||||
paint_util_set_general_support_height(height + 32, 0x20);
|
||||
}
|
||||
|
||||
/** rct2: 0x */
|
||||
/** rct2: 0x006F7368 */
|
||||
static void paint_car_ride_track_left_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||
{
|
||||
trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence];
|
||||
paint_car_ride_track_right_quarter_turn_3_tiles(rideIndex, trackSequence, (direction + 1) % 4, height, mapElement);
|
||||
}
|
||||
|
||||
/** rct2: 0x006F7388 */
|
||||
|
|
|
@ -590,6 +590,92 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2(sint16 height, int dire
|
|||
rotation);
|
||||
}
|
||||
|
||||
const uint8 mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[] = {3, 1, 2, 0};
|
||||
|
||||
const rct_xy16 defaultRightQuarterTurn3TilesOffsets[4][3] = {
|
||||
{
|
||||
{0, 6},
|
||||
{16, 16},
|
||||
{6, 0},
|
||||
},
|
||||
{
|
||||
{6, 0},
|
||||
{16, 0},
|
||||
{0, 6},
|
||||
},
|
||||
{
|
||||
{0, 6},
|
||||
{0, 0},
|
||||
{6, 0},
|
||||
},
|
||||
{
|
||||
{6, 0},
|
||||
{0, 16},
|
||||
{0, 6},
|
||||
}
|
||||
};
|
||||
|
||||
const rct_xy16 defaultRightQuarterTurn3TilesBoundLengths[4][3] = {
|
||||
{
|
||||
{32, 20},
|
||||
{16, 16},
|
||||
{20, 32},
|
||||
},
|
||||
{
|
||||
{20, 32},
|
||||
{16, 16},
|
||||
{32, 20},
|
||||
},
|
||||
{
|
||||
{32, 20},
|
||||
{16, 16},
|
||||
{20, 32},
|
||||
},
|
||||
{
|
||||
{20, 32},
|
||||
{16, 16},
|
||||
{32, 20},
|
||||
}
|
||||
};
|
||||
|
||||
static const sint8 right_quarter_turn_3_tiles_sprite_map[] = {0, -1, 1, 2};
|
||||
void track_paint_util_right_quarter_turn_3_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const rct_xy16 offsets[4][3], const rct_xy16 boundsLengths[4][3], const rct_xy16 boundsOffsets[4][3], uint8 rotation)
|
||||
{
|
||||
int index = right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 imageId = sprites[direction][index] | colourFlags;
|
||||
rct_xy16 offset = (offsets == NULL ? (rct_xy16){0, 0} : offsets[direction][index]);
|
||||
rct_xy16 boundsLength = boundsLengths[direction][index];
|
||||
rct_xy16 boundsOffset = (boundsOffsets == NULL ? offset : boundsOffsets[direction][index]);
|
||||
|
||||
sub_98197C(imageId, (sint8) offset.x, (sint8) offset.y, boundsLength.x, boundsLength.y, thickness, height, boundsOffset.x, boundsOffset.y, height, rotation);
|
||||
}
|
||||
|
||||
void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence)
|
||||
{
|
||||
if (direction == 0 && trackSequence == 0) {
|
||||
paint_util_push_tunnel_left(height, TUNNEL_0);
|
||||
}
|
||||
|
||||
if (direction == 0 && trackSequence == 3) {
|
||||
paint_util_push_tunnel_right(height, TUNNEL_0);
|
||||
}
|
||||
|
||||
|
||||
if (direction == 1 && trackSequence == 3) {
|
||||
paint_util_push_tunnel_left(height, TUNNEL_0);
|
||||
}
|
||||
|
||||
|
||||
if (direction == 3 && trackSequence == 0) {
|
||||
paint_util_push_tunnel_left(height, TUNNEL_0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static const sint8 left_quarter_turn_3_tiles_sprite_map[] = {2, -1, 1, 0};
|
||||
void track_paint_util_left_quarter_turn_3_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation)
|
||||
{
|
||||
|
|
|
@ -179,6 +179,10 @@ extern const uint32 fenceSpritesMetalB[];
|
|||
extern const uint32 trackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[4][3];
|
||||
extern const uint32 trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile[4];
|
||||
|
||||
extern const uint8 mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[];
|
||||
extern const rct_xy16 defaultRightQuarterTurn3TilesOffsets[4][3];
|
||||
extern const rct_xy16 defaultRightQuarterTurn3TilesBoundLengths[4][3];
|
||||
|
||||
extern bool gUseOriginalRidePaint;
|
||||
|
||||
bool track_paint_util_has_fence(enum edge edge, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint8 rotation);
|
||||
|
@ -192,6 +196,8 @@ void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definit
|
|||
|
||||
void track_paint_util_right_quarter_turn_5_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], uint8 rotation);
|
||||
void track_paint_util_right_quarter_turn_5_tiles_paint_2(sint16 height, int direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[][5]);
|
||||
void track_paint_util_right_quarter_turn_3_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const rct_xy16 offsets[4][3], const rct_xy16 boundsLengths[4][3], const rct_xy16 boundsOffsets[4][3], uint8 rotation);
|
||||
void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence);
|
||||
void track_paint_util_left_quarter_turn_3_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation);
|
||||
void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence);
|
||||
void track_paint_util_left_quarter_turn_1_tile_paint(sint8 thickness, sint16 height, sint16 boundBoxZOffset, int direction, uint32 colourFlags, const uint32 * sprites, uint8 rotation);
|
||||
|
|
Loading…
Reference in New Issue