You've already forked OpenRCT2-Unity
mirror of
https://github.com/izzy2lost/OpenRCT2-Unity.git
synced 2026-03-10 12:38:22 -07:00
Merge pull request #3706 from IntelOrca/paint/river-rafts
Paint River Rafts
This commit is contained in:
@@ -83,6 +83,13 @@ struct paint_string_struct {
|
||||
uint8 *y_offsets; // 0x1A
|
||||
};
|
||||
|
||||
typedef struct sprite_bb {
|
||||
uint32 sprite_id;
|
||||
rct_xyz16 offset;
|
||||
rct_xyz16 bb_offset;
|
||||
rct_xyz16 bb_size;
|
||||
} sprite_bb;
|
||||
|
||||
enum PAINT_STRUCT_FLAGS {
|
||||
PAINT_STRUCT_FLAG_IS_MASKED = (1 << 0)
|
||||
};
|
||||
|
||||
@@ -5641,7 +5641,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = {
|
||||
0, // RIDE_TYPE_INVERTED_HAIRPIN_COASTER
|
||||
get_track_paint_function_magic_carpet, // RIDE_TYPE_MAGIC_CARPET
|
||||
get_track_paint_function_submarine_ride, // RIDE_TYPE_SUBMARINE_RIDE
|
||||
0, // RIDE_TYPE_RIVER_RAFTS
|
||||
get_track_paint_function_river_rafts, // RIDE_TYPE_RIVER_RAFTS
|
||||
get_track_paint_function_shop, // RIDE_TYPE_50
|
||||
get_track_paint_function_enterprise, // RIDE_TYPE_ENTERPRISE
|
||||
get_track_paint_function_shop, // RIDE_TYPE_52
|
||||
|
||||
@@ -445,6 +445,43 @@ bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const r
|
||||
return true;
|
||||
}
|
||||
|
||||
void track_paint_util_draw_station_platform(rct_ride *ride, uint8 direction, int height, int zOffset, rct_map_element * mapElement)
|
||||
{
|
||||
rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)};
|
||||
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
|
||||
if (direction & 1) {
|
||||
bool hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation());
|
||||
uint32 imageId = (hasFence ? SPR_STATION_NARROW_EDGE_FENCED_NE : SPR_STATION_NARROW_EDGE_NE) | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 0, 8, 32, 1, height + zOffset, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, height);
|
||||
|
||||
imageId = SPR_STATION_NARROW_EDGE_SW | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 24, 0, 8, 32, 1, height + zOffset, get_current_rotation());
|
||||
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation());
|
||||
if (hasFence) {
|
||||
imageId = SPR_STATION_FENCE_NW_SE | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 31, 0, 1, 32, 7, height + zOffset + 2, get_current_rotation());
|
||||
}
|
||||
track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height);
|
||||
} else {
|
||||
bool hasFence = track_paint_util_has_fence(EDGE_NW, position, mapElement, ride, get_current_rotation());
|
||||
uint32 imageId = (hasFence ? SPR_STATION_NARROW_EDGE_FENCED_NW : SPR_STATION_NARROW_EDGE_NW) | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 0, 32, 8, 1, height + zOffset, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, height);
|
||||
|
||||
imageId = SPR_STATION_NARROW_EDGE_SE | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 24, 32, 8, 1, height + zOffset, get_current_rotation());
|
||||
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation());
|
||||
if (hasFence) {
|
||||
imageId = SPR_STATION_FENCE_SW_NE | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 31, 32, 1, 7, height + zOffset + 2, get_current_rotation());
|
||||
}
|
||||
track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
bool hasFence;
|
||||
@@ -536,6 +573,23 @@ void track_paint_util_right_quarter_turn_5_tiles_paint(sint8 thickness, sint16 h
|
||||
}
|
||||
}
|
||||
|
||||
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])
|
||||
{
|
||||
sint8 sprite = right_quarter_turn_5_tiles_sprite_map[trackSequence];
|
||||
if (sprite < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const sprite_bb *spriteBB = &sprites[direction][sprite];
|
||||
uint32 imageId = spriteBB->sprite_id | colourFlags;
|
||||
sub_98197C(imageId,
|
||||
spriteBB->offset.x, spriteBB->offset.y,
|
||||
spriteBB->bb_size.x, spriteBB->bb_size.y, spriteBB->bb_size.z,
|
||||
height + spriteBB->offset.z,
|
||||
spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z,
|
||||
rotation);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
|
||||
#include "ride_data.h"
|
||||
#include "../common.h"
|
||||
#include "../world/map.h"
|
||||
#include "../paint/map_element/map_element.h"
|
||||
#include "../paint/paint.h"
|
||||
#include "../world/map.h"
|
||||
|
||||
extern const uint8 track_map_2x2[][4];
|
||||
extern const uint8 edges_2x2[];
|
||||
@@ -165,11 +166,13 @@ bool track_paint_util_has_fence(enum edge edge, rct_xy16 position, rct_map_eleme
|
||||
void track_paint_util_paint_floor(uint8 edges, uint32 colourFlags, uint16 height, const uint32 floorSprites[4], uint8 rotation);
|
||||
void track_paint_util_paint_fences(uint8 edges, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint32 colourFlags, uint16 height, const uint32 fenceSprites[4], uint8 rotation);
|
||||
bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height);
|
||||
void track_paint_util_draw_station_platform(rct_ride *ride, uint8 direction, int height, int zOffset, rct_map_element * mapElement);
|
||||
void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement);
|
||||
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_2(sint16 height, int direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[][5]);
|
||||
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);
|
||||
@@ -210,6 +213,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int d
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_monorail_cycles(int trackType, int direction);
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_magic_carpet(int trackType, int direction);
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_submarine_ride(int trackType, int direction);
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_river_rafts(int trackType, int direction);
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_enterprise(int trackType, int direction);
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -283,46 +283,10 @@ static void paint_river_rapids_track_flat(uint8 rideIndex, uint8 trackSequence,
|
||||
/** rct2: 0x007576C0 */
|
||||
static void paint_river_rapids_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||
{
|
||||
rct_ride *ride = get_ride(rideIndex);
|
||||
|
||||
paint_river_rapids_track_flat(rideIndex, trackSequence, direction, height, mapElement);
|
||||
|
||||
rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)};
|
||||
rct_ride * ride = get_ride(rideIndex);
|
||||
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
|
||||
uint32 imageId;
|
||||
bool hasFence;
|
||||
|
||||
if (direction & 1) {
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation());
|
||||
imageId = (hasFence ? SPR_STATION_NARROW_EDGE_FENCED_NE : SPR_STATION_NARROW_EDGE_NE) | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 0, 8, 32, 1, height + 12, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, height);
|
||||
|
||||
imageId = SPR_STATION_NARROW_EDGE_SW | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 24, 0, 8, 32, 1, height + 12, get_current_rotation());
|
||||
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation());
|
||||
if (hasFence) {
|
||||
imageId = SPR_STATION_FENCE_NW_SE | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 31, 0, 1, 32, 7, height + 14, get_current_rotation());
|
||||
}
|
||||
track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height);
|
||||
} else {
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, position, mapElement, ride, get_current_rotation());
|
||||
imageId = (hasFence ? SPR_STATION_NARROW_EDGE_FENCED_NW : SPR_STATION_NARROW_EDGE_NW) | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 0, 32, 8, 1, height + 12, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, height);
|
||||
|
||||
imageId = SPR_STATION_NARROW_EDGE_SE | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 24, 32, 8, 1, height + 12, get_current_rotation());
|
||||
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation());
|
||||
if (hasFence) {
|
||||
imageId = SPR_STATION_FENCE_SW_NE | RCT2_GLOBAL(0x00F4419C, uint32);
|
||||
sub_98196C(imageId, 0, 31, 32, 1, 7, height + 14, get_current_rotation());
|
||||
}
|
||||
track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height);
|
||||
}
|
||||
|
||||
track_paint_util_draw_station_platform(ride, direction, height, 12, mapElement);
|
||||
paint_util_set_general_support_height(height + 32, 0x20);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user