Merge pull request #3706 from IntelOrca/paint/river-rafts

Paint River Rafts
This commit is contained in:
Ted John 2016-05-23 19:23:46 +01:00
commit 4ea1a48edc
6 changed files with 577 additions and 41 deletions

View File

@ -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)
};

View File

@ -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

View File

@ -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)
{

View File

@ -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

View File

@ -13,3 +13,510 @@
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#include "../../common.h"
#include "../../interface/viewport.h"
#include "../../paint/supports.h"
#include "../../paint/paint.h"
#include "../track.h"
#include "../track_paint.h"
enum {
SPR_RIVER_RAFTS_FLAT_TOP_SW_NE = 20820,
SPR_RIVER_RAFTS_FLAT_TOP_NW_SE = 20821,
SPR_RIVER_RAFTS_FLAT_TOP_NE_SW = 20822,
SPR_RIVER_RAFTS_FLAT_TOP_SE_NW = 20823,
SPR_RIVER_RAFTS_FLAT_SIDE_SW_NE = 20824,
SPR_RIVER_RAFTS_FLAT_SIDE_NW_SE = 20825,
SPR_RIVER_RAFTS_FLAT_SIDE_NE_SW = 20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W_SEQ_2 = 20989,
SPR_RIVER_RAFTS_S_BEND_LEFT_NE_NW_SW_SEQ_1 = 20990,
SPR_RIVER_RAFTS_S_BEND_LEFT_NE_NW_SW_SEQ_0 = 20991,
SPR_RIVER_RAFTS_S_BEND_LEFT_SE_NE_NW_SEQ_3 = 20992,
SPR_RIVER_RAFTS_S_BEND_LEFT_SE_NE_NW_SEQ_2 = 20993,
SPR_RIVER_RAFTS_S_BEND_LEFT_SE_NE_NW_SEQ_1 = 20994,
SPR_RIVER_RAFTS_S_BEND_LEFT_SE_NE_NW_SEQ_0 = 20995,
};
static const sprite_bb RiverRaftsLeftQuarterTurn5_Top[4][5] = {
{
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SW_NW_SEQ_0, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 27, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SW_NW_SEQ_2, { 0, 0, 0 }, { 0, 0, 0 }, { 32, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SW_NW_SEQ_3, { 0, 0, 0 }, { 0, 16, 0 }, { 16, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SW_NW_SEQ_5, { 0, 0, 0 }, { 16, 0, 0 }, { 16, 34, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SW_NW_SEQ_6, { 0, 0, 0 }, { 2, 0, 0 }, { 32, 32, 2 },
},
{
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NW_NE_SEQ_0, { 0, 0, 0 }, { 2, 0, 0 }, { 27, 32, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NW_NE_SEQ_2, { 0, 0, 0 }, { 0, 0, 0 }, { 16, 32, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NW_NE_SEQ_3, { 0, 0, 0 }, { 16, 16, 0 }, { 16, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NW_NE_SEQ_5, { 0, 0, 0 }, { 0, 0, 0 }, { 32, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NW_NE_SEQ_6, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 27, 2 },
},
{
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NE_SE_SEQ_0, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 32, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NE_SE_SEQ_2, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NE_SE_SEQ_3, { 0, 0, 0 }, { 16, 0, 0 }, { 16, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NE_SE_SEQ_5, { 0, 0, 0 }, { 0, 0, 0 }, { 16, 32, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_NE_SE_SEQ_6, { 0, 0, 0 }, { 2, 0, 0 }, { 27, 32, 2 },
},
{
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SE_SW_SEQ_0, { 0, 0, 0 }, { 2, 0, 0 }, { 32, 32, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SE_SW_SEQ_2, { 0, 0, 0 }, { 16, 0, 0 }, { 16, 32, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SE_SW_SEQ_3, { 0, 0, 0 }, { 0, 0, 0 }, { 16, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SE_SW_SEQ_5, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 },
SPR_RIVER_RAFTS_TURN_LEFT_5_TOP_SE_SW_SEQ_6, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 32, 2 },
}
};
static const sprite_bb RiverRaftsLeftQuarterTurn5_Side[4][5] = {
{
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SW_NW_SEQ_0, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 27, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SW_NW_SEQ_2, { 0, 0, 0 }, { 0, 0, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SW_NW_SEQ_3, { 0, 0, 0 }, { 0, 16, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SW_NW_SEQ_5, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 34, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SW_NW_SEQ_6, { 0, 0, 0 }, { 2, 0, 27 }, { 32, 32, 0 },
},
{
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NW_NE_SEQ_0, { 0, 0, 0 }, { 2, 0, 27 }, { 27, 32, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NW_NE_SEQ_2, { 0, 0, 0 }, { 0, 0, 27 }, { 16, 32, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NW_NE_SEQ_3, { 0, 0, 0 }, { 16, 16, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NW_NE_SEQ_5, { 0, 0, 0 }, { 0, 0, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NW_NE_SEQ_6, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 27, 0 },
},
{
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NE_SE_SEQ_0, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 32, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NE_SE_SEQ_2, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NE_SE_SEQ_3, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NE_SE_SEQ_5, { 0, 0, 0 }, { 0, 0, 27 }, { 16, 32, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_NE_SE_SEQ_6, { 0, 0, 0 }, { 2, 0, 27 }, { 27, 32, 0 },
},
{
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SE_SW_SEQ_0, { 0, 0, 0 }, { 2, 0, 27 }, { 32, 32, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SE_SW_SEQ_2, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 32, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SE_SW_SEQ_3, { 0, 0, 0 }, { 0, 0, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SE_SW_SEQ_5, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_LEFT_5_SIDE_SE_SW_SEQ_6, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 32, 0 },
}
};
static const sprite_bb RiverRaftsRightQuarterTurn5_Top[4][5] = {
{
SPR_RIVER_RAFTS_TURN_RIGHT_5_TOP_SW_SE_SEQ_0, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 32, 2 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_TOP_SW_SE_SEQ_2, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_TOP_SW_SE_SEQ_3, { 0, 0, 0 }, { 0, 0, 0 }, { 16, 16, 2 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_TOP_SW_SE_SEQ_5, { 0, 0, 0 }, { 16, 0, 0 }, { 16, 32, 2 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_TOP_SW_SE_SEQ_6, { 0, 0, 0 }, { 2, 0, 0 }, { 32, 32, 2 },
},
{
SPR_RIVER_RAFTS_TURN_RIGHT_5_TOP_NW_SW_SEQ_0, { 0, 0, 0 }, { 2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E_SEQ_5, { 0, 0, 0 }, { 0, 16, 0 }, { 32, 16, 2 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_TOP_SE_NE_SEQ_6, { 0, 0, 0 }, { 0, 2, 0 }, { 32, 32, 2 },
}
};
static const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = {
{
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SW_SE_SEQ_0, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 32, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SW_SE_SEQ_2, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SW_SE_SEQ_3, { 0, 0, 0 }, { 0, 0, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SW_SE_SEQ_5, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 32, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SW_SE_SEQ_6, { 0, 0, 0 }, { 2, 0, 27 }, { 32, 32, 0 },
},
{
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NW_SW_SEQ_0, { 0, 0, 0 }, { 2, 0, 27 }, { 32, 32, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NW_SW_SEQ_2, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 34, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NW_SW_SEQ_3, { 0, 0, 0 }, { 0, 16, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NW_SW_SEQ_5, { 0, 0, 0 }, { 0, 0, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NW_SW_SEQ_6, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 27, 0 },
},
{
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NE_NW_SEQ_0, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 27, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NE_NW_SEQ_2, { 0, 0, 0 }, { 0, 0, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NE_NW_SEQ_3, { 0, 0, 0 }, { 16, 16, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NE_NW_SEQ_5, { 0, 0, 0 }, { 0, 0, 27 }, { 16, 32, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_NE_NW_SEQ_6, { 0, 0, 0 }, { 2, 0, 27 }, { 27, 32, 0 },
},
{
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_0, { 0, 0, 0 }, { 2, 0, 27 }, { 27, 32, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_2, { 0, 0, 0 }, { 0, 0, 27 }, { 16, 32, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_3, { 0, 0, 0 }, { 16, 0, 27 }, { 16, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_5, { 0, 0, 0 }, { 0, 16, 27 }, { 32, 16, 0 },
SPR_RIVER_RAFTS_TURN_RIGHT_5_SIDE_SE_NE_SEQ_6, { 0, 0, 0 }, { 0, 2, 27 }, { 32, 32, 0 },
}
};
/** rct2: 0x0089B170 */
static void paint_river_rafts_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
uint32 imageId;
if (direction & 1) {
imageId = (direction == 1 ? SPR_RIVER_RAFTS_FLAT_TOP_NW_SE : SPR_RIVER_RAFTS_FLAT_TOP_SE_NW) | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 20, 32, 2, height, 6, 0, height, get_current_rotation());
imageId = (direction == 1 ? SPR_RIVER_RAFTS_FLAT_SIDE_NW_SE : SPR_RIVER_RAFTS_FLAT_SIDE_SE_NW) | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 1, 32, 26, height, 27, 0, height, get_current_rotation());
} else {
imageId = (direction == 0 ? SPR_RIVER_RAFTS_FLAT_TOP_SW_NE : SPR_RIVER_RAFTS_FLAT_TOP_NE_SW) | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 32, 20, 2, height, 0, 6, height, get_current_rotation());
imageId = (direction == 0 ? SPR_RIVER_RAFTS_FLAT_SIDE_SW_NE : SPR_RIVER_RAFTS_FLAT_SIDE_NE_SW) | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 32, 1, 26, height, 0, 27, height, get_current_rotation());
}
wooden_a_supports_paint_setup((direction & 1), 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL);
if (direction & 1) {
paint_util_push_tunnel_right(height, TUNNEL_6);
} else {
paint_util_push_tunnel_left(height, TUNNEL_6);
}
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 32, 0x20);
}
/** rct2: 0x0089B1A0 */
static void paint_river_rafts_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
rct_ride *ride = get_ride(rideIndex);
if (direction & 1) {
uint32 imageId = (direction == 1 ? SPR_RIVER_RAFTS_FLAT_TOP_NW_SE : SPR_RIVER_RAFTS_FLAT_TOP_SE_NW) | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 20, 32, 1, height, 6, 0, height + 3, get_current_rotation());
imageId = SPR_STATION_BASE_B_NW_SE | RCT2_GLOBAL(0x00F441A0, uint32);
sub_98196C(imageId, 0, 0, 32, 32, 1, height, get_current_rotation());
} else {
uint32 imageId = (direction == 0 ? SPR_RIVER_RAFTS_FLAT_TOP_SW_NE : SPR_RIVER_RAFTS_FLAT_TOP_NE_SW) | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3, get_current_rotation());
imageId = SPR_STATION_BASE_B_SW_NE | RCT2_GLOBAL(0x00F441A0, uint32);
sub_98196C(imageId, 0, 0, 32, 32, 1, height, get_current_rotation());
}
track_paint_util_draw_station_platform(ride, direction, height, 7, mapElement);
wooden_a_supports_paint_setup((direction & 1), 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL);
if (direction & 1) {
paint_util_push_tunnel_right(height, TUNNEL_6);
} else {
paint_util_push_tunnel_left(height, TUNNEL_6);
}
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 32, 0x20);
}
/** rct2: 0x0089B1D0 */
static void paint_river_rafts_track_left_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_2(height, direction, get_current_rotation(), trackSequence, RCT2_GLOBAL(0x00F44198, uint32), RiverRaftsLeftQuarterTurn5_Top);
track_paint_util_right_quarter_turn_5_tiles_paint_2(height, direction, get_current_rotation(), trackSequence, RCT2_GLOBAL(0x00F44198, uint32), RiverRaftsLeftQuarterTurn5_Side);
if (trackSequence != 1 && trackSequence != 4) {
static const uint8 supportTypes[][7] = {
{ 0, 0xFF, 5, 3, 0xFF, 5, 1 },
{ 1, 0xFF, 2, 4, 0xFF, 2, 0 },
{ 0, 0xFF, 3, 5, 0xFF, 3, 1 },
{ 1, 0xFF, 4, 2, 0xFF, 4, 0 },
};
uint8 supportType = supportTypes[direction][trackSequence];
wooden_a_supports_paint_setup(supportType, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL);
}
switch (trackSequence) {
case 0: paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); break;
case 1: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break;
case 2: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4 | SEGMENT_B8 | SEGMENT_D0, direction), 0xFFFF, 0); break;
case 3: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break;
case 4: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); break;
case 5: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_B8, direction), 0xFFFF, 0); break;
case 6: paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); break;
}
paint_util_set_general_support_height(height + 32, 0x20);
}
/** rct2: 0x0089B1D0 */
static void paint_river_rafts_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_2(height, direction, get_current_rotation(), trackSequence, RCT2_GLOBAL(0x00F44198, uint32), RiverRaftsRightQuarterTurn5_Top);
track_paint_util_right_quarter_turn_5_tiles_paint_2(height, direction, get_current_rotation(), trackSequence, RCT2_GLOBAL(0x00F44198, uint32), RiverRaftsRightQuarterTurn5_Side);
if (trackSequence != 1 && trackSequence != 4) {
static const uint8 supportTypes[][7] = {
{ 0, 0xFF, 4, 2, 0xFF, 4, 1 },
{ 1, 0xFF, 5, 3, 0xFF, 5, 0 },
{ 0, 0xFF, 2, 4, 0xFF, 2, 1 },
{ 1, 0xFF, 3, 5, 0xFF, 3, 0 },
};
uint8 supportType = supportTypes[direction][trackSequence];
wooden_a_supports_paint_setup(supportType, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL);
}
switch (trackSequence) {
case 0: paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); break;
case 1: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break;
case 2: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 0xFFFF, 0); break;
case 3: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break;
case 4: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); break;
case 5: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 0xFFFF, 0); break;
case 6: paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); break;
}
paint_util_set_general_support_height(height + 32, 0x20);
}
static void paint_river_rafts_track_s_bend(uint32 baseImageId, uint8 trackSequence, uint8 direction, int height, const uint8 supportTypes[][4], uint16 ssegs1, uint16 ssegs2)
{
uint32 imageId = baseImageId;
imageId += (direction & 1) * 4;
imageId += (direction & 2) ? 35 : 0;
imageId += (direction & 2) ? -trackSequence : trackSequence;
imageId |= RCT2_GLOBAL(0x00F44198, uint32);
uint32 sideImageId = imageId;
sideImageId += (direction & 2) ? -16 : 16;
switch (direction & 1) {
case 0:
switch (trackSequence) {
case 0: sub_98197C(imageId , 0, 0, 32, 27, 2, height, 0, 2, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27, get_current_rotation()); break;
case 1: sub_98197C(imageId , 0, 0, 32, 26, 2, height, 0, 6, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 32, 26, 0, height, 0, 6, height + 27, get_current_rotation()); break;
case 2: sub_98197C(imageId , 0, 0, 32, 26, 2, height, 0, 6, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 32, 26, 0, height, 0, 6, height + 27, get_current_rotation()); break;
case 3: sub_98197C(imageId , 0, 0, 32, 27, 2, height, 0, 2, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27, get_current_rotation()); break;
}
case 1:
switch (trackSequence) {
case 0: sub_98197C(imageId , 0, 0, 27, 32, 2, height, 2, 0, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 27, 32, 0, height, 2, 0, height + 27, get_current_rotation()); break;
case 1: sub_98197C(imageId , 0, 0, 26, 32, 2, height, 6, 0, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 26, 32, 0, height, 6, 0, height + 27, get_current_rotation()); break;
case 2: sub_98197C(imageId , 0, 0, 26, 32, 2, height, 6, 0, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 26, 32, 0, height, 6, 0, height + 27, get_current_rotation()); break;
case 3: sub_98197C(imageId , 0, 0, 27, 32, 2, height, 2, 0, height , get_current_rotation());
sub_98197C(sideImageId, 0, 0, 27, 32, 0, height, 2, 0, height + 27, get_current_rotation()); break;
}
}
uint8 supportType = supportTypes[direction][trackSequence];
wooden_a_supports_paint_setup(supportType, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL);
switch (trackSequence) {
case 0:
case 3:
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
break;
case 1:
paint_util_set_segment_support_height(paint_util_rotate_segments(ssegs1, direction), 0xFFFF, 0);
break;
case 2:
paint_util_set_segment_support_height(paint_util_rotate_segments(ssegs2, direction), 0xFFFF, 0);
break;
}
paint_util_set_general_support_height(height + 32, 0x20);
}
/** rct2: 0x0089B180 */
static void paint_river_rafts_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
static const uint8 supportTypes[][4] = {
{ 0, 5, 3, 0 },
{ 1, 2, 4, 1 },
{ 0, 3, 5, 0 },
{ 1, 4, 2, 1 },
};
paint_river_rafts_track_s_bend(SPR_RIVER_RAFTS_S_BEND_LEFT_TOP_SW_NW_NE_SEQ_0, trackSequence, direction, height, supportTypes,
SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4,
SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC);
}
/** rct2: 0x0089B190 */
static void paint_river_rafts_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
static const uint8 supportTypes[][4] = {
{ 0, 4, 2, 0 },
{ 1, 5, 3, 1 },
{ 0, 2, 4, 0 },
{ 1, 3, 5, 1 },
};
paint_river_rafts_track_s_bend(SPR_RIVER_RAFTS_S_BEND_LEFT_TOP_SW_SE_NE_SEQ_0, trackSequence, direction, height, supportTypes,
SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC,
SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4);
}
/**
* rct2: 0x0089B0C0
*/
TRACK_PAINT_FUNCTION get_track_paint_function_river_rafts(int trackType, int direction)
{
switch (trackType) {
case TRACK_ELEM_FLAT: return paint_river_rafts_track_flat;
case TRACK_ELEM_END_STATION:
case TRACK_ELEM_BEGIN_STATION:
case TRACK_ELEM_MIDDLE_STATION:
return paint_river_rafts_station;
case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: return paint_river_rafts_track_left_quarter_turn_5_tiles;
case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: return paint_river_rafts_track_right_quarter_turn_5_tiles;
case TRACK_ELEM_S_BEND_LEFT: return paint_river_rafts_track_s_bend_left;
case TRACK_ELEM_S_BEND_RIGHT: return paint_river_rafts_track_s_bend_right;
}
return NULL;
}

View File

@ -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);
}