mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Merge pull request #3737 from marijnvdwerf/paint-setup/monorail
Paint setup/Monorail
This commit is contained in:
@@ -509,9 +509,9 @@ bool metal_a_supports_paint_setup(int supportType, int segment, int special, int
|
||||
* Metal pole supports
|
||||
* rct2: 0x00663584
|
||||
*/
|
||||
bool metal_b_wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags)
|
||||
bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags)
|
||||
{
|
||||
int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
|
||||
int eax = special, ebx = segment, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
|
||||
RCT2_CALLFUNC_X(0x00663584, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);
|
||||
return eax & 0xFF;
|
||||
}
|
||||
|
||||
@@ -22,4 +22,6 @@
|
||||
bool wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, bool* underground);
|
||||
bool wooden_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags);
|
||||
bool metal_a_supports_paint_setup(int supportType, int segment, int special, int height, uint32 imageColourFlags);
|
||||
bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -338,7 +338,7 @@ static void paint_car_ride_station(uint8 rideIndex, uint8 trackSequence, uint8 d
|
||||
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);
|
||||
track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_0);
|
||||
|
||||
switch (trackSequence) {
|
||||
case 0:
|
||||
|
||||
@@ -362,7 +362,7 @@ static void paint_ghost_train_station(uint8 rideIndex, uint8 trackSequence, uint
|
||||
static void paint_ghost_train_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), ghost_train_track_pieces_quarter_turn_3_tiles, NULL, defaultRightQuarterTurn3TilesBoundLengths, defaultRightQuarterTurn3TilesOffsets, get_current_rotation());
|
||||
track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence);
|
||||
track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_0);
|
||||
|
||||
switch (trackSequence) {
|
||||
case 0:
|
||||
|
||||
@@ -283,8 +283,7 @@ static const sint8 monorail_cycles_track_right_quarter_turn_5_tiles_support_spec
|
||||
/** rct2: 0x0088ADB8 */
|
||||
static void paint_monorail_cycles_track_right_quarter_turn_5_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||
{
|
||||
track_paint_util_right_quarter_turn_5_tiles_paint(1, height, direction, trackSequence, RCT2_GLOBAL(0x00F44198, uint32), monorail_cycles_track_pieces_flat_quarter_turn_5_tiles, get_current_rotation());
|
||||
|
||||
track_paint_util_right_quarter_turn_5_tiles_paint(1, height, direction, trackSequence, RCT2_GLOBAL(0x00F44198, uint32), monorail_cycles_track_pieces_flat_quarter_turn_5_tiles, NULL, defaultRightQuarterTurn5TilesBoundLengths, defaultRightQuarterTurn5TilesOffsets, get_current_rotation());
|
||||
|
||||
int supportHeight = height + monorail_cycles_track_right_quarter_turn_5_tiles_support_height_offset[direction][trackSequence];
|
||||
int supportSpecial = monorail_cycles_track_right_quarter_turn_5_tiles_support_special[direction][trackSequence];
|
||||
@@ -336,12 +335,10 @@ static void paint_monorail_cycles_track_right_quarter_turn_5_tiles(uint8 rideInd
|
||||
paint_util_set_general_support_height(height + 32, 0x20);
|
||||
}
|
||||
|
||||
static const uint8 left_quarter_turn_5_tiles_to_right_turn_map[] = {6, 4, 5, 3, 1, 2, 0};
|
||||
|
||||
/** rct2: 0x0088ADA8 */
|
||||
static void paint_monorail_cycles_track_left_quarter_turn_5_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||
{
|
||||
trackSequence = left_quarter_turn_5_tiles_to_right_turn_map[trackSequence];
|
||||
trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence];
|
||||
paint_monorail_cycles_track_right_quarter_turn_5_tiles(rideIndex, trackSequence, (direction + 1) % 4, height, mapElement);
|
||||
}
|
||||
|
||||
|
||||
@@ -5568,7 +5568,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = {
|
||||
0, // RIDE_TYPE_INVERTED_ROLLER_COASTER
|
||||
0, // RIDE_TYPE_JUNIOR_ROLLER_COASTER
|
||||
0, // RIDE_TYPE_MINIATURE_RAILWAY
|
||||
0, // RIDE_TYPE_MONORAIL
|
||||
get_track_paint_function_monorail, // RIDE_TYPE_MONORAIL
|
||||
0, // RIDE_TYPE_MINI_SUSPENDED_COASTER
|
||||
get_track_paint_function_boat_ride, // RIDE_TYPE_BOAT_RIDE
|
||||
0, // RIDE_TYPE_WOODEN_WILD_MOUSE
|
||||
|
||||
@@ -551,57 +551,84 @@ void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definit
|
||||
}
|
||||
}
|
||||
|
||||
const uint8 mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = {6, 4, 5, 3, 1, 2, 0};
|
||||
|
||||
const rct_xy16 defaultRightQuarterTurn5TilesOffsets[4][5] = {
|
||||
{
|
||||
{0, 6},
|
||||
{0, 16},
|
||||
{0, 0},
|
||||
{16, 0},
|
||||
{6, 0},
|
||||
},
|
||||
{
|
||||
{6, 0},
|
||||
{16, 0},
|
||||
{0, 16},
|
||||
{0, 0},
|
||||
{0, 6},
|
||||
},
|
||||
{
|
||||
{0, 6},
|
||||
{0, 0},
|
||||
{16, 16},
|
||||
{0, 0},
|
||||
{6, 0},
|
||||
},
|
||||
{
|
||||
{6, 0},
|
||||
{0, 0},
|
||||
{16, 0},
|
||||
{0, 16},
|
||||
{0, 6},
|
||||
}
|
||||
};
|
||||
|
||||
const rct_xy16 defaultRightQuarterTurn5TilesBoundLengths[4][5] = {
|
||||
{
|
||||
{32, 20},
|
||||
{32, 16},
|
||||
{16, 16},
|
||||
{16, 32},
|
||||
{20, 32},
|
||||
},
|
||||
{
|
||||
{20, 32},
|
||||
{16, 32},
|
||||
{16, 16},
|
||||
{32, 16},
|
||||
{32, 20},
|
||||
},
|
||||
{
|
||||
{32, 20},
|
||||
{32, 16},
|
||||
{16, 16},
|
||||
{16, 32},
|
||||
{20, 32},
|
||||
},
|
||||
{
|
||||
{20, 32},
|
||||
{16, 32},
|
||||
{16, 16},
|
||||
{32, 16},
|
||||
{32, 20},
|
||||
}
|
||||
};
|
||||
|
||||
static const sint8 right_quarter_turn_5_tiles_sprite_map[] = {0, -1, 1, 2, -1, 3, 4};
|
||||
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(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const rct_xy16 offsets[4][5], const rct_xy16 boundsLengths[4][5], const rct_xy16 boundsOffsets[4][5], uint8 rotation)
|
||||
{
|
||||
sint8 sprite = right_quarter_turn_5_tiles_sprite_map[trackSequence];
|
||||
if (sprite < 0) {
|
||||
int index = right_quarter_turn_5_tiles_sprite_map[trackSequence];
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 imageId = sprites[direction][sprite] | colourFlags;
|
||||
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]);
|
||||
|
||||
switch (direction) {
|
||||
case 0:
|
||||
switch (trackSequence) {
|
||||
case 0: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height, rotation); break;
|
||||
case 2: sub_98197C(imageId, 0, 0, 32, 16, thickness, height, 0, 16, height, rotation); break;
|
||||
case 3: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 0, 0, height, rotation); break;
|
||||
case 5: sub_98197C(imageId, 0, 0, 16, 32, thickness, height, 16, 0, height, rotation); break;
|
||||
case 6: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height, rotation); break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
switch (trackSequence) {
|
||||
case 0: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height, rotation); break;
|
||||
case 2: sub_98197C(imageId, 0, 0, 16, 32, thickness, height, 16, 0, height, rotation); break;
|
||||
case 3: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 0, 16, height, rotation); break;
|
||||
case 5: sub_98197C(imageId, 0, 0, 32, 16, thickness, height, 0, 0, height, rotation); break;
|
||||
case 6: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height, rotation); break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
switch (trackSequence) {
|
||||
case 0: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height, rotation); break;
|
||||
case 2: sub_98197C(imageId, 0, 0, 32, 16, thickness, height, 0, 0, height, rotation); break;
|
||||
case 3: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 16, 16, height, rotation); break;
|
||||
case 5: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 0, 0, height, rotation); break;
|
||||
case 6: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height, rotation); break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
switch (trackSequence) {
|
||||
case 0: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height, rotation); break;
|
||||
case 2: sub_98197C(imageId, 0, 0, 16, 32, thickness, height, 0, 0, height, rotation); break;
|
||||
case 3: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 16, 0, height, rotation); break;
|
||||
case 5: sub_98197C(imageId, 0, 0, 32, 16, thickness, height, 0, 16, height, rotation); break;
|
||||
case 6: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height, rotation); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
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_5_tiles_paint_2(sint16 height, int direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[][5])
|
||||
@@ -685,24 +712,24 @@ void track_paint_util_right_quarter_turn_3_tiles_paint(sint8 thickness, sint16 h
|
||||
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)
|
||||
void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType)
|
||||
{
|
||||
if (direction == 0 && trackSequence == 0) {
|
||||
paint_util_push_tunnel_left(height, TUNNEL_0);
|
||||
paint_util_push_tunnel_left(height, tunnelType);
|
||||
}
|
||||
|
||||
if (direction == 0 && trackSequence == 3) {
|
||||
paint_util_push_tunnel_right(height, TUNNEL_0);
|
||||
paint_util_push_tunnel_right(height, tunnelType);
|
||||
}
|
||||
|
||||
|
||||
if (direction == 1 && trackSequence == 3) {
|
||||
paint_util_push_tunnel_left(height, TUNNEL_0);
|
||||
paint_util_push_tunnel_left(height, tunnelType);
|
||||
}
|
||||
|
||||
|
||||
if (direction == 3 && trackSequence == 0) {
|
||||
paint_util_push_tunnel_left(height, TUNNEL_0);
|
||||
paint_util_push_tunnel_right(height, tunnelType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,10 @@ extern const uint32 fenceSpritesMetalB[];
|
||||
extern const uint32 trackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[4][3];
|
||||
extern const uint32 trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile[4];
|
||||
|
||||
extern const uint8 mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[];
|
||||
extern const rct_xy16 defaultRightQuarterTurn5TilesOffsets[4][5];
|
||||
extern const rct_xy16 defaultRightQuarterTurn5TilesBoundLengths[4][5];
|
||||
|
||||
extern const uint8 mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[];
|
||||
extern const rct_xy16 defaultRightQuarterTurn3TilesOffsets[4][3];
|
||||
extern const rct_xy16 defaultRightQuarterTurn3TilesBoundLengths[4][3];
|
||||
@@ -194,10 +198,10 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d
|
||||
bool track_paint_util_should_paint_supports(rct_xy16 position);
|
||||
void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definition * entranceStyle, rct_xy16 position, uint8 direction, int height, rct_map_element * mapElement, uint8 rotation);
|
||||
|
||||
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(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const rct_xy16 offsets[4][5], const rct_xy16 boundsLengths[4][5], const rct_xy16 boundsOffsets[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_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType);
|
||||
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);
|
||||
@@ -207,6 +211,7 @@ void track_paint_util_spinning_tunnel_paint(sint8 thickness, sint16 height, uint
|
||||
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);
|
||||
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_monorail(int trackType, int direction);
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_boat_ride(int trackType, int direction);
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_car_ride(int trackType, int direction);
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_launched_freefall(int trackType, int direction);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user