From 89ef96b2817757950b637cc8d031a67f99d99ff3 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 19 Sep 2016 22:20:01 +0100 Subject: [PATCH 01/18] Add sub_98196C_rotated and paint_util_push_tunnel_rotated --- src/paint/paint.h | 3 +++ src/paint/paint_helpers.c | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/paint/paint.h b/src/paint/paint.h index e12b7b0891..d72d07b526 100644 --- a/src/paint/paint.h +++ b/src/paint/paint.h @@ -158,9 +158,12 @@ paint_struct * sub_98197C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint1 paint_struct * sub_98198C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); paint_struct * sub_98199C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); +paint_struct * sub_98196C_rotated(uint8 direction, uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset); paint_struct * sub_98197C_rotated(uint8 direction, uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z); paint_struct * sub_98199C_rotated(uint8 direction, uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z); +void paint_util_push_tunnel_rotated(uint8 direction, uint16 height, uint8 type); + bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y); bool paint_attach_to_previous_ps(uint32 image_id, uint16 x, uint16 y); void sub_685EBC(money32 amount, rct_string_id string_id, sint16 y, sint16 z, sint8 y_offsets[], sint16 offset_x, uint32 rotation); diff --git a/src/paint/paint_helpers.c b/src/paint/paint_helpers.c index 15ca445c54..41ddcc188b 100644 --- a/src/paint/paint_helpers.c +++ b/src/paint/paint_helpers.c @@ -15,8 +15,23 @@ #pragma endregion #include "../interface/viewport.h" +#include "../ride/track_paint.h" #include "paint.h" +paint_struct * sub_98196C_rotated( + uint8 direction, + uint32 image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + sint16 z_offset) +{ + if (direction & 1) { + return sub_98196C(image_id, x_offset, y_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, get_current_rotation()); + } else { + return sub_98196C(image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, get_current_rotation()); + } +} + paint_struct * sub_98197C_rotated( uint8 direction, uint32 image_id, @@ -46,3 +61,12 @@ paint_struct * sub_98199C_rotated( return sub_98199C(image_id, x_offset, y_offset, bound_box_length_x, bound_box_length_y, bound_box_length_z, z_offset, bound_box_offset_x, bound_box_offset_y, bound_box_offset_z, get_current_rotation()); } } + +void paint_util_push_tunnel_rotated(uint8 direction, uint16 height, uint8 type) +{ + if (direction & 1) { + paint_util_push_tunnel_right(height, type); + } else { + paint_util_push_tunnel_left(height, type); + } +} From 112c3d22d25a97687b1900969e79598016228ba5 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 12:46:15 +0100 Subject: [PATCH 02/18] Setup log flume paint function --- src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + src/ride/water/log_flume.c | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 5137645e27..86c6ee4dbc 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6264,7 +6264,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_maze, // RIDE_TYPE_MAZE get_track_paint_function_spiral_slide, // RIDE_TYPE_SPIRAL_SLIDE get_track_paint_function_go_karts, // RIDE_TYPE_GO_KARTS - 0, // RIDE_TYPE_LOG_FLUME + get_track_paint_function_log_flume, // RIDE_TYPE_LOG_FLUME get_track_paint_function_river_rapids, // RIDE_TYPE_RIVER_RAPIDS get_track_paint_function_dodgems, // RIDE_TYPE_DODGEMS get_track_paint_function_pirate_ship, // RIDE_TYPE_PIRATE_SHIP diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index cab56681ef..4c8eb48ec0 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -256,6 +256,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_chairlift(int trackType, int direc TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_go_karts(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_river_rapids(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_dodgems(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_pirate_ship(int trackType, int direction); diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 846fd9695d..c568a92ac6 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -13,3 +13,18 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../interface/viewport.h" +#include "../../paint/paint.h" +#include "../../paint/supports.h" +#include "../../world/sprite.h" +#include "../track.h" +#include "../track_paint.h" + +TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direction) +{ + switch (trackType) { + } + + return NULL; +} From 87bffec609778bb78512e92c39c6de3d5e93feaf Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 12:46:54 +0100 Subject: [PATCH 03/18] Add debug start save --- openrct2.vcxproj.user | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openrct2.vcxproj.user b/openrct2.vcxproj.user index b782b153c4..bd6c013ed1 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_log_flume.sv6" $(TargetDir) From 209ec19c8ceedbaad0e69d87ccb5a43411c0e5b3 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 13:09:30 +0100 Subject: [PATCH 04/18] Implement track flat --- src/ride/water/log_flume.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index c568a92ac6..65405e4242 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -21,9 +21,45 @@ #include "../track.h" #include "../track_paint.h" +enum { + SPR_LOG_FLUME_FLAT_SW_NE = 20996, + SPR_LOG_FLUME_FLAT_NW_SE = 20997, + SPR_LOG_FLUME_FLAT_NE_SW = 20998, + SPR_LOG_FLUME_FLAT_SE_NW = 20999, + SPR_LOG_FLUME_FLAT_FRONT_SW_NE = 21000, + SPR_LOG_FLUME_FLAT_FRONT_NW_SE = 21001, + SPR_LOG_FLUME_FLAT_FRONT_NE_SW = 21002, + SPR_LOG_FLUME_FLAT_FRONT_SE_NW = 21003, +}; + +static void paint_log_flume_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_FLAT_SW_NE, SPR_LOG_FLUME_FLAT_FRONT_SW_NE }, + { SPR_LOG_FLUME_FLAT_NW_SE, SPR_LOG_FLUME_FLAT_FRONT_NW_SE }, + { SPR_LOG_FLUME_FLAT_NE_SW, SPR_LOG_FLUME_FLAT_FRONT_NE_SW }, + { SPR_LOG_FLUME_FLAT_SE_NW, SPR_LOG_FLUME_FLAT_FRONT_SE_NW }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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, 26, height, 0, 27, height); + + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direction) { switch (trackType) { + case TRACK_ELEM_FLAT: + return paint_log_flume_track_flat; } return NULL; From 91578fa50ed631239a4c63fc3338aae741cb4e71 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 14:09:47 +0100 Subject: [PATCH 05/18] Implement station --- src/ride/water/log_flume.c | 55 +++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 65405e4242..d58a3555e1 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -32,18 +32,18 @@ enum { SPR_LOG_FLUME_FLAT_FRONT_SE_NW = 21003, }; +static const uint32 LogFlumeTrackFlatImageIds[4][2] = +{ + { SPR_LOG_FLUME_FLAT_SW_NE, SPR_LOG_FLUME_FLAT_FRONT_SW_NE }, + { SPR_LOG_FLUME_FLAT_NW_SE, SPR_LOG_FLUME_FLAT_FRONT_NW_SE }, + { SPR_LOG_FLUME_FLAT_NE_SW, SPR_LOG_FLUME_FLAT_FRONT_NE_SW }, + { SPR_LOG_FLUME_FLAT_SE_NW, SPR_LOG_FLUME_FLAT_FRONT_SE_NW }, +}; + static void paint_log_flume_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { - static const uint32 imageIds[4][2] = - { - { SPR_LOG_FLUME_FLAT_SW_NE, SPR_LOG_FLUME_FLAT_FRONT_SW_NE }, - { SPR_LOG_FLUME_FLAT_NW_SE, SPR_LOG_FLUME_FLAT_FRONT_NW_SE }, - { SPR_LOG_FLUME_FLAT_NE_SW, SPR_LOG_FLUME_FLAT_FRONT_NE_SW }, - { SPR_LOG_FLUME_FLAT_SE_NW, SPR_LOG_FLUME_FLAT_FRONT_SE_NW }, - }; - - uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; - uint32 frontImageId = imageIds[direction][1] | gTrackColours[SCHEME_TRACK]; + uint32 imageId = LogFlumeTrackFlatImageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = LogFlumeTrackFlatImageIds[direction][1] | 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, 26, height, 0, 27, height); @@ -55,11 +55,46 @@ static void paint_log_flume_track_flat(uint8 rideIndex, uint8 trackSequence, uin paint_util_set_general_support_height(height + 32, 0x20); } +static void paint_log_flume_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + rct_ride *ride = get_ride(rideIndex); + + uint32 imageId = LogFlumeTrackFlatImageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height + 3); + + if (direction & 1) { + imageId = SPR_STATION_BASE_B_NW_SE | gTrackColours[SCHEME_MISC]; + } else { + imageId = SPR_STATION_BASE_B_SW_NE | gTrackColours[SCHEME_MISC]; + } + sub_98196C(imageId, 0, 0, 32, 32, 1, height, get_current_rotation()); + + if (direction & 1) { + metal_a_supports_paint_setup(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + metal_a_supports_paint_setup(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + + track_paint_util_draw_station(rideIndex, trackSequence, direction, height + 2, mapElement); + + 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 + 32, 0x20); +} + TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direction) { switch (trackType) { case TRACK_ELEM_FLAT: return paint_log_flume_track_flat; + + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return paint_log_flume_track_station; } return NULL; From 48ebfeeb83e0c51bb9a6c10c5635471e406a604b Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 14:51:19 +0100 Subject: [PATCH 06/18] Implement on ride photo --- src/ride/track_paint.c | 37 +++++++++++++++++++++++++ src/ride/track_paint.h | 1 + src/ride/water/log_flume.c | 30 +++++++++++++++++++++ src/ride/water/river_rapids.c | 51 +---------------------------------- 4 files changed, 69 insertions(+), 50 deletions(-) diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 77303611bb..6e0d099d58 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -1260,6 +1260,43 @@ void track_paint_util_spinning_tunnel_paint(sint8 thickness, sint16 height, uint } } +void track_paint_util_onride_photo_paint(uint8 direction, sint32 height, rct_map_element *mapElement) +{ + static const uint32 imageIds[4][3] = + { + { SPR_ON_RIDE_PHOTO_SIGN_SW_NE, SPR_ON_RIDE_PHOTO_CAMERA_S, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_S }, + { SPR_ON_RIDE_PHOTO_SIGN_NW_SE, SPR_ON_RIDE_PHOTO_CAMERA_W, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_W }, + { SPR_ON_RIDE_PHOTO_SIGN_NE_SW, SPR_ON_RIDE_PHOTO_CAMERA_N, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_N }, + { SPR_ON_RIDE_PHOTO_SIGN_SE_NW, SPR_ON_RIDE_PHOTO_CAMERA_E, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_E }, + }; + + bool takingPhoto = (mapElement->properties.track.sequence & 0xF0) != 0; + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_MISC]; + uint32 flashImageId = imageIds[direction][takingPhoto ? 2 : 1] | gTrackColours[SCHEME_MISC]; + switch (direction) { + case 0: + sub_98196C(imageId, 26, 0, 1, 1, 19, height, get_current_rotation()); + sub_98196C(imageId, 26, 31, 1, 1, 19, height, get_current_rotation()); + sub_98196C(flashImageId, 6, 0, 1, 1, 19, height, get_current_rotation()); + break; + case 1: + sub_98196C(imageId, 0, 6, 1, 1, 19, height, get_current_rotation()); + sub_98196C(imageId, 31, 6, 1, 1, 19, height, get_current_rotation()); + sub_98196C(flashImageId, 0, 26, 1, 1, 19, height, get_current_rotation()); + break; + case 2: + sub_98196C(imageId, 6, 0, 1, 1, 19, height, get_current_rotation()); + sub_98196C(imageId, 6, 31, 1, 1, 19, height, get_current_rotation()); + sub_98196C(flashImageId, 26, 31, 1, 1, 19, height, get_current_rotation()); + break; + case 3: + sub_98196C(imageId, 0, 26, 1, 1, 19, height, get_current_rotation()); + sub_98196C(imageId, 31, 26, 1, 1, 19, height, get_current_rotation()); + sub_98196C(flashImageId, 31, 6, 1, 1, 19, height, get_current_rotation()); + break; + } +} + static int pick_ride_type_for_drawing(int rideType, int trackType) { if (rideType == RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER) { diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 4c8eb48ec0..384fffd8b3 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -238,6 +238,7 @@ void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 tunn 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); void track_paint_util_left_quarter_turn_1_tile_tunnel(sint16 height, uint8 direction, uint8 trackSequence); void track_paint_util_spinning_tunnel_paint(sint8 thickness, sint16 height, uint8 direction, uint8 rotation); +void track_paint_util_onride_photo_paint(uint8 direction, sint32 height, rct_map_element *mapElement); void track_paint_util_right_helix_up_small_quarter_tiles_paint(const sint8 thickness[2], sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3][2], const rct_xy16 offsets[4][3][2], const rct_xy16 boundsLengths[4][3][2], const rct_xyz16 boundsOffsets[4][3][2], uint8 rotation); void track_paint_util_right_helix_up_large_quarter_tiles_paint(const sint8 thickness[2], sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5][2], const rct_xy16 offsets[4][5][2], const rct_xy16 boundsLengths[4][5][2], const rct_xyz16 boundsOffsets[4][5][2], uint8 rotation); void track_paint_util_eighth_to_diag_tiles_paint(const sint8 thickness[4][4], sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][4], const rct_xy16 offsets[4][4], const rct_xy16 boundsLengths[4][4], const rct_xyz16 boundsOffsets[4][4], uint8 rotation); diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index d58a3555e1..71dd22a0f5 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -85,6 +85,32 @@ static void paint_log_flume_track_station(uint8 rideIndex, uint8 trackSequence, paint_util_set_general_support_height(height + 32, 0x20); } +static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId = SPR_STATION_BASE_D | 0x20000000; + sub_98196C(imageId, 0, 0, 32, 32, 1, height, get_current_rotation()); + + if (direction & 1) { + metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + metal_a_supports_paint_setup(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + + imageId = LogFlumeTrackFlatImageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 0, height, 0, 6, height + 3); + + imageId = LogFlumeTrackFlatImageIds[direction][1] | gTrackColours[SCHEME_TRACK]; + sub_98197C_rotated(direction, imageId, 0, 0, 32, 1, 21, height, 0, 27, height + 5); + + track_paint_util_onride_photo_paint(direction, height + 3, mapElement); + + 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_log_flume(int trackType, int direction) { switch (trackType) { @@ -95,6 +121,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc case TRACK_ELEM_BEGIN_STATION: case TRACK_ELEM_MIDDLE_STATION: return paint_log_flume_track_station; + + case TRACK_ELEM_ON_RIDE_PHOTO: + return paint_log_flume_track_on_ride_photo; + } return NULL; diff --git a/src/ride/water/river_rapids.c b/src/ride/water/river_rapids.c index c95eefe0f6..cd72fc4a69 100644 --- a/src/ride/water/river_rapids.c +++ b/src/ride/water/river_rapids.c @@ -693,56 +693,7 @@ static void paint_river_rapids_track_rapids(uint8 rideIndex, uint8 trackSequence static void paint_river_rapids_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { paint_river_rapids_track_flat(rideIndex, trackSequence, direction, height, mapElement); - - uint32 imageId; - - const bool takingPhoto = (bool) (mapElement->properties.track.sequence & 0xF0); - switch (direction) { - case 0: - imageId = SPR_ON_RIDE_PHOTO_SIGN_SW_NE | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 26, 0, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = SPR_ON_RIDE_PHOTO_SIGN_SW_NE | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 26, 31, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = (takingPhoto ? SPR_ON_RIDE_PHOTO_CAMERA_FLASH_S : SPR_ON_RIDE_PHOTO_CAMERA_S) | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 6, 0, 1, 1, 19, height + 13, get_current_rotation()); - break; - - case 1: - imageId = SPR_ON_RIDE_PHOTO_SIGN_NW_SE | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 0, 6, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = SPR_ON_RIDE_PHOTO_SIGN_NW_SE | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 31, 6, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = (takingPhoto ? SPR_ON_RIDE_PHOTO_CAMERA_FLASH_W : SPR_ON_RIDE_PHOTO_CAMERA_W) | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 0, 26, 1, 1, 19, height + 13, get_current_rotation()); - break; - - case 2: - imageId = SPR_ON_RIDE_PHOTO_SIGN_NE_SW | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 6, 0, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = SPR_ON_RIDE_PHOTO_SIGN_NE_SW | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 6, 31, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = (takingPhoto ? SPR_ON_RIDE_PHOTO_CAMERA_FLASH_N : SPR_ON_RIDE_PHOTO_CAMERA_N) | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 26, 31, 1, 1, 19, height + 13, get_current_rotation()); - break; - - case 3: - imageId = SPR_ON_RIDE_PHOTO_SIGN_SE_NW | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 0, 26, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = SPR_ON_RIDE_PHOTO_SIGN_SE_NW | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 31, 26, 1, 1, 19, height + 13, get_current_rotation()); - - imageId = (takingPhoto ? SPR_ON_RIDE_PHOTO_CAMERA_FLASH_E : SPR_ON_RIDE_PHOTO_CAMERA_E) | gTrackColours[SCHEME_MISC]; - sub_98196C(imageId, 31, 6, 1, 1, 19, height + 13, get_current_rotation()); - break; - } - + track_paint_util_onride_photo_paint(direction, height + 13, mapElement); paint_util_set_general_support_height(height + 48, 0x20); } From aaa4fd0e7df3be2057ebfac3374abe926dd76e87 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 14:58:13 +0100 Subject: [PATCH 07/18] Implement reverser --- src/ride/water/log_flume.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 71dd22a0f5..e19b2d3fda 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -30,6 +30,15 @@ enum { SPR_LOG_FLUME_FLAT_FRONT_NW_SE = 21001, SPR_LOG_FLUME_FLAT_FRONT_NE_SW = 21002, SPR_LOG_FLUME_FLAT_FRONT_SE_NW = 21003, + + SPR_LOG_FLUME_REVERSER_SW_NE = 21004, + SPR_LOG_FLUME_REVERSER_NW_SE = 21005, + SPR_LOG_FLUME_REVERSER_NE_SW = 21006, + SPR_LOG_FLUME_REVERSER_SE_NW = 21007, + SPR_LOG_FLUME_REVERSER_FRONT_SW_NE = 21008, + SPR_LOG_FLUME_REVERSER_FRONT_NW_SE = 21009, + SPR_LOG_FLUME_REVERSER_FRONT_NE_SW = 21010, + SPR_LOG_FLUME_REVERSER_FRONT_SE_NW = 21011, }; static const uint32 LogFlumeTrackFlatImageIds[4][2] = @@ -111,6 +120,29 @@ static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequ paint_util_set_general_support_height(height + 48, 0x20); } +static void paint_log_flume_track_reverser(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_REVERSER_SW_NE, SPR_LOG_FLUME_REVERSER_FRONT_SW_NE }, + { SPR_LOG_FLUME_REVERSER_NW_SE, SPR_LOG_FLUME_REVERSER_FRONT_NW_SE }, + { SPR_LOG_FLUME_REVERSER_NE_SW, SPR_LOG_FLUME_REVERSER_FRONT_NE_SW }, + { SPR_LOG_FLUME_REVERSER_SE_NW, SPR_LOG_FLUME_REVERSER_FRONT_SE_NW }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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, 26, height, 0, 27, height); + + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direction) { switch (trackType) { @@ -124,7 +156,8 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc case TRACK_ELEM_ON_RIDE_PHOTO: return paint_log_flume_track_on_ride_photo; - + case TRACK_ELEM_LOG_FLUME_REVERSER: + return paint_log_flume_track_reverser; } return NULL; From d960f79c3760dc52af4d9c6ed64bced5b3064687 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 15:16:24 +0100 Subject: [PATCH 08/18] Implement up tracks --- src/ride/water/log_flume.c | 112 ++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index e19b2d3fda..66a3ce98df 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -30,7 +30,6 @@ enum { SPR_LOG_FLUME_FLAT_FRONT_NW_SE = 21001, SPR_LOG_FLUME_FLAT_FRONT_NE_SW = 21002, SPR_LOG_FLUME_FLAT_FRONT_SE_NW = 21003, - SPR_LOG_FLUME_REVERSER_SW_NE = 21004, SPR_LOG_FLUME_REVERSER_NW_SE = 21005, SPR_LOG_FLUME_REVERSER_NE_SW = 21006, @@ -39,6 +38,30 @@ enum { SPR_LOG_FLUME_REVERSER_FRONT_NW_SE = 21009, SPR_LOG_FLUME_REVERSER_FRONT_NE_SW = 21010, SPR_LOG_FLUME_REVERSER_FRONT_SE_NW = 21011, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_SW_NE = 21012, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_NW_SE = 21013, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_NE_SW = 21014, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_SE_NW = 21015, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_SW_NE = 21016, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_NW_SE = 21017, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_NE_SW = 21018, + SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_SE_NW = 21019, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_SW_NE = 21020, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_NW_SE = 21021, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_NE_SW = 21022, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_SE_NW = 21023, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_SW_NE = 21024, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_NW_SE = 21025, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_NE_SW = 21026, + SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_SE_NW = 21027, + SPR_LOG_FLUME_25_DEG_UP_SW_NE = 21028, + SPR_LOG_FLUME_25_DEG_UP_NW_SE = 21029, + SPR_LOG_FLUME_25_DEG_UP_NE_SW = 21030, + SPR_LOG_FLUME_25_DEG_UP_SE_NW = 21031, + SPR_LOG_FLUME_25_DEG_UP_FRONT_SW_NE = 21032, + SPR_LOG_FLUME_25_DEG_UP_FRONT_NW_SE = 21033, + SPR_LOG_FLUME_25_DEG_UP_FRONT_NE_SW = 21034, + SPR_LOG_FLUME_25_DEG_UP_FRONT_SE_NW = 21035, }; static const uint32 LogFlumeTrackFlatImageIds[4][2] = @@ -94,6 +117,87 @@ static void paint_log_flume_track_station(uint8 rideIndex, uint8 trackSequence, paint_util_set_general_support_height(height + 32, 0x20); } +static void paint_log_flume_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_25_DEG_UP_SW_NE, SPR_LOG_FLUME_25_DEG_UP_FRONT_SW_NE }, + { SPR_LOG_FLUME_25_DEG_UP_NW_SE, SPR_LOG_FLUME_25_DEG_UP_FRONT_NW_SE }, + { SPR_LOG_FLUME_25_DEG_UP_NE_SW, SPR_LOG_FLUME_25_DEG_UP_FRONT_NE_SW }, + { SPR_LOG_FLUME_25_DEG_UP_SE_NW, SPR_LOG_FLUME_25_DEG_UP_FRONT_SE_NW }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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); + + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void paint_log_flume_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_SW_NE, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_SW_NE }, + { SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_NW_SE, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_NW_SE }, + { SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_NE_SW, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_NE_SW }, + { SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_SE_NW, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_SE_NW }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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); + + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void paint_log_flume_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_SW_NE, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_SW_NE }, + { SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_NW_SE, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_NW_SE }, + { SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_NE_SW, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_NE_SW }, + { SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_SE_NW, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_SE_NW }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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); + + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { uint32 imageId = SPR_STATION_BASE_D | 0x20000000; @@ -153,6 +257,12 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc case TRACK_ELEM_BEGIN_STATION: case TRACK_ELEM_MIDDLE_STATION: return paint_log_flume_track_station; + case TRACK_ELEM_25_DEG_UP: + return paint_log_flume_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return paint_log_flume_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return paint_log_flume_track_25_deg_up_to_flat; case TRACK_ELEM_ON_RIDE_PHOTO: return paint_log_flume_track_on_ride_photo; From f04523283cc3773f0bee7bacff9e7dffda54f5f1 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 15:32:41 +0100 Subject: [PATCH 09/18] Implement down tracks --- src/ride/water/log_flume.c | 99 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 66a3ce98df..70e263e428 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -62,6 +62,18 @@ enum { SPR_LOG_FLUME_25_DEG_UP_FRONT_NW_SE = 21033, SPR_LOG_FLUME_25_DEG_UP_FRONT_NE_SW = 21034, SPR_LOG_FLUME_25_DEG_UP_FRONT_SE_NW = 21035, + SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_NE_SW = 21036, + SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_SE_NW = 21037, + SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_SW_NE = 21038, + SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_NW_SE = 21039, + SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_NE_SW = 21040, + SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_SE_NW = 21041, + SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_SW_NE = 21042, + SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_NW_SE = 21043, + SPR_LOG_FLUME_25_DEG_DOWN_NE_SW = 21044, + SPR_LOG_FLUME_25_DEG_DOWN_SE_NW = 21045, + SPR_LOG_FLUME_25_DEG_DOWN_SW_NE = 21046, + SPR_LOG_FLUME_25_DEG_DOWN_NW_SE = 21047, }; static const uint32 LogFlumeTrackFlatImageIds[4][2] = @@ -198,6 +210,87 @@ static void paint_log_flume_track_25_deg_up_to_flat(uint8 rideIndex, uint8 track paint_util_set_general_support_height(height + 40, 0x20); } +static void paint_log_flume_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_25_DEG_DOWN_SW_NE, SPR_LOG_FLUME_25_DEG_UP_FRONT_NE_SW }, + { SPR_LOG_FLUME_25_DEG_DOWN_NW_SE, SPR_LOG_FLUME_25_DEG_UP_FRONT_SE_NW }, + { SPR_LOG_FLUME_25_DEG_DOWN_NE_SW, SPR_LOG_FLUME_25_DEG_UP_FRONT_SW_NE }, + { SPR_LOG_FLUME_25_DEG_DOWN_SE_NW, SPR_LOG_FLUME_25_DEG_UP_FRONT_NW_SE }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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); + + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void paint_log_flume_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_SW_NE, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_NE_SW }, + { SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_NW_SE, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_SE_NW }, + { SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_NE_SW, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_SW_NE }, + { SPR_LOG_FLUME_FLAT_TO_25_DEG_DOWN_SE_NW, SPR_LOG_FLUME_25_DEG_UP_TO_FLAT_FRONT_NW_SE }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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); + + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void paint_log_flume_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = + { + { SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_SW_NE, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_NE_SW }, + { SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_NW_SE, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_SE_NW }, + { SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_NE_SW, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_SW_NE }, + { SPR_LOG_FLUME_25_DEG_DOWN_TO_FLAT_SE_NW, SPR_LOG_FLUME_FLAT_TO_25_DEG_UP_FRONT_NW_SE }, + }; + + uint32 imageId = imageIds[direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][1] | 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); + + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { uint32 imageId = SPR_STATION_BASE_D | 0x20000000; @@ -263,6 +356,12 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc return paint_log_flume_track_flat_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_FLAT: return paint_log_flume_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return paint_log_flume_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return paint_log_flume_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return paint_log_flume_track_25_deg_down_to_flat; case TRACK_ELEM_ON_RIDE_PHOTO: return paint_log_flume_track_on_ride_photo; From 1c371a7edd8613cce43c54bf1f83228bda6ee4e9 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 25 Sep 2016 17:08:20 +0100 Subject: [PATCH 10/18] Implement S bend left --- src/ride/water/log_flume.c | 123 +++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 70e263e428..8015b4368e 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -74,6 +74,55 @@ enum { SPR_LOG_FLUME_25_DEG_DOWN_SE_NW = 21045, SPR_LOG_FLUME_25_DEG_DOWN_SW_NE = 21046, SPR_LOG_FLUME_25_DEG_DOWN_NW_SE = 21047, + + SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_0 = 21116, + SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_1 = 21117, + SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_2 = 21118, + SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_3 = 21119, + SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_0 = 21120, + SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_1 = 21121, + SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_2 = 21122, + SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_3 = 21123, + SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_0 = 21124, + SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_1 = 21125, + SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_2 = 21126, + SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_3 = 21127, + SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_0 = 21128, + SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_1 = 21129, + SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_2 = 21130, + SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_3 = 21131, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_0 = 20964, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_1 = 20965, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_2 = 20966, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_3 = 20967, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_0 = 20968, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_1 = 20969, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_2 = 20970, + SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_3 = 20971, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_0 = 20972, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_1 = 20973, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_2 = 20974, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_3 = 20975, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_0 = 20976, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_1 = 20977, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_2 = 20978, + SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_3 = 20979, + SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_3 = 20980, + SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_2 = 20981, + SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_1 = 20982, + SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_0 = 20983, + SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_3 = 20984, + SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_2 = 20985, + SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_1 = 20986, + SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_0 = 20987, + SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_3 = 20988, + SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_2 = 20989, + SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_1 = 20990, + SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_0 = 20991, + SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_3 = 20992, + SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_2 = 20993, + SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_1 = 20994, + SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_0 = 20995, }; static const uint32 LogFlumeTrackFlatImageIds[4][2] = @@ -291,6 +340,78 @@ static void paint_log_flume_track_25_deg_down_to_flat(uint8 rideIndex, uint8 tra paint_util_set_general_support_height(height + 48, 0x20); } +static void paint_log_flume_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][4][2] = + { + { { 21116, 21100 }, + { 21088, 21104 }, + { 21087, 21103 }, + { 21123, 21107 } }, + { { 21117, 21101 }, + { 21089, 21105 }, + { 21086, 21102 }, + { 21122, 21106 } }, + { { 21118, 21102 }, + { 21090, 21106 }, + { 21085, 21101 }, + { 21121, 21105 } }, + { { 21119, 21103 }, + { 21091, 21107 }, + { 21084, 21100 }, + { 21120, 21104 } }, + }; + + uint32 imageId = imageIds[trackSequence][direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[trackSequence][direction][1] | gTrackColours[SCHEME_TRACK]; + sint16 bboy; + + switch (trackSequence) { + case 0: + sub_98197C_rotated(direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + break; + case 1: + bboy = (direction == 0 || direction == 1) ? 0 : 6; + sub_98197C_rotated(direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); + if (direction == 0 || direction == 1) { + metal_a_supports_paint_setup(3, 5 + (direction & 1), (direction & 1), height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + break; + case 2: + bboy = (direction == 2 || direction == 3) ? 0 : 6; + sub_98197C_rotated(direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); + if (direction == 2 || direction == 3) { + metal_a_supports_paint_setup(3, 5 + (direction & 1), (direction & 1), height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + break; + case 3: + sub_98197C_rotated(direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + break; + } + + if (trackSequence == 0) { + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + } else if (trackSequence == 3) { + if (direction == 1 || direction == 2) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + } + + paint_util_set_general_support_height(height + 32, 0x20); +} + static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { uint32 imageId = SPR_STATION_BASE_D | 0x20000000; @@ -362,6 +483,8 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc return paint_log_flume_track_flat_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: return paint_log_flume_track_25_deg_down_to_flat; + case TRACK_ELEM_S_BEND_LEFT: + return paint_log_flume_track_s_bend_left; case TRACK_ELEM_ON_RIDE_PHOTO: return paint_log_flume_track_on_ride_photo; From 417d4a94cacfebfd1e15d0004162efb748de2be5 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 26 Sep 2016 23:26:20 +0100 Subject: [PATCH 11/18] Implement S bend right --- src/ride/water/log_flume.c | 74 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 8015b4368e..d19651b89b 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -412,6 +412,78 @@ static void paint_log_flume_track_s_bend_left(uint8 rideIndex, uint8 trackSequen paint_util_set_general_support_height(height + 32, 0x20); } +static void paint_log_flume_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][4][2] = + { + { { 21124, 21108 }, + { 21096, 21112 }, + { 21095, 21111 }, + { 21131, 21115 } }, + { { 21125, 21109 }, + { 21097, 21113 }, + { 21094, 21110 }, + { 21130, 21114 } }, + { { 21126, 21110 }, + { 21098, 21114 }, + { 21093, 21109 }, + { 21129, 21113 } }, + { { 21127, 21111 }, + { 21099, 21115 }, + { 21092, 21108 }, + { 21128, 21112 } }, + }; + + uint32 imageId = imageIds[trackSequence][direction][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[trackSequence][direction][1] | gTrackColours[SCHEME_TRACK]; + sint16 bboy; + + switch (trackSequence) { + case 0: + sub_98197C_rotated(direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + break; + case 1: + bboy = (direction == 2 || direction == 3) ? 0 : 6; + sub_98197C_rotated(direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); + if (direction == 0 || direction == 1) { + metal_a_supports_paint_setup(3, 8 - (direction & 1), 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + break; + case 2: + bboy = (direction == 0 || direction == 1) ? 0 : 6; + sub_98197C_rotated(direction, imageId, 0, 0, 32, 26, 2, height, 0, bboy, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 26, 0, height, 0, bboy, height + 27); + if (direction == 2 || direction == 3) { + metal_a_supports_paint_setup(3, 8 - (direction & 1), 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + break; + case 3: + sub_98197C_rotated(direction, imageId, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + break; + } + + if (trackSequence == 0) { + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + } else if (trackSequence == 3) { + if (direction == 1 || direction == 2) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + } + + paint_util_set_general_support_height(height + 32, 0x20); +} + static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { uint32 imageId = SPR_STATION_BASE_D | 0x20000000; @@ -485,6 +557,8 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc return paint_log_flume_track_25_deg_down_to_flat; case TRACK_ELEM_S_BEND_LEFT: return paint_log_flume_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return paint_log_flume_track_s_bend_right; case TRACK_ELEM_ON_RIDE_PHOTO: return paint_log_flume_track_on_ride_photo; From a15b721d890bca232b9fce6abf679e64d1320627 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Sep 2016 00:32:56 +0100 Subject: [PATCH 12/18] Implement left quarter turn 3 --- src/ride/track_paint.c | 46 +++++++++++++++++++++++++---------- src/ride/track_paint.h | 1 + src/ride/water/log_flume.c | 49 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 12 deletions(-) diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 6e0d099d58..214c48f9dc 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -1141,6 +1141,11 @@ void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 dir 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) +{ + track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset(thickness, height, direction, trackSequence, colourFlags, sprites, rotation, 0); +} + +void track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation, sint32 heightOffset) { sint8 sprite = left_quarter_turn_3_tiles_sprite_map[trackSequence]; if (sprite < 0) { @@ -1152,38 +1157,55 @@ void track_paint_util_left_quarter_turn_3_tiles_paint(sint8 thickness, sint16 he 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, 16, 16, thickness, height, 16, 0, height, rotation); break; - case 3: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height, rotation); break; + case 0: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 16, 0, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, 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, 16, thickness, height, 0, 0, height, rotation); break; - case 3: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height, rotation); break; + case 0: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 0, 0, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, 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, 16, 16, thickness, height, 0, 16, height, rotation); break; - case 3: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height, rotation); break; + case 0: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 0, 16, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, 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, 16, thickness, height, 16, 16, height, rotation); break; - case 3: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height, rotation); break; + case 0: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 16, 16, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, rotation); break; } break; } } +// void track_paint_util_left_quarter_turn_3_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, +// (sint8)spriteBB->offset.x, (sint8)spriteBB->offset.y, +// spriteBB->bb_size.x, spriteBB->bb_size.y, (sint8)spriteBB->bb_size.z, +// height + spriteBB->offset.z, +// spriteBB->bb_offset.x, spriteBB->bb_offset.y, height + spriteBB->bb_offset.z, +// rotation); +// } + void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 tunnelType, uint8 direction, uint8 trackSequence) { if (direction == 0 && trackSequence == 0) { diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 384fffd8b3..cee18179d9 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -234,6 +234,7 @@ void track_paint_util_right_quarter_turn_5_tiles_paint_2(sint16 height, int dire 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_xyz16 boundsOffsets[4][3], uint8 rotation); 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_paint_with_height_offset(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation, sint32 heightOffset); void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 tunnelType, 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); void track_paint_util_left_quarter_turn_1_tile_tunnel(sint16 height, uint8 direction, uint8 trackSequence); diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index d19651b89b..5e27f6754d 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -484,6 +484,53 @@ static void paint_log_flume_track_s_bend_right(uint8 rideIndex, uint8 trackSeque paint_util_set_general_support_height(height + 32, 0x20); } +static void paint_log_flume_track_left_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = + { + { 21072, 21073, 21074 }, + { 21075, 21076, 21077 }, + { 21078, 21079, 21080 }, + { 21081, 21082, 21083 } + }; + + static const uint32 imageIdsFront[4][3] = + { + { 21060, 21061, 21062 }, + { 21063, 21064, 21065 }, + { 21066, 21067, 21068 }, + { 21069, 21070, 21071 } + }; + + track_paint_util_left_quarter_turn_3_tiles_paint(2, height, direction, trackSequence, gTrackColours[SCHEME_TRACK], imageIds, get_current_rotation()); + track_paint_util_left_quarter_turn_3_tiles_paint_with_height_offset(0, height, direction, trackSequence, gTrackColours[SCHEME_TRACK], imageIdsFront, get_current_rotation(), 27); + + if (trackSequence != 1 && trackSequence != 2) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + + switch (trackSequence) { + case 0: + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + break; + case 3: + if (direction == 2 || direction == 3) { + paint_util_push_tunnel_rotated(direction ^ 1, height, TUNNEL_0); + } + break; + } + + switch (trackSequence) { + case 0: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; + case 2: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); break; + case 3: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); break; + } + + paint_util_set_general_support_height(height + 32, 0x20); +} + static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { uint32 imageId = SPR_STATION_BASE_D | 0x20000000; @@ -559,6 +606,8 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc return paint_log_flume_track_s_bend_left; case TRACK_ELEM_S_BEND_RIGHT: return paint_log_flume_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return paint_log_flume_track_left_quarter_turn_3_tiles; case TRACK_ELEM_ON_RIDE_PHOTO: return paint_log_flume_track_on_ride_photo; From 34ada367d500d30331ac3b6b54f8baa6c07896da Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Sep 2016 18:03:34 +0100 Subject: [PATCH 13/18] Implement right quarter turn 3 --- src/ride/track_paint.c | 49 +++++++++++++++++++++++++++++++++++++ src/ride/track_paint.h | 2 ++ src/ride/water/log_flume.c | 50 +++++++++++++++++++++++++++++++++++++- 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 214c48f9dc..4341011a57 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -1117,6 +1117,55 @@ 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 + boundsOffset.z, rotation); } +void track_paint_util_right_quarter_turn_3_tiles_paint_2(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation) +{ + track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset(thickness, height, direction, trackSequence, colourFlags, sprites, rotation, 0); +} + +void track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation, sint32 heightOffset) +{ + sint8 sprite = right_quarter_turn_3_tiles_sprite_map[trackSequence]; + if (sprite < 0) { + return; + } + + uint32 imageId = sprites[(direction + 1) % 4][sprite] | colourFlags; + + switch (direction) { + case 0: + switch (trackSequence) { + case 0: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 16, 16, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, rotation); break; + } + break; + + case 1: + switch (trackSequence) { + case 0: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 16, 0, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, rotation); break; + } + break; + + case 2: + switch (trackSequence) { + case 0: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 0, 0, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, rotation); break; + } + break; + + case 3: + switch (trackSequence) { + case 0: sub_98197C(imageId, 0, 0, 20, 32, thickness, height, 6, 0, height + heightOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 16, 16, thickness, height, 0, 16, height + heightOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 32, 20, thickness, height, 0, 6, height + heightOffset, rotation); break; + } + break; + } +} + void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType) { if (direction == 0 && trackSequence == 0) { diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index cee18179d9..2745d30dcc 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -232,6 +232,8 @@ void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definit 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_xyz16 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_xyz16 boundsOffsets[4][3], uint8 rotation); +void track_paint_util_right_quarter_turn_3_tiles_paint_2(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation); +void track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation, sint32 heightOffset); 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_paint_with_height_offset(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation, sint32 heightOffset); diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 5e27f6754d..f9c9904a40 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -531,6 +531,53 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles(uint8 rideIndex, uin paint_util_set_general_support_height(height + 32, 0x20); } +static void paint_log_flume_track_right_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = + { + { 21057, 21058, 21059 }, + { 21048, 21049, 21050 }, + { 21051, 21052, 21053 }, + { 21054, 21055, 21056 } + }; + + static const uint32 imageIdsFront[4][3] = + { + { 21069, 21070, 21071 }, + { 21060, 21061, 21062 }, + { 21063, 21064, 21065 }, + { 21066, 21067, 21068 } + }; + + track_paint_util_right_quarter_turn_3_tiles_paint_2(2, height, direction, trackSequence, gTrackColours[SCHEME_TRACK], imageIds, get_current_rotation()); + track_paint_util_right_quarter_turn_3_tiles_paint_2_with_height_offset(0, height, direction, trackSequence, gTrackColours[SCHEME_TRACK], imageIdsFront, get_current_rotation(), 27); + + if (trackSequence != 1 && trackSequence != 2) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + + switch (trackSequence) { + case 0: + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + break; + case 3: + if (direction == 0 || direction == 1) { + paint_util_push_tunnel_rotated(direction ^ 1, height, TUNNEL_0); + } + break; + } + + switch (trackSequence) { + case 0: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); break; + case 2: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); break; + case 3: paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); break; + } + + paint_util_set_general_support_height(height + 32, 0x20); +} + static void paint_log_flume_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { uint32 imageId = SPR_STATION_BASE_D | 0x20000000; @@ -608,7 +655,8 @@ TRACK_PAINT_FUNCTION get_track_paint_function_log_flume(int trackType, int direc return paint_log_flume_track_s_bend_right; case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: return paint_log_flume_track_left_quarter_turn_3_tiles; - + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return paint_log_flume_track_right_quarter_turn_3_tiles; case TRACK_ELEM_ON_RIDE_PHOTO: return paint_log_flume_track_on_ride_photo; case TRACK_ELEM_LOG_FLUME_REVERSER: From a9cd816eb673bacc30b0ebd7002ef65861e40602 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Sep 2016 19:55:11 +0100 Subject: [PATCH 14/18] Define sprite IDs for 3 turn --- src/ride/water/log_flume.c | 117 +++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 65 deletions(-) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index f9c9904a40..62a1c79334 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -74,55 +74,42 @@ enum { SPR_LOG_FLUME_25_DEG_DOWN_SE_NW = 21045, SPR_LOG_FLUME_25_DEG_DOWN_SW_NE = 21046, SPR_LOG_FLUME_25_DEG_DOWN_NW_SE = 21047, - - SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_0 = 21116, - SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_1 = 21117, - SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_2 = 21118, - SPR_LOG_FLUME_S_BEND_LEFT_SW_NW_NE_SEQ_3 = 21119, - SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_0 = 21120, - SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_1 = 21121, - SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_2 = 21122, - SPR_LOG_FLUME_S_BEND_LEFT_NW_NE_SE_SEQ_3 = 21123, - SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_0 = 21124, - SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_1 = 21125, - SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_2 = 21126, - SPR_LOG_FLUME_S_BEND_LEFT_SW_SE_NE_SEQ_3 = 21127, - SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_0 = 21128, - SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_1 = 21129, - SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_2 = 21130, - SPR_LOG_FLUME_S_BEND_LEFT_NW_SW_SE_SEQ_3 = 21131, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_0 = 20964, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_1 = 20965, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_2 = 20966, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_SW_NE_SEQ_3 = 20967, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_0 = 20968, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_1 = 20969, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_2 = 20970, - SPR_LOG_FLUME_S_BEND_LEFT_FRONT_NW_SE_SEQ_3 = 20971, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_0 = 20972, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_1 = 20973, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_2 = 20974, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_SW_NE_SEQ_3 = 20975, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_0 = 20976, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_1 = 20977, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_2 = 20978, - SPR_LOG_FLUME_S_BEND_RIGHT_FRONT_NW_SE_SEQ_3 = 20979, - SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_3 = 20980, - SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_2 = 20981, - SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_1 = 20982, - SPR_LOG_FLUME_S_BEND_LEFT_NE_SE_SW_SEQ_0 = 20983, - SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_3 = 20984, - SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_2 = 20985, - SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_1 = 20986, - SPR_LOG_FLUME_S_BEND_LEFT_SE_SW_NW_SEQ_0 = 20987, - SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_3 = 20988, - SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_2 = 20989, - SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_1 = 20990, - SPR_LOG_FLUME_S_BEND_LEFT_NE_NW_SW_SEQ_0 = 20991, - SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_3 = 20992, - SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_2 = 20993, - SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_1 = 20994, - SPR_LOG_FLUME_S_BEND_LEFT_SE_NE_NW_SEQ_0 = 20995, + SPR_LOG_FLUME_3_TURN_NE_SE_SEQ_0 = 21048, + SPR_LOG_FLUME_3_TURN_NE_SE_SEQ_2 = 21049, + SPR_LOG_FLUME_3_TURN_NE_SE_SEQ_3 = 21050, + SPR_LOG_FLUME_3_TURN_SE_SW_SEQ_0 = 21051, + SPR_LOG_FLUME_3_TURN_SE_SW_SEQ_2 = 21052, + SPR_LOG_FLUME_3_TURN_SE_SW_SEQ_3 = 21053, + SPR_LOG_FLUME_3_TURN_SW_NW_SEQ_0 = 21054, + SPR_LOG_FLUME_3_TURN_SW_NW_SEQ_2 = 21055, + SPR_LOG_FLUME_3_TURN_SW_NW_SEQ_3 = 21056, + SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_0 = 21057, + SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_2 = 21058, + SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_3 = 21059, + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_0 = 21060, + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_2 = 21061, + SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_3 = 21062, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_0 = 21063, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_2 = 21064, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_3 = 21065, + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_0 = 21066, + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_2 = 21067, + SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_3 = 21068, + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_0 = 21069, + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_2 = 21070, + SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_3 = 21071, + SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_0 = 21072, + SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_2 = 21073, + SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_3 = 21074, + SPR_LOG_FLUME_3_TURN_NE_NW_SEQ_0 = 21075, + SPR_LOG_FLUME_3_TURN_NE_NW_SEQ_2 = 21076, + SPR_LOG_FLUME_3_TURN_NE_NW_SEQ_3 = 21077, + SPR_LOG_FLUME_3_TURN_SE_NE_SEQ_0 = 21078, + SPR_LOG_FLUME_3_TURN_SE_NE_SEQ_2 = 21079, + SPR_LOG_FLUME_3_TURN_SE_NE_SEQ_3 = 21080, + SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_0 = 21081, + SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_2 = 21082, + SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_3 = 21083, }; static const uint32 LogFlumeTrackFlatImageIds[4][2] = @@ -488,18 +475,18 @@ static void paint_log_flume_track_left_quarter_turn_3_tiles(uint8 rideIndex, uin { static const uint32 imageIds[4][3] = { - { 21072, 21073, 21074 }, - { 21075, 21076, 21077 }, - { 21078, 21079, 21080 }, - { 21081, 21082, 21083 } + { SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_NW_SW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_NE_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_NE_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_NE_NW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SE_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_SE_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_SE_NE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_3 }, }; static const uint32 imageIdsFront[4][3] = { - { 21060, 21061, 21062 }, - { 21063, 21064, 21065 }, - { 21066, 21067, 21068 }, - { 21069, 21070, 21071 } + { SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_3 }, }; track_paint_util_left_quarter_turn_3_tiles_paint(2, height, direction, trackSequence, gTrackColours[SCHEME_TRACK], imageIds, get_current_rotation()); @@ -535,18 +522,18 @@ static void paint_log_flume_track_right_quarter_turn_3_tiles(uint8 rideIndex, ui { static const uint32 imageIds[4][3] = { - { 21057, 21058, 21059 }, - { 21048, 21049, 21050 }, - { 21051, 21052, 21053 }, - { 21054, 21055, 21056 } + { SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_NW_NE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_NE_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_NE_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_NE_SE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_SE_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_SE_SW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_SW_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_SW_NW_SEQ_3 } }; static const uint32 imageIdsFront[4][3] = { - { 21069, 21070, 21071 }, - { 21060, 21061, 21062 }, - { 21063, 21064, 21065 }, - { 21066, 21067, 21068 } + { SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_NE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SW_SE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SW_NW_SEQ_3 }, }; track_paint_util_right_quarter_turn_3_tiles_paint_2(2, height, direction, trackSequence, gTrackColours[SCHEME_TRACK], imageIds, get_current_rotation()); From ce03db20f91bfce26cd0453821953f98f5e7fac5 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Sep 2016 20:02:55 +0100 Subject: [PATCH 15/18] Inverse s bend image arrays --- src/ride/water/log_flume.c | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 62a1c79334..cd5976274f 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -332,25 +332,25 @@ static void paint_log_flume_track_s_bend_left(uint8 rideIndex, uint8 trackSequen static const uint32 imageIds[4][4][2] = { { { 21116, 21100 }, - { 21088, 21104 }, - { 21087, 21103 }, - { 21123, 21107 } }, - { { 21117, 21101 }, + { 21117, 21101 }, + { 21118, 21102 }, + { 21119, 21103 } }, + { { 21088, 21104 }, { 21089, 21105 }, - { 21086, 21102 }, - { 21122, 21106 } }, - { { 21118, 21102 }, { 21090, 21106 }, + { 21091, 21107 } }, + { { 21087, 21103 }, + { 21086, 21102 }, { 21085, 21101 }, - { 21121, 21105 } }, - { { 21119, 21103 }, - { 21091, 21107 }, - { 21084, 21100 }, + { 21084, 21100 } }, + { { 21123, 21107 }, + { 21122, 21106 }, + { 21121, 21105 }, { 21120, 21104 } }, }; - uint32 imageId = imageIds[trackSequence][direction][0] | gTrackColours[SCHEME_TRACK]; - uint32 frontImageId = imageIds[trackSequence][direction][1] | gTrackColours[SCHEME_TRACK]; + uint32 imageId = imageIds[direction][trackSequence][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][trackSequence][1] | gTrackColours[SCHEME_TRACK]; sint16 bboy; switch (trackSequence) { @@ -404,25 +404,25 @@ static void paint_log_flume_track_s_bend_right(uint8 rideIndex, uint8 trackSeque static const uint32 imageIds[4][4][2] = { { { 21124, 21108 }, - { 21096, 21112 }, - { 21095, 21111 }, - { 21131, 21115 } }, - { { 21125, 21109 }, + { 21125, 21109 }, + { 21126, 21110 }, + { 21127, 21111 } }, + { { 21096, 21112 }, { 21097, 21113 }, - { 21094, 21110 }, - { 21130, 21114 } }, - { { 21126, 21110 }, { 21098, 21114 }, + { 21099, 21115 } }, + { { 21095, 21111 }, + { 21094, 21110 }, { 21093, 21109 }, - { 21129, 21113 } }, - { { 21127, 21111 }, - { 21099, 21115 }, - { 21092, 21108 }, + { 21092, 21108 } }, + { { 21131, 21115 }, + { 21130, 21114 }, + { 21129, 21113 }, { 21128, 21112 } }, }; - uint32 imageId = imageIds[trackSequence][direction][0] | gTrackColours[SCHEME_TRACK]; - uint32 frontImageId = imageIds[trackSequence][direction][1] | gTrackColours[SCHEME_TRACK]; + uint32 imageId = imageIds[direction][trackSequence][0] | gTrackColours[SCHEME_TRACK]; + uint32 frontImageId = imageIds[direction][trackSequence][1] | gTrackColours[SCHEME_TRACK]; sint16 bboy; switch (trackSequence) { From b22d2d43f253508e0166b99b36dfbe54132c8231 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Sep 2016 20:23:59 +0100 Subject: [PATCH 16/18] Define sprite IDs for s bend --- src/ride/water/log_flume.c | 112 ++++++++++++++++++++++++++----------- 1 file changed, 80 insertions(+), 32 deletions(-) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index cd5976274f..811832d44b 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -110,6 +110,54 @@ enum { SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_0 = 21081, SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_2 = 21082, SPR_LOG_FLUME_3_TURN_SW_SE_SEQ_3 = 21083, + SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_3 = 21084, + SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_2 = 21085, + SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_1 = 21086, + SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_0 = 21087, + SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_0 = 21088, + SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_1 = 21089, + SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_2 = 21090, + SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_3 = 21091, + SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_3 = 21092, + SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_2 = 21093, + SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_1 = 21094, + SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_0 = 21095, + SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_0 = 21096, + SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_1 = 21097, + SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_2 = 21098, + SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_3 = 21099, + SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 = 21100, + SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_1 = 21101, + SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_2 = 21102, + SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_3 = 21103, + SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_0 = 21104, + SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_1 = 21105, + SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_2 = 21106, + SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_3 = 21107, + SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 = 21108, + SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_1 = 21109, + SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_2 = 21110, + SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_3 = 21111, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_0 = 21112, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_1 = 21113, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_2 = 21114, + SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_3 = 21115, + SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_0 = 21116, + SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_1 = 21117, + SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_2 = 21118, + SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_3 = 21119, + SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_3 = 21120, + SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_2 = 21121, + SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_1 = 21122, + SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_0 = 21123, + SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_0 = 21124, + SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_1 = 21125, + SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_2 = 21126, + SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_3 = 21127, + SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_3 = 21128, + SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_2 = 21129, + SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_1 = 21130, + SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_0 = 21131, }; static const uint32 LogFlumeTrackFlatImageIds[4][2] = @@ -331,22 +379,22 @@ static void paint_log_flume_track_s_bend_left(uint8 rideIndex, uint8 trackSequen { static const uint32 imageIds[4][4][2] = { - { { 21116, 21100 }, - { 21117, 21101 }, - { 21118, 21102 }, - { 21119, 21103 } }, - { { 21088, 21104 }, - { 21089, 21105 }, - { 21090, 21106 }, - { 21091, 21107 } }, - { { 21087, 21103 }, - { 21086, 21102 }, - { 21085, 21101 }, - { 21084, 21100 } }, - { { 21123, 21107 }, - { 21122, 21106 }, - { 21121, 21105 }, - { 21120, 21104 } }, + { { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NE_NW_NE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_3 } }, + { { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NW_SW_NW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_3 } }, + { { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SW_SE_SW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_NW_NE_SEQ_0 } }, + { { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SE_NE_SE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NW_SW_NW_SEQ_0 } }, }; uint32 imageId = imageIds[direction][trackSequence][0] | gTrackColours[SCHEME_TRACK]; @@ -403,22 +451,22 @@ static void paint_log_flume_track_s_bend_right(uint8 rideIndex, uint8 trackSeque { static const uint32 imageIds[4][4][2] = { - { { 21124, 21108 }, - { 21125, 21109 }, - { 21126, 21110 }, - { 21127, 21111 } }, - { { 21096, 21112 }, - { 21097, 21113 }, - { 21098, 21114 }, - { 21099, 21115 } }, - { { 21095, 21111 }, - { 21094, 21110 }, - { 21093, 21109 }, - { 21092, 21108 } }, - { { 21131, 21115 }, - { 21130, 21114 }, - { 21129, 21113 }, - { 21128, 21112 } }, + { { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NE_SE_NE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_3 } }, + { { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_0 }, + { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SE_SW_SE_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_3 } }, + { { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_SW_NW_SW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_NE_SE_NE_SEQ_0 } }, + { { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_0, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_3 }, + { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_1, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_2 }, + { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_2, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_1 }, + { SPR_LOG_FLUME_3_TURN_NW_NE_NW_SEQ_3, SPR_LOG_FLUME_3_TURN_FRONT_SE_SW_SE_SEQ_0 } }, }; uint32 imageId = imageIds[direction][trackSequence][0] | gTrackColours[SCHEME_TRACK]; From 16124f6d33ea12c2b61645f4718f6b6d97c41756 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Sep 2016 20:29:01 +0100 Subject: [PATCH 17/18] Only draw supports on even squares --- src/ride/water/log_flume.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/ride/water/log_flume.c b/src/ride/water/log_flume.c index 811832d44b..7576999559 100644 --- a/src/ride/water/log_flume.c +++ b/src/ride/water/log_flume.c @@ -176,7 +176,9 @@ static void paint_log_flume_track_flat(uint8 rideIndex, uint8 trackSequence, uin sub_98197C_rotated(direction, imageId, 0, 0, 32, 20, 2, height, 0, 6, height); sub_98197C_rotated(direction, frontImageId, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); @@ -229,7 +231,9 @@ static void paint_log_flume_track_25_deg_up(uint8 rideIndex, uint8 trackSequence 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); - metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); @@ -256,7 +260,9 @@ static void paint_log_flume_track_flat_to_25_deg_up(uint8 rideIndex, uint8 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); - metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); @@ -283,7 +289,9 @@ static void paint_log_flume_track_25_deg_up_to_flat(uint8 rideIndex, uint8 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); - metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); @@ -310,7 +318,9 @@ static void paint_log_flume_track_25_deg_down(uint8 rideIndex, uint8 trackSequen 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); - metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); @@ -337,7 +347,9 @@ static void paint_log_flume_track_flat_to_25_deg_down(uint8 rideIndex, uint8 tra 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); - metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); @@ -364,7 +376,9 @@ static void paint_log_flume_track_25_deg_down_to_flat(uint8 rideIndex, uint8 tra 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); - metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } if (direction == 0 || direction == 3) { paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); From 06ef63744faf2c74dec03efe67db6b06fd8b7401 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 27 Sep 2016 20:30:32 +0100 Subject: [PATCH 18/18] 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 bd6c013ed1..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_log_flume.sv6" + + $(TargetDir)