diff --git a/src/paint/map_element/map_element.h b/src/paint/map_element/map_element.h index 58503db004..f13864f689 100644 --- a/src/paint/map_element/map_element.h +++ b/src/paint/map_element/map_element.h @@ -56,6 +56,7 @@ enum TUNNEL_6 = 6, TUNNEL_7 = 7, TUNNEL_8 = 8, + TUNNEL_10 = 0x0A, TUNNEL_12 = 0x0C, TUNNEL_14 = 0x0E }; diff --git a/src/ride/gentle/mini_golf.c b/src/ride/gentle/mini_golf.c index 846fd9695d..67f47b097e 100644 --- a/src/ride/gentle/mini_golf.c +++ b/src/ride/gentle/mini_golf.c @@ -13,3 +13,1007 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../config.h" +#include "../../interface/viewport.h" +#include "../../paint/paint.h" +#include "../../paint/supports.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" +#include "../../world/map.h" + +enum { + SPR_MINI_GOLF_FLAT_SW_NE = 14404, + SPR_MINI_GOLF_FLAT_NW_SE = 14405, + SPR_MINI_GOLF_FLAT_FENCE_BACK_SW_NE = 14406, + SPR_MINI_GOLF_FLAT_FENCE_BACK_NW_SE = 14407, + SPR_MINI_GOLF_FLAT_FENCE_FRONT_SW_NE = 14408, + SPR_MINI_GOLF_FLAT_FENCE_FRONT_NW_SE = 14409, + SPR_MINI_GOLF_STATION_FLOOR = 14410, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_SW_NW = 14411, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_NW_NE = 14412, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_NE_SE = 14413, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_SE_SW = 14414, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_SW_NW = 14415, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_NW_NE = 14416, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_NE_SE = 14417, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_SE_SW = 14418, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_SW_NW = 14419, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_NW_NE = 14420, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_NE_SE = 14421, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_SE_SW = 14422, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_INSIDE_SW_NW = 14423, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_INSIDE_NE_SE = 14424, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_SW_NE = 14425, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_NW_SE = 14426, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_NE_SW = 14427, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_SE_NW = 14428, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_SW_NE = 14429, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_NW_SE = 14430, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_NE_SW = 14431, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_SE_NW = 14432, + SPR_MINI_GOLF_25_DEG_UP_SW_NE = 14433, + SPR_MINI_GOLF_25_DEG_UP_NW_SE = 14434, + SPR_MINI_GOLF_25_DEG_UP_NE_SW = 14435, + SPR_MINI_GOLF_25_DEG_UP_SE_NW = 14436, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_SW_NE = 14437, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_NW_SE = 14438, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_NE_SW = 14439, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_SE_NW = 14440, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_SW_NE = 14441, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_NW_SE = 14442, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_NE_SW = 14443, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_SE_NW = 14444, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_SW_NE = 14445, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_NW_SE = 14446, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_NE_SW = 14447, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_SE_NW = 14448, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_SW_NE = 14449, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_NW_SE = 14450, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_NE_SW = 14451, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_SE_NW = 14452, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_SW_NE = 14453, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_NW_SE = 14454, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_NE_SW = 14455, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_SE_NW = 14456, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_SW_NE = 14457, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_NW_SE = 14458, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_NE_SW = 14459, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_SE_NW = 14460, + + SPR_MINI_GOLF_HOLE_A_BASE_PART_1_SW_NE = 14461, + SPR_MINI_GOLF_HOLE_A_BASE_PART_2_SW_NE = 14462, + SPR_MINI_GOLF_HOLE_A_BASE_PART_1_NW_SE = 14463, + SPR_MINI_GOLF_HOLE_A_BASE_PART_2_NW_SE = 14464, + SPR_MINI_GOLF_HOLE_A_BASE_PART_1_NE_SW = 14465, + SPR_MINI_GOLF_HOLE_A_BASE_PART_2_NE_SW = 14466, + SPR_MINI_GOLF_HOLE_A_BASE_PART_1_SE_NW = 14467, + SPR_MINI_GOLF_HOLE_A_BASE_PART_2_SE_NW = 14468, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_SW_NE = 14469, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_SW_NE = 14470, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_NW_SE = 14471, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_NW_SE = 14472, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_NE_SW = 14473, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_NE_SW = 14474, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_SE_NW = 14475, + SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_SE_NW = 14476, + + SPR_MINI_GOLF_HOLE_B_BASE_PART_1_SW_NE = 14477, + SPR_MINI_GOLF_HOLE_B_BASE_PART_2_SW_NE = 14478, + SPR_MINI_GOLF_HOLE_B_BASE_PART_1_NW_SE = 14479, + SPR_MINI_GOLF_HOLE_B_BASE_PART_2_NW_SE = 14480, + SPR_MINI_GOLF_HOLE_B_BASE_PART_1_NE_SW = 14481, + SPR_MINI_GOLF_HOLE_B_BASE_PART_2_NE_SW = 14482, + SPR_MINI_GOLF_HOLE_B_BASE_PART_1_SE_NW = 14483, + SPR_MINI_GOLF_HOLE_B_BASE_PART_2_SE_NW = 14484, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_SW_NE = 14485, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_SW_NE = 14486, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_NW_SE = 14487, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_NW_SE = 14488, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_NE_SW = 14489, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_NE_SW = 14490, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_SE_NW = 14491, + SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_SE_NW = 14492, + + SPR_MINI_GOLF_HOLE_C_BASE_PART_1_SW_NE = 14493, + SPR_MINI_GOLF_HOLE_C_BASE_PART_2_SW_NE = 14494, + SPR_MINI_GOLF_HOLE_C_BASE_PART_1_NW_SE = 14495, + SPR_MINI_GOLF_HOLE_C_BASE_PART_2_NW_SE = 14496, + SPR_MINI_GOLF_HOLE_C_BASE_PART_1_NE_SW = 14497, + SPR_MINI_GOLF_HOLE_C_BASE_PART_2_NE_SW = 14498, + SPR_MINI_GOLF_HOLE_C_BASE_PART_1_SE_NW = 14499, + SPR_MINI_GOLF_HOLE_C_BASE_PART_2_SE_NW = 14500, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_SW_NE = 14501, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_SW_NE = 14502, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_NW_SE = 14503, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_NW_SE = 14504, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_NE_SW = 14505, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_NE_SW = 14506, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_SE_NW = 14507, + SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_SE_NW = 14508, + + SPR_MINI_GOLF_HOLE_D_BASE_PART_1_SW_SE = 14509, + SPR_MINI_GOLF_HOLE_D_BASE_PART_2_SW_SE = 14510, + SPR_MINI_GOLF_HOLE_D_BASE_PART_3_SW_SE = 14511, + SPR_MINI_GOLF_HOLE_D_BASE_PART_1_NW_SW = 14512, + SPR_MINI_GOLF_HOLE_D_BASE_PART_2_NW_SW = 14513, + SPR_MINI_GOLF_HOLE_D_BASE_PART_3_NW_SW = 14514, + SPR_MINI_GOLF_HOLE_D_BASE_PART_1_NE_NW = 14515, + SPR_MINI_GOLF_HOLE_D_BASE_PART_2_NE_NW = 14516, + SPR_MINI_GOLF_HOLE_D_BASE_PART_3_NE_NW = 14517, + SPR_MINI_GOLF_HOLE_D_BASE_PART_1_SE_NE = 14518, + SPR_MINI_GOLF_HOLE_D_BASE_PART_2_SE_NE = 14519, + SPR_MINI_GOLF_HOLE_D_BASE_PART_3_SE_NE = 14520, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_SW_SE = 14521, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_SW_SE = 14522, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_SW_SE = 14523, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_NW_SW = 14524, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_NW_SW = 14525, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_NW_SW = 14526, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_NE_NW = 14527, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_NE_NW = 14528, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_NE_NW = 14529, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_SE_NE = 14530, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_SE_NE = 14531, + SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_SE_NE = 14532, + + SPR_MINI_GOLF_HOLE_E_BASE_PART_1_SE_SW = 14533, + SPR_MINI_GOLF_HOLE_E_BASE_PART_2_SE_SW = 14534, + SPR_MINI_GOLF_HOLE_E_BASE_PART_3_SE_SW = 14535, + SPR_MINI_GOLF_HOLE_E_BASE_PART_1_NE_SE = 14536, + SPR_MINI_GOLF_HOLE_E_BASE_PART_2_NE_SE = 14537, + SPR_MINI_GOLF_HOLE_E_BASE_PART_3_NE_SE = 14538, + SPR_MINI_GOLF_HOLE_E_BASE_PART_1_NW_NE = 14539, + SPR_MINI_GOLF_HOLE_E_BASE_PART_2_NW_NE = 14540, + SPR_MINI_GOLF_HOLE_E_BASE_PART_3_NW_NE = 14541, + SPR_MINI_GOLF_HOLE_E_BASE_PART_1_SW_NW = 14542, + SPR_MINI_GOLF_HOLE_E_BASE_PART_2_SW_NW = 14543, + SPR_MINI_GOLF_HOLE_E_BASE_PART_3_SW_NW = 14544, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_SE_SW = 14545, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_SE_SW = 14546, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_SE_SW = 14547, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_NE_SE = 14548, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_NE_SE = 14549, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_NE_SE = 14550, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_NW_NE = 14551, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_NW_NE = 14552, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_NW_NE = 14553, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_SW_NW = 14554, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_SW_NW = 14555, + SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_SW_NW = 14556, +}; + +static const uint32 mini_golf_track_sprites_25_deg_up[][3] = { + { + SPR_MINI_GOLF_25_DEG_UP_SW_NE, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_SW_NE, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_SW_NE, + }, + { + SPR_MINI_GOLF_25_DEG_UP_NW_SE, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_NW_SE, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_NW_SE, + }, + { + SPR_MINI_GOLF_25_DEG_UP_NE_SW, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_NE_SW, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_NE_SW, + }, + { + SPR_MINI_GOLF_25_DEG_UP_SE_NW, + SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_SE_NW, + SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_SE_NW, + } +}; + +static const uint32 mini_golf_track_sprites_flat_to_25_deg_up[][3] = { + { + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_SW_NE, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_SW_NE, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_SW_NE, + }, + { + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_NW_SE, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_NW_SE, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_NW_SE, + }, + { + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_NE_SW, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_NE_SW, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_NE_SW, + }, + { + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_SE_NW, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_SE_NW, + SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_SE_NW, + } +}; + + +static const uint32 mini_golf_track_sprites_25_deg_up_to_flat[][3] = { + { + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_SW_NE, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_SW_NE, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_SW_NE, + }, + { + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_NW_SE, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_NW_SE, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_NW_SE, + }, + { + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_NE_SW, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_NE_SW, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_NE_SW, + }, + { + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_SE_NW, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_SE_NW, + SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_SE_NW, + } +}; + +static const uint32 mini_golf_track_sprites_quarter_turn_1_tile[] = { + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_SW_NW, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_NW_NE, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_NE_SE, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_SE_SW, +}; + +static const uint32 mini_golf_track_sprites_quarter_turn_1_tile_fence_front[] = { + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_SW_NW, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_NW_NE, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_NE_SE, + SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_FRONT_SE_SW, +}; + +static const uint32 mini_golf_track_sprites_hole_a[4][2][2] = { + { + {SPR_MINI_GOLF_HOLE_A_BASE_PART_1_SW_NE, SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_SW_NE}, + {SPR_MINI_GOLF_HOLE_A_BASE_PART_2_SW_NE, SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_SW_NE} + }, + { + {SPR_MINI_GOLF_HOLE_A_BASE_PART_1_NW_SE, SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_NW_SE}, + {SPR_MINI_GOLF_HOLE_A_BASE_PART_2_NW_SE, SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_NW_SE} + }, + { + {SPR_MINI_GOLF_HOLE_A_BASE_PART_1_NE_SW, SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_NE_SW}, + {SPR_MINI_GOLF_HOLE_A_BASE_PART_2_NE_SW, SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_NE_SW} + }, + { + {SPR_MINI_GOLF_HOLE_A_BASE_PART_1_SE_NW, SPR_MINI_GOLF_HOLE_A_TRIM_PART_1_SE_NW}, + {SPR_MINI_GOLF_HOLE_A_BASE_PART_2_SE_NW, SPR_MINI_GOLF_HOLE_A_TRIM_PART_2_SE_NW} + }, +}; + +static const uint32 mini_golf_track_sprites_hole_b[4][2][2] = { + { + {SPR_MINI_GOLF_HOLE_B_BASE_PART_1_SW_NE, SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_SW_NE}, + {SPR_MINI_GOLF_HOLE_B_BASE_PART_2_SW_NE, SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_SW_NE} + }, + { + {SPR_MINI_GOLF_HOLE_B_BASE_PART_1_NW_SE, SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_NW_SE}, + {SPR_MINI_GOLF_HOLE_B_BASE_PART_2_NW_SE, SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_NW_SE} + }, + { + {SPR_MINI_GOLF_HOLE_B_BASE_PART_1_NE_SW, SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_NE_SW}, + {SPR_MINI_GOLF_HOLE_B_BASE_PART_2_NE_SW, SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_NE_SW} + }, + { + {SPR_MINI_GOLF_HOLE_B_BASE_PART_1_SE_NW, SPR_MINI_GOLF_HOLE_B_TRIM_PART_1_SE_NW}, + {SPR_MINI_GOLF_HOLE_B_BASE_PART_2_SE_NW, SPR_MINI_GOLF_HOLE_B_TRIM_PART_2_SE_NW} + }, +}; + +static const uint32 mini_golf_track_sprites_hole_c[][2][2] = { + { + {SPR_MINI_GOLF_HOLE_C_BASE_PART_1_SW_NE, SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_SW_NE}, + {SPR_MINI_GOLF_HOLE_C_BASE_PART_2_SW_NE, SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_SW_NE} + }, + { + {SPR_MINI_GOLF_HOLE_C_BASE_PART_1_NW_SE, SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_NW_SE}, + {SPR_MINI_GOLF_HOLE_C_BASE_PART_2_NW_SE, SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_NW_SE} + }, + { + {SPR_MINI_GOLF_HOLE_C_BASE_PART_1_NE_SW, SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_NE_SW}, + {SPR_MINI_GOLF_HOLE_C_BASE_PART_2_NE_SW, SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_NE_SW} + }, + { + {SPR_MINI_GOLF_HOLE_C_BASE_PART_1_SE_NW, SPR_MINI_GOLF_HOLE_C_TRIM_PART_1_SE_NW}, + {SPR_MINI_GOLF_HOLE_C_BASE_PART_2_SE_NW, SPR_MINI_GOLF_HOLE_C_TRIM_PART_2_SE_NW} + }, +}; + +static const uint32 mini_golf_track_sprites_hole_d[][3][2] = { + { + {SPR_MINI_GOLF_HOLE_D_BASE_PART_1_SW_SE, SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_SW_SE}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_2_SW_SE, SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_SW_SE}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_3_SW_SE, SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_SW_SE} + }, + { + {SPR_MINI_GOLF_HOLE_D_BASE_PART_1_NW_SW, SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_NW_SW}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_2_NW_SW, SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_NW_SW}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_3_NW_SW, SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_NW_SW} + }, + { + {SPR_MINI_GOLF_HOLE_D_BASE_PART_1_NE_NW, SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_NE_NW}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_2_NE_NW, SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_NE_NW}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_3_NE_NW, SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_NE_NW} + }, + { + {SPR_MINI_GOLF_HOLE_D_BASE_PART_1_SE_NE, SPR_MINI_GOLF_HOLE_D_TRIM_PART_1_SE_NE}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_2_SE_NE, SPR_MINI_GOLF_HOLE_D_TRIM_PART_2_SE_NE}, + {SPR_MINI_GOLF_HOLE_D_BASE_PART_3_SE_NE, SPR_MINI_GOLF_HOLE_D_TRIM_PART_3_SE_NE} + }, +}; + +static const uint32 mini_golf_track_sprites_hole_e[][3][2] = { + { + {SPR_MINI_GOLF_HOLE_E_BASE_PART_1_SW_NW, SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_SW_NW}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_2_SW_NW, SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_SW_NW}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_3_SW_NW, SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_SW_NW} + }, + { + {SPR_MINI_GOLF_HOLE_E_BASE_PART_1_NW_NE, SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_NW_NE}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_2_NW_NE, SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_NW_NE}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_3_NW_NE, SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_NW_NE} + }, + { + {SPR_MINI_GOLF_HOLE_E_BASE_PART_1_NE_SE, SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_NE_SE}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_2_NE_SE, SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_NE_SE}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_3_NE_SE, SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_NE_SE} + }, + { + {SPR_MINI_GOLF_HOLE_E_BASE_PART_1_SE_SW, SPR_MINI_GOLF_HOLE_E_TRIM_PART_1_SE_SW}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_2_SE_SW, SPR_MINI_GOLF_HOLE_E_TRIM_PART_2_SE_SW}, + {SPR_MINI_GOLF_HOLE_E_BASE_PART_3_SE_SW, SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_SE_SW} + }, +}; + +static paint_struct * mini_golf_paint_util_7c( + 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, + uint32 rotation +) +{ + if (direction & 1) { + return sub_98197C(image_id, y_offset, x_offset, bound_box_length_y, bound_box_length_x, bound_box_length_z, z_offset, bound_box_offset_y, bound_box_offset_x, bound_box_offset_z, rotation); + } + + return sub_98197C(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, rotation); +} + +static bool mini_golf_paint_util_should_draw_fence(rct_map_element * mapElement) +{ + if (!RCT2_GLOBAL(0x9DE57C, bool)) { + // Should be above ground (have passed surface rendering) + return false; + } + + rct_map_element * surfaceElement = RCT2_GLOBAL(0x9E3250, rct_map_element *); + if (surfaceElement->base_height != mapElement->base_height) { + return true; + } + + if (surfaceElement->properties.surface.slope & 0x1F) { + return true; + } + + return false; +} + +/** rct2: 0x0087F10C */ +static void paint_mini_golf_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + if (direction & 1) { + imageId = SPR_MINI_GOLF_FLAT_NW_SE | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, 20, 32, 1, height, 6, 0, height, get_current_rotation()); + paint_util_push_tunnel_right(height, TUNNEL_10); + } else { + imageId = SPR_MINI_GOLF_FLAT_SW_NE | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation()); + paint_util_push_tunnel_left(height, TUNNEL_10); + } + + metal_a_supports_paint_setup(3, 4, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + + if (mini_golf_paint_util_should_draw_fence(mapElement)) { + if (direction & 1) { + imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_NW_SE | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, 1, 32, 7, height, 10, 0, height + 2, get_current_rotation()); + + imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_NW_SE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, 0, 0, 1, 32, 7, height, 22, 0, height + 2, get_current_rotation()); + } else { + imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_SW_NE | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, 32, 1, 7, height, 0, 10, height + 2, get_current_rotation()); + + imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_SW_NE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, 0, 0, 32, 1, 7, height, 0, 22, height + 2, get_current_rotation()); + } + } + + paint_util_set_general_support_height(height + 32, 0x20); +} + +/** rct2: 0x0087F11C */ +static void paint_mini_golf_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + imageId = mini_golf_track_sprites_25_deg_up[direction][0] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation()); + + metal_a_supports_paint_setup(3, 4, 8, height, RCT2_GLOBAL(0x00F4419C, uint32)); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + + imageId = mini_golf_track_sprites_25_deg_up[direction][1] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 1, 15, height, 0, 10, height + 2, get_current_rotation()); + + imageId = mini_golf_track_sprites_25_deg_up[direction][2] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 1, 15, height, 0, 22, height + 2, get_current_rotation()); + + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + case 1: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 2: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + } + + paint_util_set_general_support_height(height + 56, 0x20); +} + +/** rct2: 0x0087F12C */ +static void paint_mini_golf_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + imageId = mini_golf_track_sprites_flat_to_25_deg_up[direction][0] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation()); + + metal_a_supports_paint_setup(3, 4, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + + imageId = mini_golf_track_sprites_flat_to_25_deg_up[direction][1] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 1, 11, height, 0, 10, height + 2, get_current_rotation()); + + imageId = mini_golf_track_sprites_flat_to_25_deg_up[direction][2] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 1, 11, height, 0, 22, height + 2, get_current_rotation()); + + switch (direction) { + case 0: + paint_util_push_tunnel_left(height, TUNNEL_10); + break; + case 1: + paint_util_push_tunnel_right(height, TUNNEL_2); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_right(height, TUNNEL_10); + break; + } + + paint_util_set_general_support_height(height + 48, 0x20); +} + +/** rct2: 0x0087F13C */ +static void paint_mini_golf_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + imageId = mini_golf_track_sprites_25_deg_up_to_flat[direction][0] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 20, 1, height, 0, 6, height, get_current_rotation()); + + metal_a_supports_paint_setup(3, 4, 8, height, RCT2_GLOBAL(0x00F4419C, uint32)); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + + imageId = mini_golf_track_sprites_25_deg_up_to_flat[direction][1] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 1, 11, height, 0, 10, height + 2, get_current_rotation()); + + imageId = mini_golf_track_sprites_25_deg_up_to_flat[direction][2] | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 1, 11, height, 0, 22, height + 2, get_current_rotation()); + + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_right(height + 8, TUNNEL_10); + break; + case 2: + paint_util_push_tunnel_left(height + 8, TUNNEL_10); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_0); + break; + } + + paint_util_set_general_support_height(height + 40, 0x20); +} + +/** rct2: 0x0087F14C */ +static void paint_mini_golf_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + paint_mini_golf_track_25_deg_up(rideIndex, trackSequence, (direction + 2) % 4, height, mapElement); +} + +/** rct2: 0x0087F15C */ +static void paint_mini_golf_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + paint_mini_golf_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) % 4, height, mapElement); +} + +/** rct2: 0x0087F16C */ +static void paint_mini_golf_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + paint_mini_golf_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) % 4, height, mapElement); +} + +/** rct2: 0x0087F17C, 0x0087F18C, 0x0087F19C */ +static void paint_mini_golf_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)}; + rct_ride * ride = get_ride(rideIndex); + const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; + uint32 imageId; + bool hasFence; + + imageId = SPR_MINI_GOLF_STATION_FLOOR | RCT2_GLOBAL(0x00F44198, uint32); + mini_golf_paint_util_7c(direction, imageId, 0, 0, 32, 28, 1, height, 0, 0, height, get_current_rotation()); + + if (direction & 1) { + hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_NW_SE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, -10, 0, 1, 32, 7, height, 0, 0, height + 2, get_current_rotation()); + } + track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, height); + + hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_NW_SE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, 10, 0, 1, 32, 7, height, 31, 0, height + 2, get_current_rotation()); + } + track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height); + + // Was leftwards tunnel in game, seems odd + paint_util_push_tunnel_right(height, TUNNEL_6); + } else { + hasFence = track_paint_util_has_fence(EDGE_NW, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + imageId = SPR_MINI_GOLF_FLAT_FENCE_BACK_SW_NE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, 0, -10, 32, 1, 7, height, 0, 0, height + 2, get_current_rotation()); + } + track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, height); + + hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + imageId = SPR_MINI_GOLF_FLAT_FENCE_FRONT_SW_NE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, 0, 10, 32, 1, 7, height, 0, 31, height + 2, get_current_rotation()); + } + track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height); + + paint_util_push_tunnel_left(height, TUNNEL_6); + } + + wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL); + + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +/** rct2: 0x0087F1AC */ +static void paint_mini_golf_track_left_quarter_turn_1_tile(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + track_paint_util_left_quarter_turn_1_tile_paint(1, height, 0, direction, RCT2_GLOBAL(0x00F44198, uint32), mini_golf_track_sprites_quarter_turn_1_tile, get_current_rotation()); + + metal_a_supports_paint_setup(3, 4, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + + const bool shouldDrawFence = mini_golf_paint_util_should_draw_fence(mapElement); + + switch (direction) { + case 0: + paint_util_push_tunnel_left(height, TUNNEL_10); + if (!shouldDrawFence) break; + + imageId = SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_SW_NW | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, 26, 24, 1, height, 6, 2, height, get_current_rotation()); + + break; + + case 1: + if (!shouldDrawFence) break; + + imageId = SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_NW_NE | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, 26, 26, 1, height, 0, 0, height, get_current_rotation()); + break; + + case 2: + paint_util_push_tunnel_right(height, TUNNEL_10); + if (!shouldDrawFence) break; + + imageId = SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_NE_SE | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, 24, 26, 1, height, 2, 6, height, get_current_rotation()); + break; + + case 3: + paint_util_push_tunnel_left(height, TUNNEL_10); + paint_util_push_tunnel_right(height, TUNNEL_10); + if (!shouldDrawFence) break; + + imageId = SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_BACK_SE_SW | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, 24, 24, 1, height, 6, 6, height, get_current_rotation()); + break; + } + + if (shouldDrawFence) { + // TODO: The back fence uses the same x/y offsets, but uses another paint function. See if this occurs more often. + track_paint_util_left_quarter_turn_1_tile_paint(0, height, 24, direction, RCT2_GLOBAL(0x00F44198, uint32), mini_golf_track_sprites_quarter_turn_1_tile_fence_front, get_current_rotation()); + + switch (direction) { + case 0: + imageId = SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_INSIDE_SW_NW | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, 5, 5, 5, height, 24, 0, height + 2, get_current_rotation()); + break; + case 2: + imageId = SPR_MINI_GOLF_QUARTER_TURN_1_TILE_FENCE_INSIDE_NE_SE | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, 5, 5, 5, height, 0, 24, height + 2, get_current_rotation()); + break; + } + } + + paint_util_set_general_support_height(height + 32, 0x20); +} + +/** rct2: 0x0087F1BC */ +static void paint_mini_golf_track_right_quarter_turn_1_tile(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + paint_mini_golf_track_left_quarter_turn_1_tile(rideIndex, trackSequence, (direction + 3) % 4, height, mapElement); +} + +static void paint_mini_golf_hole_ab(uint8 trackSequence, uint8 direction, int height, const uint32 sprites[4][2][2]) +{ + uint32 imageId; + + bool drewSupports = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL); + + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + + if ((direction == 0 && trackSequence == 0) || (direction == 2 && trackSequence == 1)) { + paint_util_push_tunnel_left(height, TUNNEL_10); + } else if ((direction == 3 && trackSequence == 0) || (direction == 1 && trackSequence == 1)) { + paint_util_push_tunnel_right(height, TUNNEL_10); + } + + rct_xy16 boundBox = (direction & 1) ? (rct_xy16) {26, 32} : (rct_xy16) {32, 26}; + rct_xy16 boundBoxOffset = (direction & 1) ? (rct_xy16) {3, 0} : (rct_xy16) {0, 3}; + + imageId = sprites[direction][trackSequence][1] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24, get_current_rotation()); + + if (drewSupports) { + imageId = (direction & 1 ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | RCT2_GLOBAL(0x00F4419C, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + + imageId = sprites[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } else { + imageId = sprites[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } +} + +/** rct2: 0x0087F1CC */ +static void paint_mini_golf_hole_a(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + paint_mini_golf_hole_ab(trackSequence, direction, height, mini_golf_track_sprites_hole_a); +} + +/** rct2: 0x0087F1DC */ +static void paint_mini_golf_hole_b(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + paint_mini_golf_hole_ab(trackSequence, direction, height, mini_golf_track_sprites_hole_b); +} + +/** rct2: 0x0087F1EC */ +static void paint_mini_golf_hole_c(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + bool drewSupports = wooden_a_supports_paint_setup(direction & 1, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL); + + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + + if ((direction == 0 && trackSequence == 0) || (direction == 2 && trackSequence == 1)) { + paint_util_push_tunnel_left(height, TUNNEL_10); + } else if ((direction == 3 && trackSequence == 0) || (direction == 1 && trackSequence == 1)) { + paint_util_push_tunnel_right(height, TUNNEL_10); + } + + rct_xy16 boundBox = (direction & 1) ? (rct_xy16) {26, 32} : (rct_xy16) {32, 26}; + rct_xy16 boundBoxOffset = (direction & 1) ? (rct_xy16) {3, 0} : (rct_xy16) {0, 3}; + + imageId = mini_golf_track_sprites_hole_c[direction][trackSequence][1] | RCT2_GLOBAL(0x00F44198, uint32); + + switch ((direction << 4) | trackSequence) { + case 0x01: + case 0x20: + sub_98197C(imageId, 0, 0, 2, 26, 3, height, 30, 3, height + 4, get_current_rotation()); + break; + case 0x10: + case 0x31: + sub_98197C(imageId, 0, 0, 26, 2, 3, height, 3, 30, height + 4, get_current_rotation()); + break; + default: + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24, get_current_rotation()); + break; + } + + if (drewSupports) { + imageId = (direction & 1 ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | RCT2_GLOBAL(0x00F4419C, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + + imageId = mini_golf_track_sprites_hole_c[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } else { + imageId = mini_golf_track_sprites_hole_c[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } +} + +/** rct2: 0x0087F1FC */ +static void paint_mini_golf_hole_d(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + int supportType = direction & 1; + if (trackSequence == 2) supportType = 1 - supportType; + bool drewSupports = wooden_a_supports_paint_setup(supportType, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL); + + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + + switch ((direction << 4) | trackSequence) { + case 0x00: + case 0x12: + paint_util_push_tunnel_left(height, TUNNEL_10); + break; + + case 0x02: + case 0x30: + paint_util_push_tunnel_right(height, TUNNEL_10); + break; + } + + rct_xy16 boundBox = (supportType & 1) ? (rct_xy16) {26, 32} : (rct_xy16) {32, 26}; + rct_xy16 boundBoxOffset = (supportType & 1) ? (rct_xy16) {3, 0} : (rct_xy16) {0, 3}; + + imageId = mini_golf_track_sprites_hole_d[direction][trackSequence][1] | RCT2_GLOBAL(0x00F44198, uint32); + + switch ((direction << 4) | trackSequence) { + case 0x01: + case 0x32: + sub_98197C(imageId, 0, 0, 2, 26, 3, height, 30, 3, height + 4, get_current_rotation()); + break; + case 0x02: + sub_98197C(imageId, 0, 0, 23, 2, 3, height, 3, 30, height + 4, get_current_rotation()); + break; + case 0x10: + sub_98197C(imageId, 0, 0, 2, 24, 3, height, 30, 3, height + 4, get_current_rotation()); + break; + case 0x20: + case 0x31: + sub_98197C(imageId, 0, 0, 26, 2, 3, height, 3, 30, height + 4, get_current_rotation()); + break; + default: + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24, get_current_rotation()); + break; + } + + switch ((direction << 4) | trackSequence) { + case 0x02: boundBox = (rct_xy16) {23, 32}; break; + case 0x10: boundBox = (rct_xy16) {24, 32}; break; + } + + if (drewSupports) { + imageId = (supportType & 1 ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | RCT2_GLOBAL(0x00F4419C, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + + imageId = mini_golf_track_sprites_hole_d[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } else { + imageId = mini_golf_track_sprites_hole_d[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } +} + +/** rct2: 0x0087F1FC */ +static void paint_mini_golf_hole_e(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + uint32 imageId; + + int supportType = direction & 1; + if (trackSequence == 2) supportType = 1 - supportType; + bool drewSupports = wooden_a_supports_paint_setup(supportType, 0, height, RCT2_GLOBAL(0x00F4419C, uint32), NULL); + + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + + switch ((direction << 4) | trackSequence) { + case 0x00: + case 0x12: + paint_util_push_tunnel_left(height, TUNNEL_10); + break; + + case 0x02: + case 0x30: + paint_util_push_tunnel_right(height, TUNNEL_10); + break; + } + + rct_xy16 boundBox = (supportType & 1) ? (rct_xy16) {26, 32} : (rct_xy16) {32, 26}; + rct_xy16 boundBoxOffset = (supportType & 1) ? (rct_xy16) {3, 0} : (rct_xy16) {0, 3}; + + imageId = mini_golf_track_sprites_hole_e[direction][trackSequence][1] | RCT2_GLOBAL(0x00F44198, uint32); + + switch ((direction << 4) | trackSequence) { + case 0x01: + sub_98197C(imageId, 0, 0, 2, 26, 3, height, 30, 3, height + 4, get_current_rotation()); + case 0x02: + case 0x20: + case 0x31: + sub_98197C(imageId, 0, 0, 26, 2, 3, height, 3, 30, height + 4, get_current_rotation()); + break; + case 0x10: + sub_98197C(imageId, 0, 0, 2, 24, 3, height, 30, 3, height + 4, get_current_rotation()); + break; + case 0x32: + sub_98197C(imageId, 0, 0, 2, 23, 3, height, 30, 3, height + 4, get_current_rotation()); + break; + default: + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 0, height, boundBoxOffset.x, boundBoxOffset.y, height + 24, get_current_rotation()); + break; + } + + switch ((direction << 4) | trackSequence) { + case 0x10: boundBox = (rct_xy16) {24, 32}; break; + case 0x32: boundBox = (rct_xy16) {32, 23}; break; + } + + if (drewSupports) { + imageId = (supportType & 1 ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | RCT2_GLOBAL(0x00F4419C, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + + imageId = mini_golf_track_sprites_hole_e[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98199C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } else { + imageId = mini_golf_track_sprites_hole_e[direction][trackSequence][0] | RCT2_GLOBAL(0x00F44198, uint32); + sub_98197C(imageId, 0, 0, boundBox.x, boundBox.y, 1, height, boundBoxOffset.x, boundBoxOffset.y, height, get_current_rotation()); + } +} + +/** + * rct2: 0x0087EDC4 + */ +TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction) { + switch (trackType) { + case TRACK_ELEM_FLAT: + return paint_mini_golf_track_flat; + + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + case TRACK_ELEM_END_STATION: + return paint_mini_golf_station; + + case TRACK_ELEM_25_DEG_UP: + return paint_mini_golf_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return paint_mini_golf_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return paint_mini_golf_track_25_deg_up_to_flat; + + case TRACK_ELEM_25_DEG_DOWN: + return paint_mini_golf_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return paint_mini_golf_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return paint_mini_golf_track_25_deg_down_to_flat; + + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE: + return paint_mini_golf_track_left_quarter_turn_1_tile; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE: + return paint_mini_golf_track_right_quarter_turn_1_tile; + + case TRACK_ELEM_MINI_GOLF_HOLE_A: + return paint_mini_golf_hole_a; + case TRACK_ELEM_MINI_GOLF_HOLE_B: + return paint_mini_golf_hole_b; + case TRACK_ELEM_MINI_GOLF_HOLE_C: + return paint_mini_golf_hole_c; + case TRACK_ELEM_MINI_GOLF_HOLE_D: + return paint_mini_golf_hole_d; + case TRACK_ELEM_MINI_GOLF_HOLE_E: + return paint_mini_golf_hole_e; + } + + return NULL; +} + +/** + * rct2: 0x006D42F0 + */ +void vehicle_visual_mini_golf_player(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, int rct2VehiclePtrFormat) +{ + if (vehicle->num_peeps == 0) { + return; + } + + rct_drawpixelinfo *edi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); + if (edi->zoom_level >= 2) { + return; + } + + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_INVISIBLE_PEEPS) { + return; + } + + rct_ride_entry *rideType = get_ride_entry(get_ride(vehicle->ride)->subtype); + rct_sprite *sprite = &g_sprite_list[vehicle->peep[0]]; + + uint32 eax = RCT2_ADDRESS(0x008B8F74, uint32)[vehicle->var_D4]; + uint32 ebx = (RCT2_GLOBAL(eax + vehicle->var_C5, uint8) << 2) + (imageDirection >> 3); + + uint32 image_id = rideType->vehicles[0].base_image_id + 1 + ebx; + uint32 peep_palette = sprite->peep.tshirt_colour << 19 | sprite->peep.trousers_colour << 24 | 0x0A0000000; + sub_98197C(image_id | peep_palette, 0, 0, 1, 1, 11, z, 0, 0, z + 5, get_current_rotation()); +} + +/** + * rct2: 0x006D43C6 + */ +void vehicle_visual_mini_golf_ball(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, int rct2VehiclePtrFormat) +{ + if (vehicle->var_D4 != 1) { + return; + } + + rct_drawpixelinfo *edi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); + if (edi->zoom_level >= 1) { + return; + } + + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_VIEWPORT_FLAGS, uint16) & VIEWPORT_FLAG_INVISIBLE_PEEPS) { + return; + } + + rct_ride *ride = get_ride(vehicle->ride); + rct_ride_entry *rideType = get_ride_entry(ride->subtype); + //log_info("base_image_id: %d, image_id: %d", rideType->vehicles[0].base_image_id, rideType->vehicles[0].base_image_id & 0x7FFFF); + + uint32 image_id = rideType->vehicles[0].base_image_id; + sub_98197C(image_id, 0, 0, 1, 1, 0, z, 0, 0, z + 3, get_current_rotation()); +} diff --git a/src/ride/gentle/mini_helicopters.c b/src/ride/gentle/mini_helicopters.c index 5135a4a6b7..38debabfad 100644 --- a/src/ride/gentle/mini_helicopters.c +++ b/src/ride/gentle/mini_helicopters.c @@ -374,7 +374,7 @@ static void paint_mini_helicopters_track_right_quarter_turn_3_tiles(uint8 rideIn /** rct2: 0x0081F408 */ static void paint_mini_helicopters_track_left_quarter_turn_1_tile(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { - track_paint_util_left_quarter_turn_1_tile_paint(height, direction, RCT2_GLOBAL(0x00F44198, uint32), trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile, get_current_rotation()); + track_paint_util_left_quarter_turn_1_tile_paint(1, height, 0, direction, RCT2_GLOBAL(0x00F44198, uint32), trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile, get_current_rotation()); track_paint_util_left_quarter_turn_1_tile_tunnel(height, direction, trackSequence); paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); diff --git a/src/ride/shops/facility.c b/src/ride/shops/facility.c index 2d92337ed9..a24fc11a35 100644 --- a/src/ride/shops/facility.c +++ b/src/ride/shops/facility.c @@ -45,7 +45,7 @@ static void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 dir int lengthX = (direction & 1) == 0 ? 28 : 2; int lengthY = (direction & 1) == 0 ? 2 : 28; if (hasSupports) { - uint32 foundationImageId = (direction & 1 ? 3396 : 3395) | RCT2_GLOBAL(0x00F441A4, uint32); + uint32 foundationImageId = (direction & 1 ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | RCT2_GLOBAL(0x00F441A4, uint32); sub_98197C(foundationImageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height, rotation); // Door image or base diff --git a/src/ride/shops/shop.c b/src/ride/shops/shop.c index 691bae70de..d652fe90e9 100644 --- a/src/ride/shops/shop.c +++ b/src/ride/shops/shop.c @@ -45,7 +45,7 @@ static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi imageId += direction; if (hasSupports) { - uint32 foundationImageId = (direction & 1 ? 3396 : 3395) | RCT2_GLOBAL(0x00F441A4, uint32); + uint32 foundationImageId = (direction & 1 ? SPR_FLOOR_PLANKS_90_DEG : SPR_FLOOR_PLANKS) | RCT2_GLOBAL(0x00F441A4, uint32); sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); sub_98199C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height, get_current_rotation()); diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 9efc63e1cf..2f9e43966f 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -5534,7 +5534,7 @@ const uint32 RideTypeTrackPaintFunctionsOld[91] = { 0x008245A8, // RIDE_TYPE_40 0x0086E2F8, // RIDE_TYPE_REVERSER_ROLLER_COASTER 0x00876618, // RIDE_TYPE_HEARTLINE_TWISTER_COASTER - 0x0087EDC4, // RIDE_TYPE_MINI_GOLF + 0, // RIDE_TYPE_MINI_GOLF 0x008AD280, // RIDE_TYPE_GIGA_COASTER 0, // RIDE_TYPE_ROTO_DROP 0, // RIDE_TYPE_FLYING_SAUCERS @@ -5629,7 +5629,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { 0, // RIDE_TYPE_40 0, // RIDE_TYPE_REVERSER_ROLLER_COASTER 0, // RIDE_TYPE_HEARTLINE_TWISTER_COASTER - 0, // RIDE_TYPE_MINI_GOLF + get_track_paint_function_mini_golf, // RIDE_TYPE_MINI_GOLF 0, // RIDE_TYPE_GIGA_COASTER get_track_paint_function_roto_drop, // RIDE_TYPE_ROTO_DROP get_track_paint_function_flying_saucers,// RIDE_TYPE_FLYING_SAUCERS diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 15672a0fbd..63e33409f3 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -407,15 +407,15 @@ void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 dire } -void track_paint_util_left_quarter_turn_1_tile_paint(sint16 height, int direction, uint32 colourFlags, const uint32 * sprites, uint8 rotation) +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) { uint32 imageId = sprites[direction] | colourFlags; switch (direction) { - case 0: sub_98197C(imageId, 0, 0, 26, 24, 1, height, 6, 2, height, rotation); break; - case 1: sub_98197C(imageId, 0, 0, 26, 26, 1, height, 0, 0, height, rotation); break; - case 2: sub_98197C(imageId, 0, 0, 24, 26, 1, height, 2, 6, height, rotation); break; - case 3: sub_98197C(imageId, 0, 0, 24, 24, 1, height, 6, 6, height, rotation); break; + case 0: sub_98197C(imageId, 0, 0, 26, 24, thickness, height, 6, 2, height + boundBoxZOffset, rotation); break; + case 1: sub_98197C(imageId, 0, 0, 26, 26, thickness, height, 0, 0, height + boundBoxZOffset, rotation); break; + case 2: sub_98197C(imageId, 0, 0, 24, 26, thickness, height, 2, 6, height + boundBoxZOffset, rotation); break; + case 3: sub_98197C(imageId, 0, 0, 24, 24, thickness, height, 6, 6, height + boundBoxZOffset, rotation); break; } } diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index fcae029f6b..a43d7bffef 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -32,6 +32,9 @@ extern const uint8 track_map_4x4[][16]; extern const uint8 edges_4x4[]; enum { + SPR_FLOOR_PLANKS = 3395, + SPR_FLOOR_PLANKS_90_DEG = 3396, + SPR_FLOOR_METAL = 14567, SPR_FENCE_METAL_NE = 14568, SPR_FENCE_METAL_SE = 14569, @@ -163,7 +166,7 @@ void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definit void track_paint_util_left_quarter_turn_3_tiles_paint(sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation); void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence); -void track_paint_util_left_quarter_turn_1_tile_paint(sint16 height, int direction, uint32 colourFlags, const uint32 sprites[4], uint8 rotation); +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); typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); @@ -188,6 +191,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direct TRACK_PAINT_FUNCTION get_track_paint_function_haunted_house(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_circus_show(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); TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int direction); diff --git a/src/ride/vehicle_paint.c b/src/ride/vehicle_paint.c index 0cac934161..b1f2c34f8f 100644 --- a/src/ride/vehicle_paint.c +++ b/src/ride/vehicle_paint.c @@ -2366,8 +2366,8 @@ void vehicle_paint(rct_vehicle *vehicle, int imageDirection) case VEHICLE_VISUAL_LAUNCHED_FREEFALL: vehicle_visual_launched_freefall(x, imageDirection, y, z, vehicle, vehicleEntry); break; case VEHICLE_VISUAL_OBSERVATION_TOWER: vehicle_visual_observation_tower(x, imageDirection, y, z, vehicle, vehicleEntry); break; case VEHICLE_VISUAL_RIVER_RAPIDS: vehicle_visual_river_rapids(x, imageDirection, y, z, vehicle, vehicleEntry); break; - case VEHICLE_VISUAL_MINI_GOLF_PLAYER: RCT2_CALLPROC_X(0x006D42F0, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; - case VEHICLE_VISUAL_MINI_GOLF_BALL: RCT2_CALLPROC_X(0x006D43C6, x, imageDirection, y, z, (int)vehicle, rct2VehiclePtrFormat, 0); break; + case VEHICLE_VISUAL_MINI_GOLF_PLAYER: vehicle_visual_mini_golf_player(x, imageDirection, y, z, vehicle, rct2VehiclePtrFormat); break; + case VEHICLE_VISUAL_MINI_GOLF_BALL: vehicle_visual_mini_golf_ball(x, imageDirection, y, z, vehicle, rct2VehiclePtrFormat); break; case VEHICLE_VISUAL_REVERSER: vehicle_visual_reverser(x, imageDirection, y, z, vehicle, vehicleEntry); break; case VEHICLE_VISUAL_SPLASH_BOATS_OR_WATER_COASTER: vehicle_visual_splash_boats_or_water_coaster(x, imageDirection, y, z, vehicle, vehicleEntry); break; case VEHICLE_VISUAL_ROTO_DROP: vehicle_visual_roto_drop(x, imageDirection, y, z, vehicle, vehicleEntry); break; diff --git a/src/ride/vehicle_paint.h b/src/ride/vehicle_paint.h index 2e46a93223..99fe93de06 100644 --- a/src/ride/vehicle_paint.h +++ b/src/ride/vehicle_paint.h @@ -42,5 +42,7 @@ void vehicle_visual_launched_freefall(int x, int imageDirection, int y, int z, r void vehicle_visual_splash_effect(int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry); void vehicle_visual_virginia_reel(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry); void vehicle_visual_submarine(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, const rct_ride_entry_vehicle *vehicleEntry); +void vehicle_visual_mini_golf_player(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, int rct2VehiclePtrFormat); +void vehicle_visual_mini_golf_ball(int x, int imageDirection, int y, int z, rct_vehicle *vehicle, int rct2VehiclePtrFormat); #endif diff --git a/src/ride/water/submarine_ride.c b/src/ride/water/submarine_ride.c index 83bfabef36..d3a87eb4a9 100644 --- a/src/ride/water/submarine_ride.c +++ b/src/ride/water/submarine_ride.c @@ -147,7 +147,7 @@ static void submarine_ride_paint_track_right_quarter_turn_3_tiles(uint8 rideInde static void submarine_ride_paint_track_left_quarter_turn_1_tile(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { - track_paint_util_left_quarter_turn_1_tile_paint(height - 16, direction, RCT2_GLOBAL(0x00F44198, uint32), trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile, get_current_rotation()); + track_paint_util_left_quarter_turn_1_tile_paint(1, height - 16, 0, direction, RCT2_GLOBAL(0x00F44198, uint32), trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile, get_current_rotation()); track_paint_util_left_quarter_turn_1_tile_tunnel(height - 16, direction, trackSequence); paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0);