1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00

Implement flat and flat water for water rc

This commit is contained in:
Ted John
2016-09-19 22:20:01 +01:00
parent b18d053a18
commit f14788f74f
5 changed files with 63 additions and 6 deletions

View File

@@ -7,15 +7,13 @@
<LocalDebuggerCommand>$(TargetDir)\openrct2.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>"C:\Users\Ted\Documents\OpenRCT2\save\paint_water_rc.sv6"</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>$(TargetDir)\openrct2.exe</LocalDebuggerCommand>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<LocalDebuggerCommandArguments>"C:\Users\Ted\Documents\OpenRCT2\save\paint_water_rc.sv6"</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>

View File

@@ -6315,7 +6315,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = {
get_track_paint_function_crooked_house, // RIDE_TYPE_CROOKED_HOUSE
get_track_paint_function_monorail_cycles, // RIDE_TYPE_MONORAIL_CYCLES
0, // RIDE_TYPE_COMPACT_INVERTED_COASTER
0, // RIDE_TYPE_WATER_COASTER
get_track_paint_function_water_rc, // RIDE_TYPE_WATER_COASTER
0, // RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER
0, // RIDE_TYPE_INVERTED_HAIRPIN_COASTER
get_track_paint_function_magic_carpet, // RIDE_TYPE_MAGIC_CARPET

View File

@@ -287,6 +287,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direc
TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_monorail_cycles(int trackType, int direction);
TRACK_PAINT_FUNCTION get_track_paint_function_water_rc(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);

View File

@@ -291,7 +291,7 @@ static const sprite_bb RiverRaftsRightQuarterTurn5_Side[4][5] = {
};
/** rct2: 0x0089B170 */
static void paint_river_rafts_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
void paint_river_rafts_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
uint32 imageId;

View File

@@ -13,3 +13,61 @@
* 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_JUNIOR_RC_FLAT_SW_NE = 27807,
SPR_JUNIOR_RC_FLAT_NW_SE = 27808,
SPR_WATER_RC_FLAT_CHAIN_SW_NE = 27983,
SPR_WATER_RC_FLAT_CHAIN_NW_SE = 27984,
};
static const uint32 water_rc_track_pieces_flat[2][4] = {
{
SPR_JUNIOR_RC_FLAT_SW_NE,
SPR_JUNIOR_RC_FLAT_NW_SE,
SPR_JUNIOR_RC_FLAT_SW_NE,
SPR_JUNIOR_RC_FLAT_NW_SE
},
{
SPR_WATER_RC_FLAT_CHAIN_SW_NE,
SPR_WATER_RC_FLAT_CHAIN_NW_SE,
SPR_WATER_RC_FLAT_CHAIN_SW_NE,
SPR_WATER_RC_FLAT_CHAIN_NW_SE
},
};
void paint_river_rafts_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement);
static void paint_water_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
bool isChained = track_element_is_lift_hill(mapElement);
uint32 imageId = water_rc_track_pieces_flat[isChained][direction] | gTrackColours[SCHEME_TRACK];
sub_98196C_rotated(direction, imageId, 0, 6, 32, 20, 1, height);
paint_util_push_tunnel_rotated(direction, height, TUNNEL_0);
if (track_paint_util_should_paint_supports(gPaintMapPosition)) {
metal_a_supports_paint_setup((direction & 1) ? 2 : 1, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]);
}
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 + 32, 0x20);
}
TRACK_PAINT_FUNCTION get_track_paint_function_water_rc(int trackType, int direction)
{
switch (trackType) {
case TRACK_ELEM_FLAT:
return paint_water_rc_track_flat;
case TRACK_ELEM_FLAT_COVERED:
return paint_river_rafts_track_flat;
}
return NULL;
}