Refactor large scenery tile flags field

This commit is contained in:
Ted John 2017-12-17 16:35:03 +00:00 committed by Gymnasiast
parent f11973f692
commit 7c05e22cd0
4 changed files with 14 additions and 7 deletions

View File

@ -39,7 +39,7 @@ static void large_scenery_paint_supports(
uint32 dword_F4387C,
rct_large_scenery_tile * tile)
{
if (tile->var_7 & 0x20) {
if (tile->flags & LARGE_SCENERY_TILE_FLAG_NO_SUPPORTS) {
return;
}
@ -61,7 +61,7 @@ static void large_scenery_paint_supports(
sint32 clearanceHeight = ceil2(tileElement->clearance_height * 8 + 15, 16);
if (tile->var_7 & 0x40) {
if (tile->flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE) {
paint_util_set_segment_support_height(session, SEGMENTS_ALL, clearanceHeight, 0x20);
} else {
paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
@ -232,7 +232,7 @@ void large_scenery_paint(paint_session * session, uint8 direction, uint16 height
ah = 0x80;
}
ah -= 3;
uint16 edi = tile->var_7;
uint16 edi = tile->flags;
sint32 esi = 16;
if (edi & 0xF00) {
edi &= 0xF000;

View File

@ -2822,7 +2822,7 @@ void game_command_place_large_scenery(sint32* eax, sint32* ebx, sint32* ecx, sin
sint32 zLow = (tile->z_offset + maxHeight) / 8;
sint32 zHigh = (tile->z_clearance / 8) + zLow;
sint32 bx = tile->var_7 >> 12;
sint32 bx = tile->flags >> 12;
bx <<= rotation;
uint8 bl = bx;
uint8 bh = bl >> 4;

View File

@ -56,15 +56,22 @@ struct rct_large_scenery_tile {
sint16 y_offset;
sint16 z_offset;
uint8 z_clearance;
uint16 var_7;
// CCCC WWWW 0SS0 0000
uint16 flags;
};
assert_struct_size(rct_large_scenery_tile, 9);
enum
{
LARGE_SCENERY_TILE_FLAG_NO_SUPPORTS = 0x20,
LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE = 0x40,
};
struct rct_large_scenery_text_glyph {
uint8 image_offset;
uint8 width;
uint8 height;
uint8 var_3;
uint8 pad_3;
};
assert_struct_size(rct_large_scenery_text_glyph, 4);

View File

@ -222,7 +222,7 @@ static bool WallCheckObstruction(rct_scenery_entry * wall,
tile = &entry->large_scenery.tiles[sequence];
{
sint32 direction = ((edge - tile_element_get_direction(tileElement)) & TILE_ELEMENT_DIRECTION_MASK) + 8;
if (!(tile->var_7 & (1 << direction)))
if (!(tile->flags & (1 << direction)))
{
map_obstruction_set_error_text(tileElement);
return false;