forked from rosebudai/OpenRCT2-Web
Rename MapAnimation namespace to MapAnimations
This commit is contained in:
1 parent
d847c37fc8
commit
78c2b85b1d
21 files changed
+47
-47
No files matched your search
@@ -328,7 +328,7 @@ namespace OpenRCT2::Title
|
||||
parkImporter->Import(gameState);
|
||||
ReportProgress(100);
|
||||
|
||||
MapAnimation::MarkAllTiles();
|
||||
MapAnimations::MarkAllTiles();
|
||||
}
|
||||
PrepareParkForPlayback();
|
||||
_initialLoadCommand = false;
|
||||
@@ -384,7 +384,7 @@ namespace OpenRCT2::Title
|
||||
parkImporter->Import(gameState);
|
||||
ReportProgress(100);
|
||||
|
||||
MapAnimation::MarkAllTiles();
|
||||
MapAnimations::MarkAllTiles();
|
||||
}
|
||||
PrepareParkForPlayback();
|
||||
_initialLoadCommand = false;
|
||||
|
||||
@@ -820,7 +820,7 @@ namespace OpenRCT2
|
||||
_objectManager->LoadObjects(result.RequiredObjects, true);
|
||||
SetProgress(90, 100, STR_STRING_M_PERCENT);
|
||||
|
||||
MapAnimation::ClearAll();
|
||||
MapAnimations::ClearAll();
|
||||
// TODO: Have a separate GameState and exchange once loaded.
|
||||
auto& gameState = ::getGameState();
|
||||
parkImporter->Import(gameState);
|
||||
@@ -833,7 +833,7 @@ namespace OpenRCT2
|
||||
gCurrentLoadedPath = path;
|
||||
gFirstTimeSaving = true;
|
||||
GameFixSaveVars();
|
||||
MapAnimation::MarkAllTiles();
|
||||
MapAnimations::MarkAllTiles();
|
||||
EntityTweener::Get().Reset();
|
||||
gScreenAge = 0;
|
||||
gLastAutoSaveUpdate = kAutosavePause;
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace OpenRCT2
|
||||
RideMeasurementsUpdate();
|
||||
News::UpdateCurrentItem();
|
||||
|
||||
MapAnimation::InvalidateAndUpdateAll();
|
||||
MapAnimations::InvalidateAndUpdateAll();
|
||||
VehicleSoundsUpdate();
|
||||
PeepUpdateCrowdNoise();
|
||||
ClimateUpdateSound();
|
||||
|
||||
@@ -161,7 +161,7 @@ GameActions::Result BannerPlaceAction::Execute() const
|
||||
bannerElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST);
|
||||
|
||||
MapInvalidateTileFull(_loc);
|
||||
MapAnimation::MarkTileForInvalidation(_loc);
|
||||
MapAnimations::MarkTileForInvalidation(_loc);
|
||||
|
||||
res.Cost = bannerEntry->price;
|
||||
return res;
|
||||
|
||||
@@ -314,7 +314,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
|
||||
newSceneryElement->SetBannerIndex(banner->id);
|
||||
}
|
||||
|
||||
MapAnimation::MarkTileForInvalidation(curTile);
|
||||
MapAnimations::MarkTileForInvalidation(curTile);
|
||||
MapInvalidateTileFull(curTile);
|
||||
|
||||
if (tile.index == 0)
|
||||
|
||||
@@ -186,7 +186,7 @@ GameActions::Result ParkEntrancePlaceAction::Execute() const
|
||||
|
||||
if (index == 0)
|
||||
{
|
||||
MapAnimation::MarkTileForInvalidation(entranceLoc);
|
||||
MapAnimations::MarkTileForInvalidation(entranceLoc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const
|
||||
station.LastPeepInQueue = EntityId::GetNull();
|
||||
station.QueueLength = 0;
|
||||
|
||||
MapAnimation::MarkTileForInvalidation(_loc);
|
||||
MapAnimations::MarkTileForInvalidation(_loc);
|
||||
}
|
||||
|
||||
FootpathQueueChainReset();
|
||||
|
||||
@@ -452,11 +452,11 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const
|
||||
MapInvalidateTileFull(_loc);
|
||||
if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_CLOCK))
|
||||
{
|
||||
MapAnimation::MarkTileForUpdate(_loc);
|
||||
MapAnimations::MarkTileForUpdate(_loc);
|
||||
}
|
||||
else if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED))
|
||||
{
|
||||
MapAnimation::MarkTileForInvalidation(_loc);
|
||||
MapAnimations::MarkTileForInvalidation(_loc);
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
@@ -600,7 +600,7 @@ GameActions::Result TrackPlaceAction::Execute() const
|
||||
case TrackElemType::Whirlpool:
|
||||
[[fallthrough]];
|
||||
case TrackElemType::SpinningTunnel:
|
||||
MapAnimation::MarkTileForInvalidation(mapLoc);
|
||||
MapAnimations::MarkTileForInvalidation(mapLoc);
|
||||
break;
|
||||
case TrackElemType::Brakes:
|
||||
[[fallthrough]];
|
||||
|
||||
@@ -399,7 +399,7 @@ GameActions::Result WallPlaceAction::Execute() const
|
||||
|
||||
wallElement->SetGhost(GetFlags() & GAME_COMMAND_FLAG_GHOST);
|
||||
|
||||
MapAnimation::MarkTileForInvalidation(targetLoc);
|
||||
MapAnimations::MarkTileForInvalidation(targetLoc);
|
||||
MapInvalidateTileZoom1({ _loc, wallElement->GetBaseZ(), wallElement->GetBaseZ() + 72 });
|
||||
|
||||
res.Cost = wallEntry->price;
|
||||
|
||||
@@ -2848,13 +2848,13 @@ bool NetworkBase::LoadMap(IStream* stream)
|
||||
auto loadResult = importer->LoadFromStream(stream, false);
|
||||
objManager.LoadObjects(loadResult.RequiredObjects);
|
||||
|
||||
MapAnimation::ClearAll();
|
||||
MapAnimations::ClearAll();
|
||||
// TODO: Have a separate GameState and exchange once loaded.
|
||||
auto& gameState = getGameState();
|
||||
importer->Import(gameState);
|
||||
|
||||
EntityTweener::Get().Reset();
|
||||
MapAnimation::MarkAllTiles();
|
||||
MapAnimations::MarkAllTiles();
|
||||
|
||||
gLastAutoSaveUpdate = kAutosavePause;
|
||||
result = true;
|
||||
|
||||
@@ -1468,14 +1468,14 @@ namespace OpenRCT2::RCT1
|
||||
switch (mapAnimation.Type)
|
||||
{
|
||||
case kRCT12MapAnimationTypeOnRidePhoto:
|
||||
MapAnimation::CreateTemporary(
|
||||
MapAnimations::CreateTemporary(
|
||||
{ mapAnimation.x, mapAnimation.y, (mapAnimation.BaseZ / 2) * kCoordsZStep },
|
||||
MapAnimation::TemporaryType::onRidePhoto);
|
||||
MapAnimations::TemporaryType::onRidePhoto);
|
||||
break;
|
||||
case kRCT12MapAnimationTypeLandEdgeDoor:
|
||||
MapAnimation::CreateTemporary(
|
||||
MapAnimations::CreateTemporary(
|
||||
{ mapAnimation.x, mapAnimation.y, (mapAnimation.BaseZ / 2) * kCoordsZStep },
|
||||
MapAnimation::TemporaryType::landEdgeDoor);
|
||||
MapAnimations::TemporaryType::landEdgeDoor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1029,9 +1029,9 @@ namespace OpenRCT2::RCT2
|
||||
switch (mapAnimation.Type)
|
||||
{
|
||||
case kRCT12MapAnimationTypeOnRidePhoto:
|
||||
MapAnimation::CreateTemporary(
|
||||
MapAnimations::CreateTemporary(
|
||||
{ mapAnimation.x, mapAnimation.y, mapAnimation.BaseZ * kCoordsZStep },
|
||||
MapAnimation::TemporaryType::onRidePhoto);
|
||||
MapAnimations::TemporaryType::onRidePhoto);
|
||||
break;
|
||||
case kRCT12MapAnimationTypeWallDoor:
|
||||
{
|
||||
@@ -1051,7 +1051,7 @@ namespace OpenRCT2::RCT2
|
||||
}
|
||||
|
||||
tileElement->AsWall()->SetIsAnimating(true);
|
||||
MapAnimation::MarkTileForUpdate(coords);
|
||||
MapAnimations::MarkTileForUpdate(coords);
|
||||
} while (!(tileElement++)->IsLastForTile());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6316,7 +6316,7 @@ static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ&
|
||||
door->SetIsAnimating(true);
|
||||
play_scenery_door_open_sound(trackLocation, door);
|
||||
|
||||
MapAnimation::MarkTileForUpdate(doorLocation);
|
||||
MapAnimations::MarkTileForUpdate(doorLocation);
|
||||
}
|
||||
|
||||
if (isLastVehicle)
|
||||
@@ -6326,7 +6326,7 @@ static void AnimateSceneryDoor(const CoordsXYZD& doorLocation, const CoordsXYZ&
|
||||
door->SetIsAnimating(true);
|
||||
play_scenery_door_close_sound(trackLocation, door);
|
||||
|
||||
MapAnimation::MarkTileForUpdate(doorLocation);
|
||||
MapAnimations::MarkTileForUpdate(doorLocation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6357,7 +6357,7 @@ static void AnimateLandscapeDoor(const CoordsXYZ& doorLocation, TrackElement& tr
|
||||
else
|
||||
trackElement.SetDoorBState(kLandEdgeDoorFrameOpening);
|
||||
|
||||
MapAnimation::CreateTemporary(doorLocation, MapAnimation::TemporaryType::landEdgeDoor);
|
||||
MapAnimations::CreateTemporary(doorLocation, MapAnimations::TemporaryType::landEdgeDoor);
|
||||
}
|
||||
|
||||
if (isLastVehicle)
|
||||
@@ -6367,7 +6367,7 @@ static void AnimateLandscapeDoor(const CoordsXYZ& doorLocation, TrackElement& tr
|
||||
else
|
||||
trackElement.SetDoorBState(kLandEdgeDoorFrameClosing);
|
||||
|
||||
MapAnimation::CreateTemporary(doorLocation, MapAnimation::TemporaryType::landEdgeDoor);
|
||||
MapAnimations::CreateTemporary(doorLocation, MapAnimations::TemporaryType::landEdgeDoor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7102,7 +7102,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(
|
||||
if (trackType == TrackElemType::OnRidePhoto)
|
||||
{
|
||||
tileElement->AsTrack()->SetPhotoTimeout();
|
||||
MapAnimation::CreateTemporary(TrackLocation, MapAnimation::TemporaryType::onRidePhoto);
|
||||
MapAnimations::CreateTemporary(TrackLocation, MapAnimations::TemporaryType::onRidePhoto);
|
||||
}
|
||||
if (trackType == TrackElemType::RotationControlToggle)
|
||||
{
|
||||
|
||||
@@ -914,7 +914,7 @@ void FootpathChainRideQueue(
|
||||
lastPathElement->AsPath()->SetHasQueueBanner(true);
|
||||
lastPathElement->AsPath()->SetQueueBannerDirection(lastPathDirection); // set the ride sign direction
|
||||
|
||||
MapAnimation::MarkTileForInvalidation(lastPath);
|
||||
MapAnimations::MarkTileForInvalidation(lastPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ void MapInit(const TileCoordsXY& size)
|
||||
gameState.widePathTileLoopPosition = {};
|
||||
gameState.mapSize = size;
|
||||
MapRemoveOutOfRangeElements();
|
||||
MapAnimation::ClearAll();
|
||||
MapAnimations::ClearAll();
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_MAP);
|
||||
ContextBroadcastIntent(&intent);
|
||||
@@ -2407,5 +2407,5 @@ void ShiftMap(const TileCoordsXY& amount)
|
||||
id = BannerIndex::FromUnderlying(id.ToUnderlying() + 1);
|
||||
}
|
||||
|
||||
MapAnimation::ShiftAll(amountToMove);
|
||||
MapAnimations::ShiftAll(amountToMove);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ constexpr ZoomLevel kMaxZoom{ 1 };
|
||||
struct TemporaryMapAnimation
|
||||
{
|
||||
CoordsXYZ location{};
|
||||
MapAnimation::TemporaryType type{};
|
||||
MapAnimations::TemporaryType type{};
|
||||
|
||||
bool operator<(const TemporaryMapAnimation& rhs) const
|
||||
{
|
||||
@@ -429,7 +429,7 @@ static bool UpdateTemporaryAnimation(const TemporaryMapAnimation& animation)
|
||||
{
|
||||
switch (animation.type)
|
||||
{
|
||||
case MapAnimation::TemporaryType::onRidePhoto:
|
||||
case MapAnimations::TemporaryType::onRidePhoto:
|
||||
{
|
||||
if (tileElement->GetType() == TileElementType::Track && tileElement->BaseHeight == tileCoords.z
|
||||
&& tileElement->AsTrack()->GetTrackType() == TrackElemType::OnRidePhoto)
|
||||
@@ -438,7 +438,7 @@ static bool UpdateTemporaryAnimation(const TemporaryMapAnimation& animation)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MapAnimation::TemporaryType::landEdgeDoor:
|
||||
case MapAnimations::TemporaryType::landEdgeDoor:
|
||||
{
|
||||
if (tileElement->GetType() == TileElementType::Track && tileElement->BaseHeight == tileCoords.z)
|
||||
{
|
||||
@@ -545,7 +545,7 @@ static std::optional<UpdateType> IsElementAnimated(const TileElementBase& elemen
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void MapAnimation::MarkTileForInvalidation(const CoordsXY coords)
|
||||
void MapAnimations::MarkTileForInvalidation(const CoordsXY coords)
|
||||
{
|
||||
const TileCoordsXY tileCoords(coords);
|
||||
if (!_mapAnimationsUpdate.contains(tileCoords))
|
||||
@@ -554,19 +554,19 @@ void MapAnimation::MarkTileForInvalidation(const CoordsXY coords)
|
||||
}
|
||||
}
|
||||
|
||||
void MapAnimation::MarkTileForUpdate(const CoordsXY coords)
|
||||
void MapAnimations::MarkTileForUpdate(const CoordsXY coords)
|
||||
{
|
||||
const TileCoordsXY tileCoords(coords);
|
||||
_mapAnimationsInvalidate.erase(tileCoords);
|
||||
_mapAnimationsUpdate.insert(tileCoords);
|
||||
}
|
||||
|
||||
void MapAnimation::CreateTemporary(const CoordsXYZ& coords, const TemporaryType type)
|
||||
void MapAnimations::CreateTemporary(const CoordsXYZ& coords, const TemporaryType type)
|
||||
{
|
||||
_temporaryMapAnimations.insert(TemporaryMapAnimation{ coords, type });
|
||||
}
|
||||
|
||||
void MapAnimation::MarkAllTiles()
|
||||
void MapAnimations::MarkAllTiles()
|
||||
{
|
||||
TileElementIterator it;
|
||||
TileElementIteratorBegin(&it);
|
||||
@@ -671,7 +671,7 @@ static void UpdateAll(const ViewportList& viewports)
|
||||
}
|
||||
}
|
||||
|
||||
void MapAnimation::InvalidateAndUpdateAll()
|
||||
void MapAnimations::InvalidateAndUpdateAll()
|
||||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
@@ -695,14 +695,14 @@ void MapAnimation::InvalidateAndUpdateAll()
|
||||
}
|
||||
}
|
||||
|
||||
void MapAnimation::ClearAll()
|
||||
void MapAnimations::ClearAll()
|
||||
{
|
||||
_mapAnimationsInvalidate.clear();
|
||||
_mapAnimationsUpdate.clear();
|
||||
_temporaryMapAnimations.clear();
|
||||
}
|
||||
|
||||
void MapAnimation::ShiftAll(const CoordsXY amount)
|
||||
void MapAnimations::ShiftAll(const CoordsXY amount)
|
||||
{
|
||||
if (amount.x == 0 && amount.y == 0)
|
||||
return;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "Location.hpp"
|
||||
|
||||
namespace OpenRCT2::MapAnimation
|
||||
namespace OpenRCT2::MapAnimations
|
||||
{
|
||||
enum class TemporaryType : uint8_t
|
||||
{
|
||||
@@ -26,4 +26,4 @@ namespace OpenRCT2::MapAnimation
|
||||
void InvalidateAndUpdateAll();
|
||||
void ClearAll();
|
||||
void ShiftAll(const CoordsXY amount);
|
||||
} // namespace OpenRCT2::MapAnimation
|
||||
} // namespace OpenRCT2::MapAnimations
|
||||
@@ -349,7 +349,7 @@ namespace OpenRCT2::TileInspector
|
||||
*pastedElement = element;
|
||||
pastedElement->SetLastForTile(lastForTile);
|
||||
|
||||
MapAnimation::MarkTileForUpdate(tileLoc.ToCoordsXY());
|
||||
MapAnimations::MarkTileForUpdate(tileLoc.ToCoordsXY());
|
||||
|
||||
if (IsTileSelected(loc))
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ static std::unique_ptr<IContext> localStartGame(const std::string& parkPath)
|
||||
auto loadResult = importer->LoadSavedGame(parkPath.c_str(), false);
|
||||
context->GetObjectManager().LoadObjects(loadResult.RequiredObjects);
|
||||
|
||||
MapAnimation::ClearAll();
|
||||
MapAnimations::ClearAll();
|
||||
// TODO: Have a separate GameState and exchange once loaded.
|
||||
auto& gameState = getGameState();
|
||||
importer->Import(gameState);
|
||||
@@ -61,7 +61,7 @@ static std::unique_ptr<IContext> localStartGame(const std::string& parkPath)
|
||||
ResetAllSpriteQuadrantPlacements();
|
||||
LoadPalette();
|
||||
EntityTweener::Get().Reset();
|
||||
MapAnimation::MarkAllTiles();
|
||||
MapAnimations::MarkAllTiles();
|
||||
FixInvalidVehicleSpriteSizes();
|
||||
|
||||
gGameSpeed = 1;
|
||||
|
||||
@@ -67,7 +67,7 @@ static void GameInit(bool retainSpatialIndices)
|
||||
ResetAllSpriteQuadrantPlacements();
|
||||
LoadPalette();
|
||||
EntityTweener::Get().Reset();
|
||||
MapAnimation::MarkAllTiles();
|
||||
MapAnimations::MarkAllTiles();
|
||||
FixInvalidVehicleSpriteSizes();
|
||||
|
||||
gGameSpeed = 1;
|
||||
@@ -83,7 +83,7 @@ static bool ImportS6(MemoryStream& stream, std::unique_ptr<IContext>& context, b
|
||||
auto loadResult = importer->LoadFromStream(&stream, false);
|
||||
objManager.LoadObjects(loadResult.RequiredObjects);
|
||||
|
||||
MapAnimation::ClearAll();
|
||||
MapAnimations::ClearAll();
|
||||
// TODO: Have a separate GameState and exchange once loaded.
|
||||
auto& gameState = getGameState();
|
||||
importer->Import(gameState);
|
||||
|
||||
Reference in new issue
Block a user