mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 19:43:06 +01:00
Use support-setting functions in more places
This commit is contained in:
@@ -149,21 +149,10 @@ void ride_entrance_exit_paint(uint8 direction, int height, rct_map_element* map_
|
||||
}
|
||||
wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL);
|
||||
|
||||
RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF;
|
||||
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
|
||||
|
||||
height += is_exit ? 40 : 56;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height){
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height;
|
||||
RCT2_GLOBAL(0x141E9DA, uint8) = 32;
|
||||
}
|
||||
paint_util_set_general_support_height(height, 0x20);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -246,21 +235,8 @@ void park_entrance_paint(uint8 direction, int height, rct_map_element* map_eleme
|
||||
}
|
||||
wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL);
|
||||
|
||||
RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF;
|
||||
|
||||
height += 80;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height){
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height;
|
||||
RCT2_GLOBAL(0x141E9DA, uint8) = 32;
|
||||
}
|
||||
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
|
||||
paint_util_set_general_support_height(height + 80, 0x20);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,17 +48,8 @@ void map_element_paint_setup(int x, int y)
|
||||
x >= 32 &&
|
||||
y >= 32
|
||||
) {
|
||||
RCT2_GLOBAL(0x0141E9B4, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9B8, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9BC, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9C0, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9C4, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9C8, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9CC, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9D0, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9D4, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = -1;
|
||||
RCT2_GLOBAL(0x0141E9DA, sint16) = 0;
|
||||
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
|
||||
paint_util_force_set_general_support_height(-1, 0);
|
||||
RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF;
|
||||
|
||||
sub_68B3FB(x, y);
|
||||
@@ -79,17 +70,8 @@ void sub_68B2B7(int x, int y)
|
||||
x >= 32 &&
|
||||
y >= 32
|
||||
) {
|
||||
RCT2_GLOBAL(0x0141E9B4, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9B8, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9BC, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9C0, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9C4, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9C8, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9CC, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9D0, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9D4, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = -1;
|
||||
RCT2_GLOBAL(0x0141E9DA, uint16) = 0;
|
||||
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
|
||||
paint_util_force_set_general_support_height(-1, 0);
|
||||
RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF;
|
||||
RCT2_GLOBAL(0x0141E9DB, uint8) |= 2;
|
||||
|
||||
@@ -292,19 +274,19 @@ void paint_util_push_tunnel_right(uint16 height, uint8 type)
|
||||
RCT2_GLOBAL(0x141F56B, uint8)++;
|
||||
}
|
||||
|
||||
void paint_util_set_general_support_height(uint16 height, uint8 flags)
|
||||
void paint_util_set_general_support_height(sint16 height, uint8 slope)
|
||||
{
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, uint16) >= height) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) >= height) {
|
||||
return;
|
||||
}
|
||||
|
||||
paint_util_force_set_general_support_height(height, flags);
|
||||
paint_util_force_set_general_support_height(height, slope);
|
||||
}
|
||||
|
||||
void paint_util_force_set_general_support_height(uint16 height, uint8 flags)
|
||||
void paint_util_force_set_general_support_height(sint16 height, uint8 slope)
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, uint16) = height;
|
||||
RCT2_GLOBAL(0x141E9DA, uint8) = flags;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height;
|
||||
RCT2_GLOBAL(0x141E9DA, uint8) = slope;
|
||||
}
|
||||
|
||||
const uint segment_offsets[9] = {
|
||||
@@ -319,13 +301,13 @@ const uint segment_offsets[9] = {
|
||||
SEGMENT_D4
|
||||
};
|
||||
|
||||
void paint_util_set_segment_support_height(int segments, uint16 height, uint8 flags)
|
||||
void paint_util_set_segment_support_height(int segments, uint16 height, uint8 slope)
|
||||
{
|
||||
for (int s = 0; s < 9; s++) {
|
||||
if (segments & segment_offsets[s]) {
|
||||
RCT2_GLOBAL(0x0141E9B4 + s * 4, uint16) = height;
|
||||
if (height != 0xFFFF) {
|
||||
RCT2_GLOBAL(0x0141E9B6 + s * 4, uint8) = flags;
|
||||
RCT2_GLOBAL(0x0141E9B6 + s * 4, uint8) = slope;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ enum
|
||||
void paint_util_push_tunnel_left(uint16 height, uint8 type);
|
||||
void paint_util_push_tunnel_right(uint16 height, uint8 type);
|
||||
|
||||
void paint_util_set_general_support_height(uint16 height, uint8 flags);
|
||||
void paint_util_force_set_general_support_height(uint16 height, uint8 flags);
|
||||
void paint_util_set_segment_support_height(int segments, uint16 height, uint8 flags);
|
||||
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_set_segment_support_height(int segments, uint16 height, uint8 slope);
|
||||
|
||||
void map_element_paint_setup(int x, int y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user