Pass a bool to the set function. Make review changes

This commit is contained in:
duncanspumpkin 2019-02-25 20:44:12 +00:00
parent 737c308e4e
commit 112b40910b
13 changed files with 24 additions and 24 deletions

View file

@ -237,7 +237,7 @@ public:
if (flags & GAME_COMMAND_FLAG_GHOST)
{
tileElement->SetGhost();
tileElement->SetGhost(true);
}
map_invalidate_tile_full(flooredX, flooredY);

View file

@ -170,7 +170,7 @@ public:
if (flags & GAME_COMMAND_FLAG_GHOST)
{
newElement->SetGhost();
newElement->SetGhost(true);
}
entranceElement->SetDirection(_direction);

View file

@ -616,7 +616,7 @@ public:
tileElement->AsTrack()->SetTrackType(_trackType);
if (GetFlags() & GAME_COMMAND_FLAG_GHOST)
{
tileElement->SetGhost();
tileElement->SetGhost(true);
}
switch (_trackType)

View file

@ -157,8 +157,8 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction,
paint_util_push_tunnel_left(session, height, TUNNEL_6);
}
if (!is_exit && !(tile_element->IsGhost()) && tile_element->AsEntrance()->GetRideIndex() != 0xFF
&& stationObj->ScrollingMode != 0xFF)
if (!is_exit && !(tile_element->IsGhost()) && tile_element->AsEntrance()->GetRideIndex() != RIDE_ID_NULL
&& stationObj->ScrollingMode != SCROLLING_MODE_NONE)
{
set_format_arg(0, uint32_t, 0);
set_format_arg(4, uint32_t, 0);

View file

@ -2129,7 +2129,7 @@ static money32 place_maze_design(uint8_t flags, Ride* ride, uint16_t mazeEntry,
tileElement->AsTrack()->SetMazeEntry(mazeEntry);
if (flags & GAME_COMMAND_FLAG_GHOST)
{
tileElement->SetGhost();
tileElement->SetGhost(true);
}
map_invalidate_element(fx, fy, tileElement);

View file

@ -254,7 +254,7 @@ static money32 BannerPlace(
newTileElement->AsBanner()->SetIndex(*bannerIndex);
if (flags & GAME_COMMAND_FLAG_GHOST)
{
newTileElement->SetGhost();
newTileElement->SetGhost(true);
}
map_invalidate_tile_full(x, y);
map_animation_create(MAP_ANIMATION_TYPE_BANNER, x, y, newTileElement->base_height);

View file

@ -275,7 +275,7 @@ static money32 RideEntranceExitPlace(
if (flags & GAME_COMMAND_FLAG_GHOST)
{
tileElement->SetGhost();
tileElement->SetGhost(true);
}
if (isExit)

View file

@ -291,7 +291,7 @@ static money32 footpath_element_insert(
tileElement->AsPath()->SetAdditionStatus(255);
pathElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
if (flags & GAME_COMMAND_FLAG_GHOST)
pathElement->SetGhost();
pathElement->SetGhost(true);
footpath_queue_chain_reset();
@ -686,7 +686,7 @@ static money32 footpath_place_from_track(
tileElement->AsPath()->SetCorners(0);
pathElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
if (flags & (1 << 6))
pathElement->SetGhost();
pathElement->SetGhost(true);
map_invalidate_tile_full(x, y);
}

View file

@ -413,7 +413,7 @@ void map_strip_ghost_flag_from_elements()
{
for (auto& element : gTileElements)
{
element.ClearGhost();
element.SetGhost(false);
}
}
@ -2472,7 +2472,7 @@ void game_command_place_large_scenery(
if (flags & GAME_COMMAND_FLAG_GHOST)
{
new_tile_element->SetGhost();
new_tile_element->SetGhost(true);
}
if (tile_num == 0)

View file

@ -317,7 +317,7 @@ static money32 SmallSceneryPlace(
if (flags & GAME_COMMAND_FLAG_GHOST)
{
newElement->SetGhost();
newElement->SetGhost(true);
}
map_invalidate_tile_full(x, y);

View file

@ -53,15 +53,16 @@ bool TileElementBase::IsGhost() const
{
return (this->flags & TILE_ELEMENT_FLAG_GHOST) != 0;
}
void TileElementBase::SetGhost()
void TileElementBase::SetGhost(bool isGhost)
{
this->flags |= TILE_ELEMENT_FLAG_GHOST;
}
void TileElementBase::ClearGhost()
{
this->flags &= ~TILE_ELEMENT_FLAG_GHOST;
if (isGhost == true)
{
this->flags |= TILE_ELEMENT_FLAG_GHOST;
}
else
{
this->flags &= ~TILE_ELEMENT_FLAG_GHOST;
}
}
bool tile_element_is_underground(TileElement* tileElement)

View file

@ -71,8 +71,7 @@ struct TileElementBase
uint8_t GetDirectionWithOffset(uint8_t offset) const;
bool IsLastForTile() const;
bool IsGhost() const;
void SetGhost();
void ClearGhost();
void SetGhost(bool isGhost);
void Remove();
};

View file

@ -538,7 +538,7 @@ static money32 WallPlace(
if (flags & GAME_COMMAND_FLAG_GHOST)
{
tileElement->SetGhost();
tileElement->SetGhost(true);
}
gSceneryTileElement = tileElement;