Partially integrate vertical tunnels

This commit is contained in:
Marijn van der Werf 2016-09-09 18:16:40 +02:00 committed by Ted John
parent 498bab24c3
commit d00aa2c7bb
7 changed files with 20 additions and 10 deletions

View File

@ -38,6 +38,7 @@ tunnel_entry gLeftTunnels[65];
uint8 gLeftTunnelCount; uint8 gLeftTunnelCount;
tunnel_entry gRightTunnels[65]; tunnel_entry gRightTunnels[65];
uint8 gRightTunnelCount; uint8 gRightTunnelCount;
uint8 gVerticalTunnelHeight;
#endif #endif
static void blank_tiles_paint(int x, int y); static void blank_tiles_paint(int x, int y);
@ -146,7 +147,8 @@ static void sub_68B3FB(int x, int y)
gLeftTunnels[0] = (tunnel_entry){0xFF, 0xFF}; gLeftTunnels[0] = (tunnel_entry){0xFF, 0xFF};
gRightTunnels[0] = (tunnel_entry){0xFF, 0xFF}; gRightTunnels[0] = (tunnel_entry){0xFF, 0xFF};
RCT2_GLOBAL(0x9E323C, uint8_t) = 0xFF; gVerticalTunnelHeight = 0xFF;
RCT2_GLOBAL(0x9DE56A, uint16_t) = x; RCT2_GLOBAL(0x9DE56A, uint16_t) = x;
RCT2_GLOBAL(0x9DE56E, uint16_t) = y; RCT2_GLOBAL(0x9DE56E, uint16_t) = y;
RCT2_GLOBAL(0x9DE574, uint16_t) = x; RCT2_GLOBAL(0x9DE574, uint16_t) = x;
@ -323,6 +325,11 @@ void paint_util_push_tunnel_right(uint16 height, uint8 type)
gRightTunnelCount++; gRightTunnelCount++;
} }
void paint_util_set_vertical_tunnel(uint16 height)
{
gVerticalTunnelHeight = height / 16;
}
void paint_util_set_general_support_height(sint16 height, uint8 slope) void paint_util_set_general_support_height(sint16 height, uint8 slope)
{ {
if (gSupport.height >= height) { if (gSupport.height >= height) {

View File

@ -72,17 +72,20 @@ extern tunnel_entry gLeftTunnels[65];
extern uint8 gLeftTunnelCount; extern uint8 gLeftTunnelCount;
extern tunnel_entry gRightTunnels[65]; extern tunnel_entry gRightTunnels[65];
extern uint8 gRightTunnelCount; extern uint8 gRightTunnelCount;
extern uint8 gVerticalTunnelHeight;
#else #else
#define gLeftTunnels RCT2_ADDRESS(0x009E3138, tunnel_entry) #define gLeftTunnels RCT2_ADDRESS(0x009E3138, tunnel_entry)
#define gLeftTunnelCount RCT2_GLOBAL(0x0141F56A, uint8) #define gLeftTunnelCount RCT2_GLOBAL(0x0141F56A, uint8)
#define gRightTunnels RCT2_ADDRESS(0x009E30B6, tunnel_entry) #define gRightTunnels RCT2_ADDRESS(0x009E30B6, tunnel_entry)
#define gRightTunnelCount RCT2_GLOBAL(0x0141F56B, uint8) #define gRightTunnelCount RCT2_GLOBAL(0x0141F56B, uint8)
#define gVerticalTunnelHeight RCT2_GLOBAL(0x009E323C, uint8)
#endif #endif
extern bool gShowSupportSegmentHeights; extern bool gShowSupportSegmentHeights;
void paint_util_push_tunnel_left(uint16 height, uint8 type); void paint_util_push_tunnel_left(uint16 height, uint8 type);
void paint_util_push_tunnel_right(uint16 height, uint8 type); void paint_util_push_tunnel_right(uint16 height, uint8 type);
void paint_util_set_vertical_tunnel(uint16 height);
void paint_util_set_general_support_height(sint16 height, uint8 slope); void paint_util_set_general_support_height(sint16 height, uint8 slope);
void paint_util_force_set_general_support_height(sint16 height, uint8 slope); void paint_util_force_set_general_support_height(sint16 height, uint8 slope);

View File

@ -1037,7 +1037,7 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement)
bool has_surface = false; bool has_surface = false;
if (RCT2_GLOBAL(0x9E323C, uint8) * 16 == height) { if (gVerticalTunnelHeight * 16 == height) {
// Vertical tunnels // Vertical tunnels
sub_98197C(1575, 0, 0, 1, 30, 39, height, -2, 1, height - 40, rotation); sub_98197C(1575, 0, 0, 1, 30, 39, height, -2, 1, height - 40, rotation);
sub_98197C(1576, 0, 0, 30, 1, 0, height, 1, 31, height, rotation); sub_98197C(1576, 0, 0, 30, 1, 0, height, 1, 31, height, rotation);

View File

@ -97,7 +97,7 @@ static void paint_observation_tower_base(uint8 rideIndex, uint8 trackSequence, u
imageId = SPR_OBSERVATION_TOWER_SEGMENT | RCT2_GLOBAL(0x00F44198, uint32); imageId = SPR_OBSERVATION_TOWER_SEGMENT | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation()); sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation());
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 32) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 32);
} }
int blockedSegments = 0; int blockedSegments = 0;
@ -135,7 +135,7 @@ static void paint_observation_tower_section(uint8 rideIndex, uint8 trackSequence
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 32) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 32);
paint_util_set_general_support_height(height + 32, 0x20); paint_util_set_general_support_height(height + 32, 0x20);
} }

