From 4b453a3160e830792a540f1fc2e46016a8f0a29e Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 16:02:08 +0100 Subject: [PATCH 1/8] Add splash boats paint function --- src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + src/ride/water/splash_boats.c | 10 +++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 86c6ee4dbc..379f53c905 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6301,7 +6301,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { 0, // RIDE_TYPE_FLYING_ROLLER_COASTER 0, // RIDE_TYPE_FLYING_ROLLER_COASTER_ALT get_track_paint_function_virginia_reel, // RIDE_TYPE_VIRGINIA_REEL - 0, // RIDE_TYPE_SPLASH_BOATS + get_track_paint_function_splash_boats, // RIDE_TYPE_SPLASH_BOATS get_track_paint_function_mini_helicopters, // RIDE_TYPE_MINI_HELICOPTERS 0, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER 0, // RIDE_TYPE_SUSPENDED_MONORAIL diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 2745d30dcc..7f07b28d41 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -280,6 +280,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_haunted_house(int trackType, int d TRACK_PAINT_FUNCTION get_track_paint_function_circus_show(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_ghost_train(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direction); diff --git a/src/ride/water/splash_boats.c b/src/ride/water/splash_boats.c index e817ecaf32..2ba0394c62 100644 --- a/src/ride/water/splash_boats.c +++ b/src/ride/water/splash_boats.c @@ -16,10 +16,18 @@ #include "../../config.h" #include "../../interface/viewport.h" -#include "../../world/sprite.h" #include "../../paint/paint.h" +#include "../../paint/supports.h" +#include "../../world/sprite.h" +#include "../track.h" +#include "../track_paint.h" #include "../vehicle_paint.h" +TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction) +{ + return NULL; +} + #ifndef NO_VEHICLES /** * From f42fd74837cd488121234d7e51ee22e82944df10 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 16:06:36 +0100 Subject: [PATCH 2/8] Use river rafts for shared track pieces --- src/ride/water/splash_boats.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ride/water/splash_boats.c b/src/ride/water/splash_boats.c index 2ba0394c62..cfc9dec99b 100644 --- a/src/ride/water/splash_boats.c +++ b/src/ride/water/splash_boats.c @@ -25,6 +25,22 @@ TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction) { + switch (trackType) { + + ////////////////////////////////////////////////////// + // Use River Rafts + ////////////////////////////////////////////////////// + case TRACK_ELEM_FLAT: + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + case TRACK_ELEM_S_BEND_LEFT: + case TRACK_ELEM_S_BEND_RIGHT: + return get_track_paint_function_river_rafts(trackType, direction); + } + return NULL; } From 005b6540861f4adeb2e3caef3284c87fa0dd5506 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 16:07:37 +0100 Subject: [PATCH 3/8] Add debug save start info --- openrct2.vcxproj.user | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openrct2.vcxproj.user b/openrct2.vcxproj.user index b782b153c4..7e3fc94612 100644 --- a/openrct2.vcxproj.user +++ b/openrct2.vcxproj.user @@ -7,8 +7,7 @@ $(TargetDir)\openrct2.exe WindowsLocalDebugger $(TargetDir) - - + "C:\Users\Ted\Documents\OpenRCT2\save\paint_splash_boats.sv6" $(TargetDir) From f2279984cbde3f52e1f8e2ad8babba89dca7f51b Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 18:59:34 +0100 Subject: [PATCH 4/8] Implement half of splash boat tracks --- src/ride/water/splash_boats.c | 177 ++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) diff --git a/src/ride/water/splash_boats.c b/src/ride/water/splash_boats.c index cfc9dec99b..7debb01b42 100644 --- a/src/ride/water/splash_boats.c +++ b/src/ride/water/splash_boats.c @@ -23,9 +23,186 @@ #include "../track_paint.h" #include "../vehicle_paint.h" +enum { + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_SW_NE = 20828, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_NW_SE = 20829, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_NE_SW = 20830, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_SE_NW = 20831, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_SW_NE = 20832, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_NW_SE = 20833, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_NE_SW = 20834, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_SE_NW = 20835, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_SW_NE = 20836, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_NW_SE = 20837, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_NE_SW = 20838, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_SE_NW = 20839, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_SW_NE = 20840, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_NW_SE = 20841, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_NE_SW = 20842, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_SE_NW = 20843, + SPR_SPLASH_BOATS_25_DEG_UP_SW_NE = 20844, + SPR_SPLASH_BOATS_25_DEG_UP_NW_SE = 20845, + SPR_SPLASH_BOATS_25_DEG_UP_NE_SW = 20846, + SPR_SPLASH_BOATS_25_DEG_UP_SE_NW = 20847, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_SW_NE = 20848, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NW_SE = 20849, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NE_SW = 20850, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_SE_NW = 20851, + SPR_SPLASH_BOATS_60_DEG_UP_SW_NE = 20880, + SPR_SPLASH_BOATS_60_DEG_UP_NW_SE = 20881, + SPR_SPLASH_BOATS_60_DEG_UP_NE_SW = 20882, + SPR_SPLASH_BOATS_60_DEG_UP_SE_NW = 20883, + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_SW_NE = 20884, + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_NW_SE = 20885, + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_NE_SW = 20886, + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_SE_NW = 20887, +}; + +uint32 SplashBoats25DegUpImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_NW_SE, + SPR_SPLASH_BOATS_25_DEG_UP_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_SE_NW, +}; + +uint32 SplashBoats25DegUpFrontImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NW_SE, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_SE_NW, +}; + +uint32 SplashBoats60DegUpImageId[4] = +{ + SPR_SPLASH_BOATS_60_DEG_UP_SW_NE, + SPR_SPLASH_BOATS_60_DEG_UP_NW_SE, + SPR_SPLASH_BOATS_60_DEG_UP_NE_SW, + SPR_SPLASH_BOATS_60_DEG_UP_SE_NW, +}; + +uint32 SplashBoats60DegUpFrontImageId[4] = +{ + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_SW_NE, + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_NW_SE, + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_NE_SW, + SPR_SPLASH_BOATS_60_DEG_UP_FRONT_SE_NW, +}; + +uint32 SplashBoatsFlatTo25DegUpImageId[4] = +{ + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_SW_NE, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_NW_SE, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_NE_SW, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_SE_NW, +}; + +uint32 SplashBoatsFlatTo25DegUpFrontImageId[4] = +{ + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_SW_NE, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_NW_SE, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_NE_SW, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_SE_NW, +}; + +uint32 SplashBoats25DegUpToFlatImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_NW_SE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_SE_NW, +}; + +uint32 SplashBoats25DegUpToFlatFrontImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_NW_SE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_SE_NW, +}; + +static void paint_splash_boats_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoats25DegUpImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoats25DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 50, height, 0, 27, height); + + wooden_a_supports_paint_setup((direction & 1), 9 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void paint_splash_boats_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoats60DegUpImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoats60DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 98, height, 0, 27, height); + + wooden_a_supports_paint_setup((direction & 1), 21 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void paint_splash_boats_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoatsFlatTo25DegUpImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoatsFlatTo25DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 42, height, 0, 27, height); + + wooden_a_supports_paint_setup((direction & 1), 1 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void paint_splash_boats_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoats25DegUpToFlatImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoats25DegUpToFlatFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 34, height, 0, 27, height); + + wooden_a_supports_paint_setup((direction & 1), 5 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction) { switch (trackType) { + case TRACK_ELEM_25_DEG_UP: + return paint_splash_boats_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return paint_splash_boats_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return paint_splash_boats_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return NULL; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return paint_splash_boats_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + case TRACK_ELEM_60_DEG_DOWN: + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return NULL; ////////////////////////////////////////////////////// // Use River Rafts From 39de20e0a3fc758f3f320e7b7298a6b86d769c03 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 19:48:34 +0100 Subject: [PATCH 5/8] Implement remaining tracks --- src/ride/water/splash_boats.c | 211 +++++++++++++++++++++++++++++++++- 1 file changed, 209 insertions(+), 2 deletions(-) diff --git a/src/ride/water/splash_boats.c b/src/ride/water/splash_boats.c index 7debb01b42..34b6348fdc 100644 --- a/src/ride/water/splash_boats.c +++ b/src/ride/water/splash_boats.c @@ -48,6 +48,34 @@ enum { SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NW_SE = 20849, SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NE_SW = 20850, SPR_SPLASH_BOATS_25_DEG_UP_FRONT_SE_NW = 20851, + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_NE_SW = 20852, + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_SE_NW = 20853, + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_SW_NE = 20854, + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_NW_SE = 20855, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_NE_SW = 20856, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_SE_NW = 20857, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_SW_NE = 20858, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_NW_SE = 20859, + SPR_SPLASH_BOATS_25_DEG_DOWN_NE_SW = 20860, + SPR_SPLASH_BOATS_25_DEG_DOWN_SE_NW = 20861, + SPR_SPLASH_BOATS_25_DEG_DOWN_SW_NE = 20862, + SPR_SPLASH_BOATS_25_DEG_DOWN_NW_SE = 20863, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_SW_NE = 20864, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_NW_SE = 20865, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_NE_SW = 20866, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_SE_NW = 20867, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_SW_NE = 20868, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_NW_SE = 20869, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_NE_SW = 20870, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_SE_NW = 20871, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_SW_NE = 20872, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_NW_SE = 20873, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_NE_SW = 20874, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_SE_NW = 20875, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_SW_NE = 20876, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_NW_SE = 20877, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_NE_SW = 20878, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_SE_NW = 20879, SPR_SPLASH_BOATS_60_DEG_UP_SW_NE = 20880, SPR_SPLASH_BOATS_60_DEG_UP_NW_SE = 20881, SPR_SPLASH_BOATS_60_DEG_UP_NE_SW = 20882, @@ -122,6 +150,86 @@ uint32 SplashBoats25DegUpToFlatFrontImageId[4] = SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_SE_NW, }; +uint32 SplashBoats25DegUpTo60DegUpImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_NW_SE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_SE_NW, +}; + +uint32 SplashBoats25DegUpTo60DegUpFrontImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_NW_SE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_TO_60_DEG_UP_FRONT_SE_NW, +}; + +uint32 SplashBoats60DegUpTo25DegUpImageId[4] = +{ + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_SW_NE, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_NW_SE, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_NE_SW, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_SE_NW, +}; + +uint32 SplashBoats60DegUpTo25DegUpFrontImageId[4] = +{ + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_SW_NE, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_NW_SE, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_NE_SW, + SPR_SPLASH_BOATS_60_DEG_UP_TO_25_DEG_UP_FRONT_SE_NW, +}; + +uint32 SplashBoats25DegDownImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_DOWN_SW_NE, + SPR_SPLASH_BOATS_25_DEG_DOWN_NW_SE, + SPR_SPLASH_BOATS_25_DEG_DOWN_NE_SW, + SPR_SPLASH_BOATS_25_DEG_DOWN_SE_NW, +}; + +uint32 SplashBoats25DegDownFrontImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_SE_NW, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_FRONT_NW_SE, +}; + +uint32 SplashBoatsFlatTo25DegDownImageId[4] = +{ + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_SW_NE, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_NW_SE, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_NE_SW, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_DOWN_SE_NW, +}; + +uint32 SplashBoatsFlatTo25DegDownFrontImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_NE_SW, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_SE_NW, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_SW_NE, + SPR_SPLASH_BOATS_25_DEG_UP_TO_FLAT_FRONT_NW_SE, +}; + +uint32 SplashBoats25DegDownToFlatImageId[4] = +{ + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_SW_NE, + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_NW_SE, + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_NE_SW, + SPR_SPLASH_BOATS_25_DEG_DOWN_TO_FLAT_SE_NW, +}; + +uint32 SplashBoats25DegDownToFlatFrontImageId[4] = +{ + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_NE_SW, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_SE_NW, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_SW_NE, + SPR_SPLASH_BOATS_FLAT_TO_25_DEG_UP_FRONT_NW_SE, +}; + static void paint_splash_boats_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { uint32 imageId = SplashBoats25DegUpImageId[direction] | gTrackColours[SCHEME_TRACK]; @@ -182,6 +290,99 @@ static void paint_splash_boats_track_25_deg_up_to_flat(uint8 rideIndex, uint8 tr paint_util_set_general_support_height(height + 40, 0x20); } +static void paint_splash_boats_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoats25DegUpTo60DegUpImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoats25DegUpTo60DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 66, height, 0, 27, height); + + wooden_a_supports_paint_setup((direction & 1), 13 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void paint_splash_boats_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoats60DegUpTo25DegUpImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoats60DegUpTo25DegUpFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 66, height, 0, 27, height); + + wooden_a_supports_paint_setup((direction & 1), 17 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void paint_splash_boats_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoats25DegDownImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoats25DegDownFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 50, height, 0, 27, height); + + static const uint8 specialSupport[] = { 11, 12, 9, 10 }; + wooden_a_supports_paint_setup((direction & 1), specialSupport[direction], height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void paint_splash_boats_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + paint_splash_boats_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void paint_splash_boats_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoatsFlatTo25DegDownImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoatsFlatTo25DegDownFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 34, height, 0, 27, height); + + static const uint8 specialSupport[] = { 7, 8, 5, 6 }; + wooden_a_supports_paint_setup((direction & 1), specialSupport[direction], height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void paint_splash_boats_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + paint_splash_boats_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void paint_splash_boats_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + paint_splash_boats_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void paint_splash_boats_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) +{ + uint32 imageId = SplashBoats25DegDownToFlatImageId[direction] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = SplashBoats25DegDownToFlatFrontImageId[direction] | gTrackColours[SCHEME_TRACK]; + + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 42, height, 0, 27, height); + + static const uint8 specialSupport[] = { 3, 4, 1, 2 }; + wooden_a_supports_paint_setup((direction & 1), specialSupport[direction], height, gTrackColours[SCHEME_SUPPORTS], NULL); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction) { switch (trackType) { @@ -192,17 +393,23 @@ TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int di case TRACK_ELEM_FLAT_TO_25_DEG_UP: return paint_splash_boats_track_flat_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return paint_splash_boats_track_25_deg_up_to_60_deg_up; case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: - return NULL; + return paint_splash_boats_track_60_deg_up_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_FLAT: return paint_splash_boats_track_25_deg_up_to_flat; case TRACK_ELEM_25_DEG_DOWN: + return paint_splash_boats_track_25_deg_down; case TRACK_ELEM_60_DEG_DOWN: + return paint_splash_boats_track_60_deg_down; case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return paint_splash_boats_track_flat_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return paint_splash_boats_track_25_deg_down_to_60_deg_down; case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return paint_splash_boats_track_60_deg_down_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: - return NULL; + return paint_splash_boats_track_25_deg_down_to_flat; ////////////////////////////////////////////////////// // Use River Rafts From fffb4b1d7b1955c2785f432ed37ba73c5259cfde Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 20:06:28 +0100 Subject: [PATCH 6/8] Fix tunnels --- src/ride/water/splash_boats.c | 54 +++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/src/ride/water/splash_boats.c b/src/ride/water/splash_boats.c index 34b6348fdc..9150466f8e 100644 --- a/src/ride/water/splash_boats.c +++ b/src/ride/water/splash_boats.c @@ -240,7 +240,11 @@ static void paint_splash_boats_track_25_deg_up(uint8 rideIndex, uint8 trackSeque wooden_a_supports_paint_setup((direction & 1), 9 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 56, 0x20); } @@ -255,7 +259,11 @@ static void paint_splash_boats_track_60_deg_up(uint8 rideIndex, uint8 trackSeque wooden_a_supports_paint_setup((direction & 1), 21 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 104, 0x20); } @@ -270,7 +278,11 @@ static void paint_splash_boats_track_flat_to_25_deg_up(uint8 rideIndex, uint8 tr wooden_a_supports_paint_setup((direction & 1), 1 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); } @@ -285,7 +297,11 @@ static void paint_splash_boats_track_25_deg_up_to_flat(uint8 rideIndex, uint8 tr wooden_a_supports_paint_setup((direction & 1), 5 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 40, 0x20); } @@ -300,7 +316,11 @@ static void paint_splash_boats_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uin wooden_a_supports_paint_setup((direction & 1), 13 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 72, 0x20); } @@ -315,7 +335,11 @@ static void paint_splash_boats_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uin wooden_a_supports_paint_setup((direction & 1), 17 + direction, height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 72, 0x20); } @@ -331,7 +355,11 @@ static void paint_splash_boats_track_25_deg_down(uint8 rideIndex, uint8 trackSeq static const uint8 specialSupport[] = { 11, 12, 9, 10 }; wooden_a_supports_paint_setup((direction & 1), specialSupport[direction], height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 56, 0x20); } @@ -352,7 +380,11 @@ static void paint_splash_boats_track_flat_to_25_deg_down(uint8 rideIndex, uint8 static const uint8 specialSupport[] = { 7, 8, 5, 6 }; wooden_a_supports_paint_setup((direction & 1), specialSupport[direction], height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 40, 0x20); } @@ -378,7 +410,11 @@ static void paint_splash_boats_track_25_deg_down_to_flat(uint8 rideIndex, uint8 static const uint8 specialSupport[] = { 3, 4, 1, 2 }; wooden_a_supports_paint_setup((direction & 1), specialSupport[direction], height, gTrackColours[SCHEME_SUPPORTS], NULL); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); } From 25aabf6470af44b38a93a72b0d4d3c2121b0911e Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 20:06:43 +0100 Subject: [PATCH 7/8] Fix heap overflow in testpaint --- test/testpaint/intercept_2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testpaint/intercept_2.cpp b/test/testpaint/intercept_2.cpp index da48fd8ebf..e443f55f02 100644 --- a/test/testpaint/intercept_2.cpp +++ b/test/testpaint/intercept_2.cpp @@ -244,7 +244,7 @@ namespace Intercept2 if (edge.offset == 0) { sprintf(out, " 0/%X ", edge.type); } else { - utf8string offset = new utf8[3]; + utf8string offset = new utf8[16]; if (edge.offset < 0) { sprintf(offset, "%d", edge.offset); } else { From fdf12d10245cb193ca03af2cf4fa9b88d3e59432 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 24 Sep 2016 20:33:06 +0100 Subject: [PATCH 8/8] Rollback .user to develop --- openrct2.vcxproj.user | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openrct2.vcxproj.user b/openrct2.vcxproj.user index 7e3fc94612..b782b153c4 100644 --- a/openrct2.vcxproj.user +++ b/openrct2.vcxproj.user @@ -7,7 +7,8 @@ $(TargetDir)\openrct2.exe WindowsLocalDebugger $(TargetDir) - "C:\Users\Ted\Documents\OpenRCT2\save\paint_splash_boats.sv6" + + $(TargetDir)