1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00

Clean up scenery ghost flags

This commit is contained in:
Gymnasiast
2018-12-15 14:41:07 +01:00
parent d88a9048f9
commit 0d775f48ec
3 changed files with 15 additions and 24 deletions

View File

@@ -2432,7 +2432,7 @@ static money32 try_place_ghost_scenery(
viewport_set_visibility(5);
}
gSceneryGhostType |= (1 << 0);
gSceneryGhostType |= SCENERY_GHOST_FLAG_0;
break;
case 1:
// Path Bits
@@ -2454,7 +2454,7 @@ static money32 try_place_ghost_scenery(
gSceneryPlacePathType = ((parameter_2 >> 8) & 0xFF);
gSceneryGhostPathObjectType = parameter_3;
gSceneryGhostType |= (1 << 1);
gSceneryGhostType |= SCENERY_GHOST_FLAG_1;
break;
case 2:
// Walls
@@ -2473,7 +2473,7 @@ static money32 try_place_ghost_scenery(
tileElement = gSceneryTileElement;
gSceneryGhostPosition.z = tileElement->base_height;
gSceneryGhostType |= (1 << 2);
gSceneryGhostType |= SCENERY_GHOST_FLAG_2;
break;
case 3:
// Large Scenery
@@ -2503,7 +2503,7 @@ static money32 try_place_ghost_scenery(
viewport_set_visibility(5);
}
gSceneryGhostType |= (1 << 3);
gSceneryGhostType |= SCENERY_GHOST_FLAG_3;
break;
case 4:
// Banners
@@ -2518,7 +2518,7 @@ static money32 try_place_ghost_scenery(
gSceneryGhostPosition.y = map_tile.y;
gSceneryGhostPosition.z = (parameter_2 & 0xFF) * 2 + 2;
gSceneryPlaceRotation = ((parameter_2 >> 8) & 0xFF);
gSceneryGhostType |= (1 << 4);
gSceneryGhostType |= SCENERY_GHOST_FLAG_4;
break;
}

View File

@@ -181,18 +181,18 @@ void scenery_remove_ghost_tool_placement()
y = gSceneryGhostPosition.y;
z = gSceneryGhostPosition.z;
if (gSceneryGhostType & SCENERY_ENTRY_FLAG_0)
if (gSceneryGhostType & SCENERY_GHOST_FLAG_0)
{
gSceneryGhostType &= ~SCENERY_ENTRY_FLAG_0;
gSceneryGhostType &= ~SCENERY_GHOST_FLAG_0;
uint8_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5
| GAME_COMMAND_FLAG_GHOST;
game_do_command(
x, flags | (gSceneryQuadrant << 8), y, z | (gSceneryPlaceObject << 8), GAME_COMMAND_REMOVE_SCENERY, 0, 0);
}
if (gSceneryGhostType & SCENERY_ENTRY_FLAG_1)
if (gSceneryGhostType & SCENERY_GHOST_FLAG_1)
{
gSceneryGhostType &= ~SCENERY_ENTRY_FLAG_1;
gSceneryGhostType &= ~SCENERY_GHOST_FLAG_1;
TileElement* tileElement = map_get_first_element_at(x / 32, y / 32);
do
@@ -210,9 +210,9 @@ void scenery_remove_ghost_tool_placement()
} while (!(tileElement++)->IsLastForTile());
}
if (gSceneryGhostType & SCENERY_ENTRY_FLAG_2)
if (gSceneryGhostType & SCENERY_GHOST_FLAG_2)
{
gSceneryGhostType &= ~SCENERY_ENTRY_FLAG_2;
gSceneryGhostType &= ~SCENERY_GHOST_FLAG_2;
TileCoordsXYZD wallLocation = { x >> 5, y >> 5, z, gSceneryGhostWallRotation };
auto wallRemoveAction = WallRemoveAction(wallLocation);
@@ -220,15 +220,15 @@ void scenery_remove_ghost_tool_placement()
wallRemoveAction.Execute();
}
if (gSceneryGhostType & SCENERY_ENTRY_FLAG_3)
if (gSceneryGhostType & SCENERY_GHOST_FLAG_3)
{
gSceneryGhostType &= ~SCENERY_ENTRY_FLAG_3;
gSceneryGhostType &= ~SCENERY_GHOST_FLAG_3;
game_do_command(x, 105 | (gSceneryPlaceRotation << 8), y, z, GAME_COMMAND_REMOVE_LARGE_SCENERY, 0, 0);
}
if (gSceneryGhostType & SCENERY_ENTRY_FLAG_4)
if (gSceneryGhostType & SCENERY_GHOST_FLAG_4)
{
gSceneryGhostType &= ~SCENERY_ENTRY_FLAG_4;
gSceneryGhostType &= ~SCENERY_GHOST_FLAG_4;
game_do_command(x, 105, y, z | (gSceneryPlaceRotation << 8), GAME_COMMAND_REMOVE_BANNER, 0, 0);
}
}

View File

@@ -229,15 +229,6 @@ enum
SCENERY_TYPE_BANNER
};
enum
{
SCENERY_ENTRY_FLAG_0 = (1 << 0),
SCENERY_ENTRY_FLAG_1 = (1 << 1),
SCENERY_ENTRY_FLAG_2 = (1 << 2),
SCENERY_ENTRY_FLAG_3 = (1 << 3),
SCENERY_ENTRY_FLAG_4 = (1 << 4)
};
enum
{
SCENERY_GHOST_FLAG_0 = (1 << SCENERY_TYPE_SMALL),