1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Restore original path support drawing

This commit is contained in:
Marijn van der Werf
2016-06-11 11:35:18 +02:00
parent 4131396844
commit 8e962c9157
3 changed files with 9 additions and 96 deletions

View File

@@ -79,19 +79,6 @@ const uint8 byte_98D8A4[] = {
0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0
};
typedef struct
{
uint8 var_0, var_1, var_2, var_3, var_4, var_5, var_6, var_7;
} unk_supports_desc_bound_box;
const unk_supports_desc_bound_box stru_98D8D4[] = {
{0, 0, 0, 1, 1, 4, 0, 1},
{0, 0, 0, 1, 1, 4, 0, 1},
{0, 0, 0, 1, 1, 4, 0, 1},
{0, 0, 0, 1, 1, 4, 0, 1}
};
void loc_6A37C9(rct_map_element * map_element, int height, rct_footpath_entry * dword_F3EF6C, bool word_F3F038, uint32 dword_F3EF70, uint32 dword_F3EF74);
void loc_6A3B57(rct_map_element* mapElement, sint16 height, rct_footpath_entry* footpathEntry, bool hasFences, uint32 imageFlags, uint32 sceneryImageFlags);
@@ -280,82 +267,6 @@ void path_bit_jumping_fountains_paint(rct_scenery_entry* pathBitEntry, rct_map_e
sub_98197C(imageId + 4, 0, 0, 1, 1, 2, height, 29, 3, height + 2, get_current_rotation());
}
bool do_sub_6A2ECC(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * dword_F3EF6C, bool * underground)
{
if (underground != NULL) {
*underground = false;
}
int eax = special, edx = height, _edi = supportType, ebp = imageColourFlags;
if (gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS) {
return false;
}
if (!(RCT2_GLOBAL(0x0141E9DB, uint8) & 1)) {
return false;
}
int z = floor2(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) + 15, 16);
height -= z;
if (height < 0) {
if (underground != NULL) {
*underground = true;
}
return false;
}
height /= 16;
bool hasSupports = false;
// Draw base support (usually shaped to the slope)
int slope = RCT2_GLOBAL(0x0141E9DA, uint8);
if (slope & 0x20) {
uint32 image_id = (dword_F3EF6C->bridge_image + 48) | imageColourFlags;
sub_98196C(image_id, 0, 0, 32, 32, 0, z - 2, get_current_rotation());
hasSupports = true;
} else {
}
while (height != 0) {
if ((z & 16) == 0 && height >= 2 && z + 16 != RCT2_GLOBAL(0x00141E9DC, uint16)) {
// Full support
int imageId = (dword_F3EF6C->bridge_image + 22 + supportType * 24) | imageColourFlags;
uint8 ah = height == 2 ? 23 : 28; // weird
sub_98196C(imageId, 0, 0, 32, 32, ah, z, get_current_rotation());
hasSupports = true;
z += 32;
height -= 2;
} else {
// Half support
int imageId = (dword_F3EF6C->bridge_image + 23 + supportType * 24) | imageColourFlags;
uint8 ah = special == 1 ? 7 : 12;
sub_98196C(imageId, 0, 0, 32, 32, ah, z, get_current_rotation());
hasSupports = true;
z += 16;
height -= 1;
}
}
if (special == 0) {
return hasSupports;
}
special = (special - 1) & 0xFFFF;
uint32 imageId = (dword_F3EF6C->bridge_image + 55 + special) | imageColourFlags;
unk_supports_desc_bound_box stru = stru_98D8D4[special];
// var_6 is always zero.
sub_98197C(imageId, 0, 0, stru.var_3, stru.var_4, stru.var_5, z, stru.var_0, stru.var_1, z + stru.var_3, get_current_rotation());
hasSupports = true;
return hasSupports;
}
/**
* rct2: 0x006A4101
* @param map_element (esi)
@@ -969,9 +880,9 @@ void loc_6A37C9(rct_map_element * map_element, int height, rct_footpath_entry *
ebx = ebp & 0xF;
if (byte_98D8A4[ebx] == 0) {
do_sub_6A2ECC(0, ax, height, dword_F3EF70, dword_F3EF6C, NULL);
path_a_supports_paint_setup(0, ax, height, dword_F3EF70, dword_F3EF6C, NULL);
} else {
do_sub_6A2ECC(1, ax, height, dword_F3EF70, dword_F3EF6C, NULL);
path_a_supports_paint_setup(1, ax, height, dword_F3EF70, dword_F3EF6C, NULL);
}
@@ -1114,7 +1025,7 @@ void loc_6A3B57(rct_map_element* mapElement, sint16 height, rct_footpath_entry*
RCT2_GLOBAL(0x00F3EF6C, rct_footpath_entry*) = footpathEntry;
for (sint8 i = 3; i > -1; --i) {
if (!(edges & (1 << i))) {
path_wooden_a_supports_paint_setup(supports[i], ax, height, imageFlags);
path_b_supports_paint_setup(supports[i], ax, height, imageFlags);
}
}

View File

@@ -517,11 +517,11 @@ bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, i
}
/**
* Some kind of supports
* rct2: 0x006A2ECC
*/
bool sub_6A2ECC(int supportType, int special, int height, uint32 imageColourFlags)
bool path_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry, bool * underground)
{
RCT2_GLOBAL(0xF3EF6C, rct_footpath_entry *) = pathEntry;
int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
RCT2_CALLFUNC_X(0x006A2ECC, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);
return eax & 0xFF;
@@ -531,7 +531,7 @@ bool sub_6A2ECC(int supportType, int special, int height, uint32 imageColourFlag
*
* rct2: 0x006A326B
*/
bool path_wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags)
bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags)
{
int eax = special, ebx = supportType, ecx = 0, edx = height, esi = 0, _edi = 0, ebp = imageColourFlags;
RCT2_CALLFUNC_X(0x006A326B, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);

View File

@@ -18,11 +18,13 @@
#define _DRAWING_SUPPORTS_H_
#include "../common.h"
#include "../world/footpath.h"
bool wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, bool* underground);
bool wooden_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags);
bool metal_a_supports_paint_setup(int supportType, int segment, int special, int height, uint32 imageColourFlags);
bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags);
bool path_wooden_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags);
bool path_a_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags, rct_footpath_entry * pathEntry, bool * underground);
bool path_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags);
#endif