View File

@ -112,7 +112,7 @@ static void paint_launched_freefall_base(uint8 rideIndex, uint8 trackSequence, u
imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | RCT2_GLOBAL(0x00F44198, uint32); imageId = SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation()); sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation());
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 32) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 32);
height -= 64; height -= 64;
} }
@ -152,7 +152,7 @@ static void paint_launched_freefall_tower_section(uint8 rideIndex, uint8 trackSe
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 32) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 32);
paint_util_set_general_support_height(height + 32, 0x20); paint_util_set_general_support_height(height + 32, 0x20);
} }

View File

@ -112,7 +112,7 @@ static void paint_roto_drop_base(uint8 rideIndex, uint8 trackSequence, uint8 dir
imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | RCT2_GLOBAL(0x00F44198, uint32); imageId = (direction & 1 ? SPR_ROTO_DROP_TOWER_BASE_SEGMENT_90_DEG : SPR_ROTO_DROP_TOWER_BASE_SEGMENT) | RCT2_GLOBAL(0x00F44198, uint32);
sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation()); sub_98197C(imageId, 0, 0, 2, 2, 30, height, 8, 8, height, get_current_rotation());
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 32) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 32);
} }
int blockedSegments = 0; int blockedSegments = 0;
@ -150,7 +150,7 @@ static void paint_roto_drop_tower_section(uint8 rideIndex, uint8 trackSequence,
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 32) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 32);
paint_util_set_general_support_height(height + 32, 0x20); paint_util_set_general_support_height(height + 32, 0x20);
} }

View File

@ -66,7 +66,7 @@ static void paint_lift_base(uint8 rideIndex, uint8 trackSequence, uint8 directio
paint_lift_cage(-1, RCT2_GLOBAL(0x00F44198, uint32), height + 64, get_current_rotation()); paint_lift_cage(-1, RCT2_GLOBAL(0x00F44198, uint32), height + 64, get_current_rotation());
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 96) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 96);
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
// Original set support height to (height + 32). Caused supports to code with lift cage. // Original set support height to (height + 32). Caused supports to code with lift cage.
@ -111,7 +111,7 @@ static void paint_lift_tower_section(uint8 rideIndex, uint8 trackSequence, uint8
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
RCT2_GLOBAL(0x9E323C, uint16) = (((height + 32) >> 4) & 0x00FF) | (6 << 8); paint_util_set_vertical_tunnel(height + 32);
paint_util_set_general_support_height(height + 32, 0x20); paint_util_set_general_support_height(height + 32, 0x20);
} }