From 0b5fc962eb1cda31e28e86b80301504511666c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:27:48 +0200 Subject: [PATCH 01/12] Rename variables/members sprite to entity --- src/openrct2/Editor.cpp | 2 +- src/openrct2/GameState.cpp | 2 +- src/openrct2/ParkFile.cpp | 2 +- src/openrct2/world/Entity.h | 8 ++++---- src/openrct2/world/Sprite.cpp | 18 +++++++++--------- src/openrct2/world/Sprite.h | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 87e10485dc..72f815119d 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -348,7 +348,7 @@ namespace Editor staff->SetName({}); } - reset_sprite_list(); + ResetAllEntities(); staff_reset_modes(); gNumGuestsInPark = 0; gNumGuestsHeadingForPark = 0; diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index f3ecffb6b0..148a78fcf5 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -63,7 +63,7 @@ void GameState::InitAll(int32_t mapSize) finance_init(); banner_init(); ride_init_all(); - reset_sprite_list(); + ResetAllEntities(); staff_reset_modes(); date_reset(); climate_reset(ClimateType::CoolAndWet); diff --git a/src/openrct2/ParkFile.cpp b/src/openrct2/ParkFile.cpp index 5529f05915..ffbf1ad0fc 100644 --- a/src/openrct2/ParkFile.cpp +++ b/src/openrct2/ParkFile.cpp @@ -2181,7 +2181,7 @@ namespace OpenRCT2 os.ReadWriteChunk(ParkFileChunkType::ENTITIES, [this, &os](OrcaStream::ChunkStream& cs) { if (cs.GetMode() == OrcaStream::Mode::READING) { - reset_sprite_list(); + ResetAllEntities(); } std::vector entityIndices; diff --git a/src/openrct2/world/Entity.h b/src/openrct2/world/Entity.h index ca438cbf8f..baf7b79ef0 100644 --- a/src/openrct2/world/Entity.h +++ b/src/openrct2/world/Entity.h @@ -13,18 +13,18 @@ constexpr uint16_t MAX_ENTITIES = 65535; -EntityBase* try_get_sprite(size_t spriteIndex); -EntityBase* get_sprite(size_t sprite_idx); +EntityBase* TryGetEntity(size_t spriteIndex); +EntityBase* GetEntity(size_t sprite_idx); template T* GetEntity(size_t sprite_idx) { - auto spr = get_sprite(sprite_idx); + auto spr = GetEntity(sprite_idx); return spr != nullptr ? spr->As() : nullptr; } template T* TryGetEntity(size_t sprite_idx) { - auto spr = try_get_sprite(sprite_idx); + auto spr = TryGetEntity(sprite_idx); return spr != nullptr ? spr->As() : nullptr; } diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index d24f4d7885..7b2fd74e0f 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -43,7 +43,7 @@ static bool _spriteFlashingList[MAX_ENTITIES]; constexpr const uint32_t SPATIAL_INDEX_SIZE = (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) + 1; constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; -static std::array, SPATIAL_INDEX_SIZE> gSpriteSpatialIndex; +static std::array, SPATIAL_INDEX_SIZE> gEntitySpatialIndex; static void FreeEntity(EntityBase& entity); @@ -132,24 +132,24 @@ std::string rct_sprite_checksum::ToString() const return result; } -EntityBase* try_get_sprite(size_t spriteIndex) +EntityBase* TryGetEntity(size_t spriteIndex) { return spriteIndex >= MAX_ENTITIES ? nullptr : &_spriteList[spriteIndex].base; } -EntityBase* get_sprite(size_t spriteIndex) +EntityBase* GetEntity(size_t spriteIndex) { if (spriteIndex == SPRITE_INDEX_NULL) { return nullptr; } openrct2_assert(spriteIndex < MAX_ENTITIES, "Tried getting sprite %u", spriteIndex); - return try_get_sprite(spriteIndex); + return TryGetEntity(spriteIndex); } const std::vector& GetEntityTileList(const CoordsXY& spritePos) { - return gSpriteSpatialIndex[GetSpatialIndexOffset(spritePos)]; + return gEntitySpatialIndex[GetSpatialIndexOffset(spritePos)]; } void EntityBase::Invalidate() @@ -216,7 +216,7 @@ const std::list& GetEntityList(const EntityType id) * * rct2: 0x0069EB13 */ -void reset_sprite_list() +void ResetAllEntities() { gSavedAge = 0; @@ -261,7 +261,7 @@ static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc); */ void reset_sprite_spatial_index() { - for (auto& vec : gSpriteSpatialIndex) + for (auto& vec : gEntitySpatialIndex) { vec.clear(); } @@ -458,7 +458,7 @@ void sprite_misc_update_all() static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc) { size_t newIndex = GetSpatialIndexOffset(newLoc); - auto& spatialVector = gSpriteSpatialIndex[newIndex]; + auto& spatialVector = gEntitySpatialIndex[newIndex]; auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), sprite->sprite_index); spatialVector.insert(index, sprite->sprite_index); } @@ -466,7 +466,7 @@ static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc) static void SpriteSpatialRemove(EntityBase* sprite) { size_t currentIndex = GetSpatialIndexOffset({ sprite->x, sprite->y }); - auto& spatialVector = gSpriteSpatialIndex[currentIndex]; + auto& spatialVector = gEntitySpatialIndex[currentIndex]; auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), sprite->sprite_index); if (index != std::end(spatialVector) && *index == sprite->sprite_index) { diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index c148046607..ec0309b452 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -40,7 +40,7 @@ struct rct_sprite_checksum #pragma pack(pop) -void reset_sprite_list(); +void ResetAllEntities(); void reset_sprite_spatial_index(); void sprite_misc_update_all(); void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite); From 046f82f683827d1e32517c3f4cbe556ead762d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:29:13 +0200 Subject: [PATCH 02/12] Remove default template argument and re-order functions --- src/openrct2/world/Entity.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/Entity.h b/src/openrct2/world/Entity.h index baf7b79ef0..df933daa04 100644 --- a/src/openrct2/world/Entity.h +++ b/src/openrct2/world/Entity.h @@ -13,22 +13,24 @@ constexpr uint16_t MAX_ENTITIES = 65535; -EntityBase* TryGetEntity(size_t spriteIndex); EntityBase* GetEntity(size_t sprite_idx); -template T* GetEntity(size_t sprite_idx) +template T* GetEntity(size_t sprite_idx) { auto spr = GetEntity(sprite_idx); return spr != nullptr ? spr->As() : nullptr; } -template T* TryGetEntity(size_t sprite_idx) +EntityBase* TryGetEntity(size_t spriteIndex); + +template T* TryGetEntity(size_t sprite_idx) { auto spr = TryGetEntity(sprite_idx); return spr != nullptr ? spr->As() : nullptr; } EntityBase* CreateEntity(EntityType type); + template T* CreateEntity() { return static_cast(CreateEntity(T::cEntityType)); From c6242fd310fd762397b835161ec7705fc8b0cd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:37:47 +0200 Subject: [PATCH 03/12] More renaming --- src/openrct2-ui/title/TitleSequencePlayer.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 4 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 8 +- src/openrct2/Game.cpp | 4 +- src/openrct2/GameState.cpp | 2 +- src/openrct2/GameStateSnapshots.cpp | 20 +-- src/openrct2/ReplayManager.cpp | 10 +- src/openrct2/actions/SetCheatAction.cpp | 2 +- src/openrct2/actions/StaffHireNewAction.cpp | 2 +- src/openrct2/cmdline/SimulateCommands.cpp | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 2 +- src/openrct2/network/NetworkBase.cpp | 4 +- src/openrct2/peep/Peep.cpp | 2 +- src/openrct2/ride/RideConstruction.cpp | 6 +- .../scripting/bindings/entity/ScEntity.hpp | 2 +- src/openrct2/world/Balloon.cpp | 2 +- src/openrct2/world/Duck.cpp | 2 +- src/openrct2/world/EntityTweener.cpp | 4 +- src/openrct2/world/Footpath.cpp | 2 +- src/openrct2/world/Fountain.cpp | 2 +- src/openrct2/world/Litter.cpp | 4 +- src/openrct2/world/MoneyEffect.cpp | 2 +- src/openrct2/world/Particle.cpp | 12 +- src/openrct2/world/Sprite.cpp | 134 +++++++++--------- src/openrct2/world/Sprite.h | 28 ++-- test/tests/PlayTests.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 28 files changed, 135 insertions(+), 135 deletions(-) diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index e9271b8212..d0e954a21f 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -456,7 +456,7 @@ private: { auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); windowManager->SetMainView(gSavedView, gSavedViewZoom, gSavedViewRotation); - reset_sprite_spatial_index(); + ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); context_broadcast_intent(&intent); diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index d26fc6ac55..6c9cf7c723 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -620,14 +620,14 @@ public: for (auto peep : EntityList()) { - sprite_set_flashing(peep, false); + EntitySetFlashing(peep, false); if (peep->OutsideOfPark) continue; if (_selectedFilter) { if (!IsPeepInFilter(*peep)) continue; - sprite_set_flashing(peep, true); + EntitySetFlashing(peep, true); } if (!GuestShouldBeVisible(*peep)) continue; diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 530bdc8fa6..a04abb06da 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1055,7 +1055,7 @@ static void DrawMapPeepPixel(Peep* peep, const uint8_t flashColour, rct_drawpixe auto leftTop = ScreenCoordsXY{ c.x, c.y }; auto rightBottom = leftTop; uint8_t colour = DefaultPeepMapColour; - if (sprite_get_flashing(peep)) + if (EntityGetFlashing(peep)) { colour = flashColour; // If flashing then map peep pixel size is increased (by moving left top downwards) diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 5004cf4cac..64758ff7f1 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -191,10 +191,10 @@ public: gWindowMapFlashingFlags |= MapFlashingFlags::StaffListOpen; for (auto peep : EntityList()) { - sprite_set_flashing(peep, false); + EntitySetFlashing(peep, false); if (peep->AssignedStaffType == GetSelectedStaffType()) { - sprite_set_flashing(peep, true); + EntitySetFlashing(peep, true); } } } @@ -485,10 +485,10 @@ public: for (auto peep : EntityList()) { - sprite_set_flashing(peep, false); + EntitySetFlashing(peep, false); if (peep->AssignedStaffType == GetSelectedStaffType()) { - sprite_set_flashing(peep, true); + EntitySetFlashing(peep, true); _staffList.push_back(peep->sprite_index); } } diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 7113a7e4e7..938d384056 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -462,7 +462,7 @@ void game_fix_save_vars() if (!peepsToRemove.empty()) { // Some broken saves have broken spatial indexes - reset_sprite_spatial_index(); + ResetEntitySpatialIndices(); } for (auto ptr : peepsToRemove) @@ -543,7 +543,7 @@ void game_load_init() { GameActions::ClearQueue(); } - reset_sprite_spatial_index(); + ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); scenery_set_default_placement_configuration(); diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 148a78fcf5..a5b540a498 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -326,7 +326,7 @@ void GameState::UpdateLogic(LogicTimings* timings) report_time(LogicTimePart::MapRestoreProvisionalElements); vehicle_update_all(); report_time(LogicTimePart::Vehicle); - sprite_misc_update_all(); + UpdateAllMiscEntities(); report_time(LogicTimePart::Misc); Ride::UpdateAll(); report_time(LogicTimePart::Ride); diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 801b42a385..0f507702bd 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -56,7 +56,7 @@ struct GameStateSnapshot_t } // Must pass a function that can access the sprite. - void SerialiseSprites(std::function getEntity, const size_t numSprites, bool saving) + void SerialiseSprites(std::function getEntity, const size_t numSprites, bool saving) { const bool loading = !saving; @@ -99,7 +99,7 @@ struct GameStateSnapshot_t ds << indexTable[i]; const uint32_t spriteIdx = indexTable[i]; - rct_sprite* entity = getEntity(spriteIdx); + Entity* entity = getEntity(spriteIdx); if (entity == nullptr) { log_error("Entity index corrupted!"); @@ -171,7 +171,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots virtual void Capture(GameStateSnapshot_t& snapshot) override final { snapshot.SerialiseSprites( - [](const size_t index) { return reinterpret_cast(GetEntity(index)); }, MAX_ENTITIES, true); + [](const size_t index) { return reinterpret_cast(GetEntity(index)); }, MAX_ENTITIES, true); // log_info("Snapshot size: %u bytes", static_cast(snapshot.storedSprites.GetLength())); } @@ -194,9 +194,9 @@ struct GameStateSnapshots final : public IGameStateSnapshots ds << snapshot.parkParameters; } - std::vector BuildSpriteList(GameStateSnapshot_t& snapshot) const + std::vector BuildSpriteList(GameStateSnapshot_t& snapshot) const { - std::vector spriteList; + std::vector spriteList; spriteList.resize(MAX_ENTITIES); for (auto& sprite : spriteList) @@ -536,7 +536,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(ExplosionFlare, frame); } - void CompareSpriteData(const rct_sprite& spriteBase, const rct_sprite& spriteCmp, GameStateSpriteChange_t& changeData) const + void CompareSpriteData(const Entity& spriteBase, const Entity& spriteCmp, GameStateSpriteChange_t& changeData) const { CompareSpriteDataCommon(spriteBase.base, spriteCmp.base, changeData); if (spriteBase.base.Type == spriteCmp.base.Type) @@ -618,16 +618,16 @@ struct GameStateSnapshots final : public IGameStateSnapshots res.srand0Left = base.srand0; res.srand0Right = cmp.srand0; - std::vector spritesBase = BuildSpriteList(const_cast(base)); - std::vector spritesCmp = BuildSpriteList(const_cast(cmp)); + std::vector spritesBase = BuildSpriteList(const_cast(base)); + std::vector spritesCmp = BuildSpriteList(const_cast(cmp)); for (uint32_t i = 0; i < static_cast(spritesBase.size()); i++) { GameStateSpriteChange_t changeData; changeData.spriteIndex = i; - const rct_sprite& spriteBase = spritesBase[i]; - const rct_sprite& spriteCmp = spritesCmp[i]; + const Entity& spriteBase = spritesBase[i]; + const Entity& spriteCmp = spritesCmp[i]; changeData.entityType = spriteBase.base.Type; diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 11ce4acfa5..8846137cbc 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -92,7 +92,7 @@ namespace OpenRCT2 uint32_t tickStart; // First tick of replay. uint32_t tickEnd; // Last tick of replay. std::multiset commands; - std::vector> checksums; + std::vector> checksums; uint32_t checksumIndex; OpenRCT2::MemoryStream gameStateSnapshots; }; @@ -148,7 +148,7 @@ namespace OpenRCT2 _currentRecording->commands.emplace(gCurrentTicks, std::move(ga), _commandId++); } - void AddChecksum(uint32_t tick, rct_sprite_checksum&& checksum) + void AddChecksum(uint32_t tick, EntitiesChecksum&& checksum) { _currentRecording->checksums.emplace_back(std::make_pair(tick, std::move(checksum))); } @@ -161,7 +161,7 @@ namespace OpenRCT2 if ((_mode == ReplayMode::RECORDING || _mode == ReplayMode::NORMALISATION) && gCurrentTicks == _nextChecksumTick) { - rct_sprite_checksum checksum = sprite_checksum(); + EntitiesChecksum checksum = GetAllEntitiesChecksum(); AddChecksum(gCurrentTicks, std::move(checksum)); _nextChecksumTick = gCurrentTicks + ChecksumTicksDelta(); @@ -286,7 +286,7 @@ namespace OpenRCT2 _currentRecording->tickEnd = gCurrentTicks; { - rct_sprite_checksum checksum = sprite_checksum(); + EntitiesChecksum checksum = GetAllEntitiesChecksum(); AddChecksum(gCurrentTicks, std::move(checksum)); } @@ -793,7 +793,7 @@ namespace OpenRCT2 { _currentReplay->checksumIndex++; - rct_sprite_checksum checksum = sprite_checksum(); + EntitiesChecksum checksum = GetAllEntitiesChecksum(); if (savedChecksum.second.raw != checksum.raw) { uint32_t replayTick = gCurrentTicks - _currentReplay->tickStart; diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 6685325d60..4666db5718 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -415,7 +415,7 @@ void SetCheatAction::RemoveLitter() const { for (auto litter : EntityList()) { - sprite_remove(litter); + EntityRemove(litter); } tile_element_iterator it{}; diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index a6957bb12a..1758b70c93 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -121,7 +121,7 @@ GameActions::Result::Ptr StaffHireNewAction::QueryExecute(bool execute) const if (execute == false) { // In query we just want to see if we can obtain a sprite slot. - sprite_remove(newPeep); + EntityRemove(newPeep); res->SetData(StaffHireNewActionResult{ SPRITE_INDEX_NULL }); } diff --git a/src/openrct2/cmdline/SimulateCommands.cpp b/src/openrct2/cmdline/SimulateCommands.cpp index a060c5ac73..9709e41634 100644 --- a/src/openrct2/cmdline/SimulateCommands.cpp +++ b/src/openrct2/cmdline/SimulateCommands.cpp @@ -63,7 +63,7 @@ static exitcode_t HandleSimulate(CommandLineArgEnumerator* argEnumerator) { context->GetGameState()->UpdateLogic(); } - Console::WriteLine("Completed: %s", sprite_checksum().ToString().c_str()); + Console::WriteLine("Completed: %s", GetAllEntitiesChecksum().ToString().c_str()); } else { diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 035fa04e07..e16124a409 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1242,7 +1242,7 @@ static int32_t cc_remove_unused_objects(InteractiveConsole& console, [[maybe_unu static int32_t cc_remove_floating_objects(InteractiveConsole& console, const arguments_t& argv) { - uint16_t result = remove_floating_sprites(); + uint16_t result = RemoveFloatingEntities(); console.WriteFormatLine("Removed %d flying objects", result); return 0; } diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index af976afaa2..8f96dd2e95 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -753,7 +753,7 @@ bool NetworkBase::CheckSRAND(uint32_t tick, uint32_t srand0) if (!storedTick.spriteHash.empty()) { - rct_sprite_checksum checksum = sprite_checksum(); + EntitiesChecksum checksum = GetAllEntitiesChecksum(); std::string clientSpriteHash = checksum.ToString(); if (clientSpriteHash != storedTick.spriteHash) { @@ -1520,7 +1520,7 @@ void NetworkBase::Server_Send_TICK() packet << flags; if (flags & NETWORK_TICK_FLAG_CHECKSUMS) { - rct_sprite_checksum checksum = sprite_checksum(); + EntitiesChecksum checksum = GetAllEntitiesChecksum(); packet.WriteString(checksum.ToString().c_str()); } diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 4666fb0db8..3193b8d151 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -660,7 +660,7 @@ void peep_sprite_remove(Peep* peep) News::DisableNewsItems(News::ItemType::Peep, staff->sprite_index); } - sprite_remove(peep); + EntityRemove(peep); auto intent = Intent(wasGuest ? INTENT_ACTION_REFRESH_GUEST_LIST : INTENT_ACTION_REFRESH_STAFF_LIST); context_broadcast_intent(&intent); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 54fa013b39..ef3211f1f0 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -168,7 +168,7 @@ static void ride_remove_cable_lift(Ride* ride) } vehicle->Invalidate(); spriteIndex = vehicle->next_vehicle_on_train; - sprite_remove(vehicle); + EntityRemove(vehicle); } while (spriteIndex != SPRITE_INDEX_NULL); } } @@ -196,7 +196,7 @@ void Ride::RemoveVehicles() } vehicle->Invalidate(); spriteIndex = vehicle->next_vehicle_on_train; - sprite_remove(vehicle); + EntityRemove(vehicle); } vehicles[i] = SPRITE_INDEX_NULL; @@ -211,7 +211,7 @@ void Ride::RemoveVehicles() if (vehicle->ride == id) { vehicle->Invalidate(); - sprite_remove(vehicle); + EntityRemove(vehicle); } } } diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index 55053439bd..3877eee64f 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -178,7 +178,7 @@ namespace OpenRCT2::Scripting case EntityType::Balloon: case EntityType::Duck: case EntityType::Litter: - sprite_remove(entity); + EntityRemove(entity); break; case EntityType::Null: break; diff --git a/src/openrct2/world/Balloon.cpp b/src/openrct2/world/Balloon.cpp index 1c7f2e1541..05d41729ca 100644 --- a/src/openrct2/world/Balloon.cpp +++ b/src/openrct2/world/Balloon.cpp @@ -29,7 +29,7 @@ void Balloon::Update() frame++; if (frame >= 5) { - sprite_remove(this); + EntityRemove(this); } } else diff --git a/src/openrct2/world/Duck.cpp b/src/openrct2/world/Duck.cpp index f376846eca..440ee09412 100644 --- a/src/openrct2/world/Duck.cpp +++ b/src/openrct2/world/Duck.cpp @@ -80,7 +80,7 @@ bool Duck::IsFlying() void Duck::Remove() { Invalidate(); - sprite_remove(this); + EntityRemove(this); } void Duck::UpdateFlyToWater() diff --git a/src/openrct2/world/EntityTweener.cpp b/src/openrct2/world/EntityTweener.cpp index 63c033019e..721c2b715c 100644 --- a/src/openrct2/world/EntityTweener.cpp +++ b/src/openrct2/world/EntityTweener.cpp @@ -85,7 +85,7 @@ void EntityTweener::Tween(float alpha) if (posA == posB) continue; - sprite_set_coordinates( + EntitySetCoordinates( { static_cast(std::round(posB.x * alpha + posA.x * inv)), static_cast(std::round(posB.y * alpha + posA.y * inv)), static_cast(std::round(posB.z * alpha + posA.z * inv)) }, @@ -102,7 +102,7 @@ void EntityTweener::Restore() if (ent == nullptr) continue; - sprite_set_coordinates(PostPos[i], ent); + EntitySetCoordinates(PostPos[i], ent); ent->Invalidate(); } } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index b514ec864d..0e048cedd6 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -413,7 +413,7 @@ void footpath_remove_litter(const CoordsXYZ& footpathPos) for (auto* litter : removals) { litter->Invalidate(); - sprite_remove(litter); + EntityRemove(litter); } } diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/world/Fountain.cpp index 2bf539ea20..6da08d9e63 100644 --- a/src/openrct2/world/Fountain.cpp +++ b/src/openrct2/world/Fountain.cpp @@ -187,7 +187,7 @@ void JumpingFountain::Update() if (frame == 16) { - sprite_remove(this); + EntityRemove(this); } } diff --git a/src/openrct2/world/Litter.cpp b/src/openrct2/world/Litter.cpp index 236f0150af..19b8bb87a8 100644 --- a/src/openrct2/world/Litter.cpp +++ b/src/openrct2/world/Litter.cpp @@ -63,7 +63,7 @@ void Litter::Create(const CoordsXYZD& litterPos, Type type) if (newestLitter != nullptr) { newestLitter->Invalidate(); - sprite_remove(newestLitter); + EntityRemove(newestLitter); } } @@ -100,7 +100,7 @@ void Litter::RemoveAt(const CoordsXYZ& litterPos) for (auto* litter : removals) { litter->Invalidate(); - sprite_remove(litter); + EntityRemove(litter); } } diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/world/MoneyEffect.cpp index 1e57a997fa..aa474fd10e 100644 --- a/src/openrct2/world/MoneyEffect.cpp +++ b/src/openrct2/world/MoneyEffect.cpp @@ -135,7 +135,7 @@ void MoneyEffect::Update() return; } - sprite_remove(this); + EntityRemove(this); } std::pair MoneyEffect::GetStringId() const diff --git a/src/openrct2/world/Particle.cpp b/src/openrct2/world/Particle.cpp index 9626b82802..1c711420a1 100644 --- a/src/openrct2/world/Particle.cpp +++ b/src/openrct2/world/Particle.cpp @@ -62,7 +62,7 @@ void VehicleCrashParticle::Update() time_to_live--; if (time_to_live == 0) { - sprite_remove(this); + EntityRemove(this); return; } @@ -94,7 +94,7 @@ void VehicleCrashParticle::Update() // Splash OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Water2, { x, y, waterZ }); CrashSplashParticle::Create({ x, y, waterZ }); - sprite_remove(this); + EntityRemove(this); return; } @@ -140,7 +140,7 @@ void CrashSplashParticle::Update() frame += 85; if (frame >= 7168) { - sprite_remove(this); + EntityRemove(this); } } @@ -183,7 +183,7 @@ void SteamParticle::Update() frame += 64; if (frame >= (56 * 64)) { - sprite_remove(this); + EntityRemove(this); } } @@ -214,7 +214,7 @@ void ExplosionCloud::Update() frame += 128; if (frame >= (36 * 128)) { - sprite_remove(this); + EntityRemove(this); } } @@ -245,6 +245,6 @@ void ExplosionFlare::Update() frame += 64; if (frame >= (124 * 64)) { - sprite_remove(this); + EntityRemove(this); } } diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 7b2fd74e0f..016be80088 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -34,11 +34,11 @@ #include #include -static rct_sprite _spriteList[MAX_ENTITIES]; +static Entity _entities[MAX_ENTITIES]; static std::array, EnumValue(EntityType::Count)> gEntityLists; static std::vector _freeIdList; -static bool _spriteFlashingList[MAX_ENTITIES]; +static bool _entityFlashingList[MAX_ENTITIES]; constexpr const uint32_t SPATIAL_INDEX_SIZE = (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) + 1; constexpr const uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; @@ -117,7 +117,7 @@ uint16_t GetNumFreeEntities() return static_cast(_freeIdList.size()); } -std::string rct_sprite_checksum::ToString() const +std::string EntitiesChecksum::ToString() const { std::string result; @@ -132,19 +132,19 @@ std::string rct_sprite_checksum::ToString() const return result; } -EntityBase* TryGetEntity(size_t spriteIndex) +EntityBase* TryGetEntity(size_t entityIndex) { - return spriteIndex >= MAX_ENTITIES ? nullptr : &_spriteList[spriteIndex].base; + return entityIndex >= MAX_ENTITIES ? nullptr : &_entities[entityIndex].base; } -EntityBase* GetEntity(size_t spriteIndex) +EntityBase* GetEntity(size_t entityIndex) { - if (spriteIndex == SPRITE_INDEX_NULL) + if (entityIndex == SPRITE_INDEX_NULL) { return nullptr; } - openrct2_assert(spriteIndex < MAX_ENTITIES, "Tried getting sprite %u", spriteIndex); - return TryGetEntity(spriteIndex); + openrct2_assert(entityIndex < MAX_ENTITIES, "Tried getting sprite %u", entityIndex); + return TryGetEntity(entityIndex); } const std::vector& GetEntityTileList(const CoordsXY& spritePos) @@ -231,7 +231,7 @@ void ResetAllEntities() FreeEntity(*spr); } - std::fill(std::begin(_spriteList), std::end(_spriteList), rct_sprite()); + std::fill(std::begin(_entities), std::end(_entities), Entity()); OpenRCT2::RideUse::GetHistory().Clear(); OpenRCT2::RideUse::GetTypeHistory().Clear(); for (int32_t i = 0; i < MAX_ENTITIES; ++i) @@ -244,14 +244,14 @@ void ResetAllEntities() spr->Type = EntityType::Null; spr->sprite_index = i; - _spriteFlashingList[i] = false; + _entityFlashingList[i] = false; } ResetEntityLists(); ResetFreeIds(); - reset_sprite_spatial_index(); + ResetEntitySpatialIndices(); } -static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc); +static void EntitySpatialInsert(EntityBase* entity, const CoordsXY& newLoc); /** * @@ -259,7 +259,7 @@ static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc); * This function looks as though it sets some sort of order for sprites. * Sprites can share their position if this is the case. */ -void reset_sprite_spatial_index() +void ResetEntitySpatialIndices() { for (auto& vec : gEntitySpatialIndex) { @@ -270,7 +270,7 @@ void reset_sprite_spatial_index() auto* spr = GetEntity(i); if (spr != nullptr && spr->Type != EntityType::Null) { - SpriteSpatialInsert(spr, { spr->x, spr->y }); + EntitySpatialInsert(spr, { spr->x, spr->y }); } } } @@ -290,9 +290,9 @@ template void NetworkSerialiseEntityTypes(DataSerialiser& ds) (NetworkSerialseEntityType(ds), ...); } -rct_sprite_checksum sprite_checksum() +EntitiesChecksum GetAllEntitiesChecksum() { - rct_sprite_checksum checksum{}; + EntitiesChecksum checksum{}; OpenRCT2::ChecksumStream ms(checksum.raw); DataSerialiser ds(true, ms); @@ -302,24 +302,24 @@ rct_sprite_checksum sprite_checksum() } #else -rct_sprite_checksum sprite_checksum() +EntitiesChecksum GetAllEntitiesChecksum() { - return rct_sprite_checksum{}; + return EntitiesChecksum{}; } #endif // DISABLE_NETWORK -static void sprite_reset(EntityBase* sprite) +static void EntityReset(EntityBase* entity) { // Need to retain how the sprite is linked in lists - uint16_t sprite_index = sprite->sprite_index; - _spriteFlashingList[sprite_index] = false; + uint16_t entityIndex = entity->sprite_index; + _entityFlashingList[entityIndex] = false; - rct_sprite* spr = reinterpret_cast(sprite); - *spr = rct_sprite(); + Entity* spr = reinterpret_cast(entity); + *spr = Entity(); - sprite->sprite_index = sprite_index; - sprite->Type = EntityType::Null; + entity->sprite_index = entityIndex; + entity->Type = EntityType::Null; } static constexpr uint16_t MAX_MISC_SPRITES = 300; @@ -362,7 +362,7 @@ static void PrepareNewEntity(EntityBase* base, const EntityType type) { // Need to reset all sprite data, as the uninitialised values // may contain garbage and cause a desync later on. - sprite_reset(base); + EntityReset(base); base->Type = type; AddToEntityList(base); @@ -375,7 +375,7 @@ static void PrepareNewEntity(EntityBase* base, const EntityType type) base->sprite_height_positive = 0x8; base->SpriteRect = {}; - SpriteSpatialInsert(base, { LOCATION_NULL, 0 }); + EntitySpatialInsert(base, { LOCATION_NULL, 0 }); } EntityBase* CreateEntity(EntityType type) @@ -447,7 +447,7 @@ template void MiscUpdateAllTypes() * * rct2: 0x00672AA4 */ -void sprite_misc_update_all() +void UpdateAllMiscEntities() { MiscUpdateAllTypes< SteamParticle, MoneyEffect, VehicleCrashParticle, ExplosionCloud, CrashSplashParticle, ExplosionFlare, JumpingFountain, @@ -455,39 +455,39 @@ void sprite_misc_update_all() } // Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order -static void SpriteSpatialInsert(EntityBase* sprite, const CoordsXY& newLoc) +static void EntitySpatialInsert(EntityBase* entity, const CoordsXY& newLoc) { size_t newIndex = GetSpatialIndexOffset(newLoc); auto& spatialVector = gEntitySpatialIndex[newIndex]; - auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), sprite->sprite_index); - spatialVector.insert(index, sprite->sprite_index); + auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), entity->sprite_index); + spatialVector.insert(index, entity->sprite_index); } -static void SpriteSpatialRemove(EntityBase* sprite) +static void EntitySpatialRemove(EntityBase* entity) { - size_t currentIndex = GetSpatialIndexOffset({ sprite->x, sprite->y }); + size_t currentIndex = GetSpatialIndexOffset({ entity->x, entity->y }); auto& spatialVector = gEntitySpatialIndex[currentIndex]; - auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), sprite->sprite_index); - if (index != std::end(spatialVector) && *index == sprite->sprite_index) + auto index = std::lower_bound(std::begin(spatialVector), std::end(spatialVector), entity->sprite_index); + if (index != std::end(spatialVector) && *index == entity->sprite_index) { spatialVector.erase(index, index + 1); } else { log_warning("Bad sprite spatial index. Rebuilding the spatial index..."); - reset_sprite_spatial_index(); + ResetEntitySpatialIndices(); } } -static void SpriteSpatialMove(EntityBase* sprite, const CoordsXY& newLoc) +static void EntitySpatialMove(EntityBase* entity, const CoordsXY& newLoc) { size_t newIndex = GetSpatialIndexOffset(newLoc); - size_t currentIndex = GetSpatialIndexOffset({ sprite->x, sprite->y }); + size_t currentIndex = GetSpatialIndexOffset({ entity->x, entity->y }); if (newIndex == currentIndex) return; - SpriteSpatialRemove(sprite); - SpriteSpatialInsert(sprite, newLoc); + EntitySpatialRemove(entity); + EntitySpatialInsert(entity, newLoc); } void EntityBase::MoveTo(const CoordsXYZ& newLocation) @@ -504,7 +504,7 @@ void EntityBase::MoveTo(const CoordsXYZ& newLocation) loc.x = LOCATION_NULL; } - SpriteSpatialMove(this, loc); + EntitySpatialMove(this, loc); if (loc.x == LOCATION_NULL) { @@ -514,7 +514,7 @@ void EntityBase::MoveTo(const CoordsXYZ& newLocation) } else { - sprite_set_coordinates(loc, this); + EntitySetCoordinates(loc, this); Invalidate(); // Invalidate new position. } } @@ -531,14 +531,14 @@ void EntityBase::SetLocation(const CoordsXYZ& newLocation) z = static_cast(newLocation.z); } -void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite) +void EntitySetCoordinates(const CoordsXYZ& entityPos, EntityBase* entity) { - auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), spritePos); + auto screenCoords = translate_3d_to_2d_with_z(get_current_rotation(), entityPos); - sprite->SpriteRect = ScreenRect( - screenCoords - ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_negative }, - screenCoords + ScreenCoordsXY{ sprite->sprite_width, sprite->sprite_height_positive }); - sprite->SetLocation(spritePos); + entity->SpriteRect = ScreenRect( + screenCoords - ScreenCoordsXY{ entity->sprite_width, entity->sprite_height_negative }, + screenCoords + ScreenCoordsXY{ entity->sprite_width, entity->sprite_height_positive }); + entity->SetLocation(entityPos); } /** @@ -565,54 +565,54 @@ static void FreeEntity(EntityBase& entity) * * rct2: 0x0069EDB6 */ -void sprite_remove(EntityBase* sprite) +void EntityRemove(EntityBase* entity) { - FreeEntity(*sprite); + FreeEntity(*entity); - EntityTweener::Get().RemoveEntity(sprite); - RemoveFromEntityList(sprite); // remove from existing list - AddToFreeList(sprite->sprite_index); + EntityTweener::Get().RemoveEntity(entity); + RemoveFromEntityList(entity); // remove from existing list + AddToFreeList(entity->sprite_index); - SpriteSpatialRemove(sprite); - sprite_reset(sprite); + EntitySpatialRemove(entity); + EntityReset(entity); } /** - * Loops through all sprites, finds floating objects and removes them. + * Loops through all floating entities and removes them. * Returns the amount of removed objects as feedback. */ -uint16_t remove_floating_sprites() +uint16_t RemoveFloatingEntities() { uint16_t removed = 0; for (auto* balloon : EntityList()) { - sprite_remove(balloon); + EntityRemove(balloon); removed++; } for (auto* duck : EntityList()) { if (duck->IsFlying()) { - sprite_remove(duck); + EntityRemove(duck); removed++; } } for (auto* money : EntityList()) { - sprite_remove(money); + EntityRemove(money); removed++; } return removed; } -void sprite_set_flashing(EntityBase* sprite, bool flashing) +void EntitySetFlashing(EntityBase* entity, bool flashing) { - assert(sprite->sprite_index < MAX_ENTITIES); - _spriteFlashingList[sprite->sprite_index] = flashing; + assert(entity->sprite_index < MAX_ENTITIES); + _entityFlashingList[entity->sprite_index] = flashing; } -bool sprite_get_flashing(EntityBase* sprite) +bool EntityGetFlashing(EntityBase* entity) { - assert(sprite->sprite_index < MAX_ENTITIES); - return _spriteFlashingList[sprite->sprite_index]; + assert(entity->sprite_index < MAX_ENTITIES); + return _entityFlashingList[entity->sprite_index]; } diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index ec0309b452..a1740b6c4d 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -16,22 +16,22 @@ #pragma pack(push, 1) /** - * Sprite structure. + * Entity structure. * size: 0x0200 */ -union rct_sprite +union Entity { uint8_t pad_00[0x200]; EntityBase base; - // Provide a constructor as EntityBase is not trivialy constructable - rct_sprite() + // Provide a constructor as EntityBase is not trivially constructible + Entity() : pad_00() { } }; -assert_struct_size(rct_sprite, 0x200); +assert_struct_size(Entity, 0x200); -struct rct_sprite_checksum +struct EntitiesChecksum { std::array raw; @@ -41,13 +41,13 @@ struct rct_sprite_checksum #pragma pack(pop) void ResetAllEntities(); -void reset_sprite_spatial_index(); -void sprite_misc_update_all(); -void sprite_set_coordinates(const CoordsXYZ& spritePos, EntityBase* sprite); -void sprite_remove(EntityBase* sprite); -uint16_t remove_floating_sprites(); +void ResetEntitySpatialIndices(); +void UpdateAllMiscEntities(); +void EntitySetCoordinates(const CoordsXYZ& entityPos, EntityBase* entity); +void EntityRemove(EntityBase* entity); +uint16_t RemoveFloatingEntities(); -rct_sprite_checksum sprite_checksum(); +EntitiesChecksum GetAllEntitiesChecksum(); -void sprite_set_flashing(EntityBase* sprite, bool flashing); -bool sprite_get_flashing(EntityBase* sprite); +void EntitySetFlashing(EntityBase* entity, bool flashing); +bool EntityGetFlashing(EntityBase* entity); diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 55b5695373..8d6bbd9e53 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -49,7 +49,7 @@ static std::unique_ptr localStartGame(const std::string& parkPath) context->GetObjectManager().LoadObjects(loadResult.RequiredObjects); importer->Import(); - reset_sprite_spatial_index(); + ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); scenery_set_default_placement_configuration(); diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index dcd5093325..2a8285229b 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -60,7 +60,7 @@ static bool LoadFileToBuffer(MemoryStream& stream, const std::string& filePath) static void GameInit(bool retainSpatialIndices) { if (!retainSpatialIndices) - reset_sprite_spatial_index(); + ResetEntitySpatialIndices(); reset_all_sprite_quadrant_placements(); scenery_set_default_placement_configuration(); From 88366bd2969c9040564deff2556cbee74ce1c479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 15:58:16 +0200 Subject: [PATCH 04/12] Move Entity storage structure to cpp --- src/openrct2/world/Sprite.cpp | 11 +++++++++++ src/openrct2/world/Sprite.h | 17 ----------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 016be80088..8ba1fd17cc 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -34,6 +34,17 @@ #include #include +union Entity +{ + uint8_t pad_00[0x200]; + EntityBase base; + // Provide a constructor as EntityBase is not trivially constructible + Entity() + : pad_00() + { + } +}; + static Entity _entities[MAX_ENTITIES]; static std::array, EnumValue(EntityType::Count)> gEntityLists; static std::vector _freeIdList; diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/world/Sprite.h index a1740b6c4d..affeb4b833 100644 --- a/src/openrct2/world/Sprite.h +++ b/src/openrct2/world/Sprite.h @@ -15,29 +15,12 @@ #include #pragma pack(push, 1) -/** - * Entity structure. - * size: 0x0200 - */ -union Entity -{ - uint8_t pad_00[0x200]; - EntityBase base; - // Provide a constructor as EntityBase is not trivially constructible - Entity() - : pad_00() - { - } -}; -assert_struct_size(Entity, 0x200); - struct EntitiesChecksum { std::array raw; std::string ToString() const; }; - #pragma pack(pop) void ResetAllEntities(); From 3b261f99b8ee1f0798592f2675ed149b78902974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:05:22 +0200 Subject: [PATCH 05/12] Decouple game state snapshots structure from internal structure --- src/openrct2/GameStateSnapshots.cpp | 34 ++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 0f507702bd..93325a3fca 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -25,6 +25,19 @@ static constexpr size_t MaximumGameStateSnapshots = 32; static constexpr uint32_t InvalidTick = 0xFFFFFFFF; +#pragma pack(push, 1) +union EntitySnapshot +{ + uint8_t pad_00[0x200]; + EntityBase base; + EntitySnapshot() + : pad_00() + { + } +}; +assert_struct_size(EntitySnapshot, 0x200); +#pragma pack(pop) + struct GameStateSnapshot_t { GameStateSnapshot_t& operator=(GameStateSnapshot_t&& mv) noexcept @@ -56,7 +69,7 @@ struct GameStateSnapshot_t } // Must pass a function that can access the sprite. - void SerialiseSprites(std::function getEntity, const size_t numSprites, bool saving) + void SerialiseSprites(std::function getEntity, const size_t numSprites, bool saving) { const bool loading = !saving; @@ -99,7 +112,7 @@ struct GameStateSnapshot_t ds << indexTable[i]; const uint32_t spriteIdx = indexTable[i]; - Entity* entity = getEntity(spriteIdx); + EntitySnapshot* entity = getEntity(spriteIdx); if (entity == nullptr) { log_error("Entity index corrupted!"); @@ -171,7 +184,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots virtual void Capture(GameStateSnapshot_t& snapshot) override final { snapshot.SerialiseSprites( - [](const size_t index) { return reinterpret_cast(GetEntity(index)); }, MAX_ENTITIES, true); + [](const size_t index) { return reinterpret_cast(GetEntity(index)); }, MAX_ENTITIES, true); // log_info("Snapshot size: %u bytes", static_cast(snapshot.storedSprites.GetLength())); } @@ -194,9 +207,9 @@ struct GameStateSnapshots final : public IGameStateSnapshots ds << snapshot.parkParameters; } - std::vector BuildSpriteList(GameStateSnapshot_t& snapshot) const + std::vector BuildSpriteList(GameStateSnapshot_t& snapshot) const { - std::vector spriteList; + std::vector spriteList; spriteList.resize(MAX_ENTITIES); for (auto& sprite : spriteList) @@ -536,7 +549,8 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(ExplosionFlare, frame); } - void CompareSpriteData(const Entity& spriteBase, const Entity& spriteCmp, GameStateSpriteChange_t& changeData) const + void CompareSpriteData( + const EntitySnapshot& spriteBase, const EntitySnapshot& spriteCmp, GameStateSpriteChange_t& changeData) const { CompareSpriteDataCommon(spriteBase.base, spriteCmp.base, changeData); if (spriteBase.base.Type == spriteCmp.base.Type) @@ -618,16 +632,16 @@ struct GameStateSnapshots final : public IGameStateSnapshots res.srand0Left = base.srand0; res.srand0Right = cmp.srand0; - std::vector spritesBase = BuildSpriteList(const_cast(base)); - std::vector spritesCmp = BuildSpriteList(const_cast(cmp)); + std::vector spritesBase = BuildSpriteList(const_cast(base)); + std::vector spritesCmp = BuildSpriteList(const_cast(cmp)); for (uint32_t i = 0; i < static_cast(spritesBase.size()); i++) { GameStateSpriteChange_t changeData; changeData.spriteIndex = i; - const Entity& spriteBase = spritesBase[i]; - const Entity& spriteCmp = spritesCmp[i]; + const EntitySnapshot& spriteBase = spritesBase[i]; + const EntitySnapshot& spriteCmp = spritesCmp[i]; changeData.entityType = spriteBase.base.Type; From dadf94b5c04aacb334f45fc200190736e04097c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:22:29 +0200 Subject: [PATCH 06/12] Remove unnecessary padding from entities --- src/openrct2/world/Sprite.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index 8ba1fd17cc..882d9beb88 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -36,16 +36,23 @@ union Entity { - uint8_t pad_00[0x200]; - EntityBase base; - // Provide a constructor as EntityBase is not trivially constructible - Entity() - : pad_00() - { - } + EntityBase base{}; + Vehicle vehicle; + Guest guest; + Staff staff; + Litter litter; + SteamParticle steamParticle; + MoneyEffect money; + VehicleCrashParticle crashParticle; + ExplosionCloud explosionCloud; + CrashSplashParticle crashSplash; + ExplosionFlare explosionFlare; + JumpingFountain jumpingFountain; + Balloon balloon; + Duck duck; }; -static Entity _entities[MAX_ENTITIES]; +static Entity _entities[MAX_ENTITIES]{}; static std::array, EnumValue(EntityType::Count)> gEntityLists; static std::vector _freeIdList; From 8c290c7d9270f45a9ca3fc36b1271d18f7ba7e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:31:08 +0200 Subject: [PATCH 07/12] Move entity code from world into entity --- src/openrct2/{world => entity}/Balloon.cpp | 0 src/openrct2/{world => entity}/Balloon.h | 0 src/openrct2/{world => entity}/Duck.cpp | 0 src/openrct2/{world => entity}/Duck.h | 0 src/openrct2/{world => entity}/Entity.cpp | 0 src/openrct2/{world => entity}/Entity.h | 0 src/openrct2/{world => entity}/EntityBase.h | 0 src/openrct2/{world => entity}/EntityList.h | 0 .../{world => entity}/EntityTweener.cpp | 0 .../{world => entity}/EntityTweener.h | 0 src/openrct2/{world => entity}/Fountain.cpp | 0 src/openrct2/{world => entity}/Fountain.h | 0 src/openrct2/{world => entity}/Litter.cpp | 0 src/openrct2/{world => entity}/Litter.h | 0 .../{world => entity}/MoneyEffect.cpp | 0 src/openrct2/{world => entity}/MoneyEffect.h | 0 src/openrct2/{world => entity}/Particle.cpp | 0 src/openrct2/{world => entity}/Particle.h | 0 src/openrct2/{world => entity}/Sprite.cpp | 0 src/openrct2/{world => entity}/Sprite.h | 0 src/openrct2/libopenrct2.vcxproj | 40 +++++++++---------- 21 files changed, 20 insertions(+), 20 deletions(-) rename src/openrct2/{world => entity}/Balloon.cpp (100%) rename src/openrct2/{world => entity}/Balloon.h (100%) rename src/openrct2/{world => entity}/Duck.cpp (100%) rename src/openrct2/{world => entity}/Duck.h (100%) rename src/openrct2/{world => entity}/Entity.cpp (100%) rename src/openrct2/{world => entity}/Entity.h (100%) rename src/openrct2/{world => entity}/EntityBase.h (100%) rename src/openrct2/{world => entity}/EntityList.h (100%) rename src/openrct2/{world => entity}/EntityTweener.cpp (100%) rename src/openrct2/{world => entity}/EntityTweener.h (100%) rename src/openrct2/{world => entity}/Fountain.cpp (100%) rename src/openrct2/{world => entity}/Fountain.h (100%) rename src/openrct2/{world => entity}/Litter.cpp (100%) rename src/openrct2/{world => entity}/Litter.h (100%) rename src/openrct2/{world => entity}/MoneyEffect.cpp (100%) rename src/openrct2/{world => entity}/MoneyEffect.h (100%) rename src/openrct2/{world => entity}/Particle.cpp (100%) rename src/openrct2/{world => entity}/Particle.h (100%) rename src/openrct2/{world => entity}/Sprite.cpp (100%) rename src/openrct2/{world => entity}/Sprite.h (100%) diff --git a/src/openrct2/world/Balloon.cpp b/src/openrct2/entity/Balloon.cpp similarity index 100% rename from src/openrct2/world/Balloon.cpp rename to src/openrct2/entity/Balloon.cpp diff --git a/src/openrct2/world/Balloon.h b/src/openrct2/entity/Balloon.h similarity index 100% rename from src/openrct2/world/Balloon.h rename to src/openrct2/entity/Balloon.h diff --git a/src/openrct2/world/Duck.cpp b/src/openrct2/entity/Duck.cpp similarity index 100% rename from src/openrct2/world/Duck.cpp rename to src/openrct2/entity/Duck.cpp diff --git a/src/openrct2/world/Duck.h b/src/openrct2/entity/Duck.h similarity index 100% rename from src/openrct2/world/Duck.h rename to src/openrct2/entity/Duck.h diff --git a/src/openrct2/world/Entity.cpp b/src/openrct2/entity/Entity.cpp similarity index 100% rename from src/openrct2/world/Entity.cpp rename to src/openrct2/entity/Entity.cpp diff --git a/src/openrct2/world/Entity.h b/src/openrct2/entity/Entity.h similarity index 100% rename from src/openrct2/world/Entity.h rename to src/openrct2/entity/Entity.h diff --git a/src/openrct2/world/EntityBase.h b/src/openrct2/entity/EntityBase.h similarity index 100% rename from src/openrct2/world/EntityBase.h rename to src/openrct2/entity/EntityBase.h diff --git a/src/openrct2/world/EntityList.h b/src/openrct2/entity/EntityList.h similarity index 100% rename from src/openrct2/world/EntityList.h rename to src/openrct2/entity/EntityList.h diff --git a/src/openrct2/world/EntityTweener.cpp b/src/openrct2/entity/EntityTweener.cpp similarity index 100% rename from src/openrct2/world/EntityTweener.cpp rename to src/openrct2/entity/EntityTweener.cpp diff --git a/src/openrct2/world/EntityTweener.h b/src/openrct2/entity/EntityTweener.h similarity index 100% rename from src/openrct2/world/EntityTweener.h rename to src/openrct2/entity/EntityTweener.h diff --git a/src/openrct2/world/Fountain.cpp b/src/openrct2/entity/Fountain.cpp similarity index 100% rename from src/openrct2/world/Fountain.cpp rename to src/openrct2/entity/Fountain.cpp diff --git a/src/openrct2/world/Fountain.h b/src/openrct2/entity/Fountain.h similarity index 100% rename from src/openrct2/world/Fountain.h rename to src/openrct2/entity/Fountain.h diff --git a/src/openrct2/world/Litter.cpp b/src/openrct2/entity/Litter.cpp similarity index 100% rename from src/openrct2/world/Litter.cpp rename to src/openrct2/entity/Litter.cpp diff --git a/src/openrct2/world/Litter.h b/src/openrct2/entity/Litter.h similarity index 100% rename from src/openrct2/world/Litter.h rename to src/openrct2/entity/Litter.h diff --git a/src/openrct2/world/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp similarity index 100% rename from src/openrct2/world/MoneyEffect.cpp rename to src/openrct2/entity/MoneyEffect.cpp diff --git a/src/openrct2/world/MoneyEffect.h b/src/openrct2/entity/MoneyEffect.h similarity index 100% rename from src/openrct2/world/MoneyEffect.h rename to src/openrct2/entity/MoneyEffect.h diff --git a/src/openrct2/world/Particle.cpp b/src/openrct2/entity/Particle.cpp similarity index 100% rename from src/openrct2/world/Particle.cpp rename to src/openrct2/entity/Particle.cpp diff --git a/src/openrct2/world/Particle.h b/src/openrct2/entity/Particle.h similarity index 100% rename from src/openrct2/world/Particle.h rename to src/openrct2/entity/Particle.h diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/entity/Sprite.cpp similarity index 100% rename from src/openrct2/world/Sprite.cpp rename to src/openrct2/entity/Sprite.cpp diff --git a/src/openrct2/world/Sprite.h b/src/openrct2/entity/Sprite.h similarity index 100% rename from src/openrct2/world/Sprite.h rename to src/openrct2/entity/Sprite.h diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 2d5b2241db..731425205f 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -205,6 +205,17 @@ + + + + + + + + + + + @@ -466,32 +477,21 @@ - - - - - - - - - - - @@ -662,6 +662,15 @@ + + + + + + + + + @@ -913,28 +922,19 @@ - - - - - - - - - From 7c726e2a0cbf3d7d9c209fc2e101dbda32b9fbbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:48:33 +0200 Subject: [PATCH 08/12] Fix includes --- src/openrct2-ui/WindowManager.cpp | 2 +- .../interface/ViewportInteraction.cpp | 6 +++--- src/openrct2-ui/interface/Window.cpp | 2 +- src/openrct2-ui/scripting/ScTitleSequence.hpp | 2 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 2 +- src/openrct2-ui/windows/News.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 2 +- src/openrct2-ui/windows/StaffFirePrompt.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 4 ++-- src/openrct2-ui/windows/TitleCommandEditor.cpp | 6 +++--- src/openrct2/Game.cpp | 2 +- src/openrct2/GameState.cpp | 2 +- src/openrct2/GameStateSnapshots.cpp | 16 ++++++++-------- src/openrct2/ParkFile.cpp | 16 ++++++++-------- src/openrct2/ReplayManager.cpp | 4 ++-- src/openrct2/actions/BalloonPressAction.cpp | 4 ++-- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/GuestSetFlagsAction.cpp | 2 +- src/openrct2/actions/GuestSetNameAction.cpp | 2 +- src/openrct2/actions/PeepPickupAction.cpp | 2 +- src/openrct2/actions/SetCheatAction.cpp | 4 ++-- src/openrct2/actions/StaffFireAction.cpp | 2 +- src/openrct2/actions/StaffHireNewAction.cpp | 2 +- src/openrct2/actions/StaffSetColourAction.cpp | 2 +- src/openrct2/actions/StaffSetCostumeAction.cpp | 2 +- src/openrct2/actions/StaffSetNameAction.cpp | 2 +- src/openrct2/actions/StaffSetOrdersAction.cpp | 2 +- .../actions/StaffSetPatrolAreaAction.cpp | 2 +- src/openrct2/entity/EntityList.h | 2 +- src/openrct2/entity/Fountain.cpp | 6 +++--- src/openrct2/entity/Fountain.h | 2 +- src/openrct2/entity/Litter.cpp | 2 +- src/openrct2/entity/MoneyEffect.cpp | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 4 ++-- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/management/NewsItem.cpp | 2 +- src/openrct2/network/NetworkBase.cpp | 6 +++--- src/openrct2/paint/sprite/Paint.Sprite.cpp | 14 +++++++------- src/openrct2/paint/tile_element/Paint.Path.cpp | 5 +++-- .../paint/tile_element/Paint.Surface.cpp | 2 +- src/openrct2/peep/Guest.cpp | 8 ++++---- src/openrct2/peep/Peep.cpp | 6 +++--- src/openrct2/peep/Peep.h | 2 +- src/openrct2/peep/Staff.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 16 ++++++++-------- src/openrct2/rct2/RCT2.h | 2 +- src/openrct2/rct2/S6Importer.cpp | 18 +++++++++--------- src/openrct2/ride/CableLift.cpp | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/RideConstruction.cpp | 6 +++--- src/openrct2/ride/ShopItem.h | 2 +- src/openrct2/ride/Vehicle.cpp | 4 ++-- src/openrct2/ride/Vehicle.h | 2 +- src/openrct2/ride/VehiclePaint.cpp | 2 +- .../ride/coaster/ReverserRollerCoaster.cpp | 2 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 2 +- src/openrct2/ride/gentle/MiniGolf.cpp | 2 +- src/openrct2/ride/gentle/SpaceRings.cpp | 2 +- src/openrct2/ride/thrill/TopSpin.cpp | 2 +- .../ride/transport/SuspendedMonorail.cpp | 2 +- src/openrct2/scenario/Scenario.cpp | 2 +- src/openrct2/scenario/Scenario.h | 2 +- .../scripting/bindings/entity/ScEntity.hpp | 4 ++-- .../scripting/bindings/world/ScMap.cpp | 14 +++++++------- .../scripting/bindings/world/ScTile.cpp | 2 +- .../scripting/bindings/world/ScTileElement.cpp | 2 +- .../scripting/bindings/world/ScTileElement.hpp | 2 +- src/openrct2/world/Footpath.cpp | 4 ++-- src/openrct2/world/MapAnimation.cpp | 2 +- src/openrct2/world/Park.cpp | 2 +- src/openrct2/world/Scenery.cpp | 2 +- test/tests/PlayTests.cpp | 4 ++-- test/tests/S6ImportExportTests.cpp | 4 ++-- 73 files changed, 141 insertions(+), 140 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index fdc312becc..1fa73f6dc0 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -18,11 +18,11 @@ #include #include #include +#include #include #include #include #include -#include using namespace OpenRCT2::Ui; diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 6e0c45b47b..d0503d828e 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -24,6 +24,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -32,15 +35,12 @@ #include #include #include -#include #include -#include #include #include #include #include #include -#include #include #include diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 5e3774a544..7f213856c4 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -20,11 +20,11 @@ #include #include #include +#include #include #include #include #include -#include using namespace OpenRCT2; diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index 0d9e80db33..0ea84d6a88 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -16,6 +16,7 @@ # include # include # include +# include # include # include # include @@ -23,7 +24,6 @@ # include # include # include -# include namespace OpenRCT2::Scripting { diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index d0e954a21f..be1fb8b856 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include using namespace OpenRCT2; diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 290557a448..ad2e3bf187 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -13,12 +13,12 @@ #include #include #include +#include #include #include #include #include #include -#include static constexpr const rct_string_id WINDOW_TITLE = STR_RECENT_MESSAGES; static constexpr const int32_t WH = 300; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index f6d7891805..798001b0a0 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -21,13 +21,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index e229b466d9..650250d521 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -12,10 +12,10 @@ #include #include #include +#include #include #include #include -#include static constexpr const rct_string_id WINDOW_TITLE = STR_SACK_STAFF; static constexpr const int32_t WW = 200; diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 64758ff7f1..4f6793daf7 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -19,16 +19,16 @@ #include #include #include +#include +#include #include #include #include #include #include #include -#include #include #include -#include #include enum diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index ceb9ae605e..bbcd03c636 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -19,6 +19,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -27,9 +30,6 @@ #include #include #include -#include -#include -#include // clang-format off struct TITLE_COMMAND_ORDER { diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 938d384056..b04dc48f86 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -25,6 +25,7 @@ #include "core/Console.hpp" #include "core/FileScanner.h" #include "core/Path.hpp" +#include "entity/Sprite.h" #include "interface/Colour.h" #include "interface/Screenshot.h" #include "interface/Viewport.h" @@ -62,7 +63,6 @@ #include "world/MapAnimation.h" #include "world/Park.h" #include "world/Scenery.h" -#include "world/Sprite.h" #include "world/Surface.h" #include "world/Water.h" diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index a5b540a498..88dcfe67d2 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -19,6 +19,7 @@ #include "ReplayManager.h" #include "actions/GameAction.h" #include "config/Config.h" +#include "entity/Sprite.h" #include "interface/Screenshot.h" #include "localisation/Date.h" #include "localisation/Localisation.h" @@ -37,7 +38,6 @@ #include "world/MapAnimation.h" #include "world/Park.h" #include "world/Scenery.h" -#include "world/Sprite.h" #include #include diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 93325a3fca..3a0b00dbee 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -10,17 +10,17 @@ #include "GameStateSnapshots.h" #include "core/CircularBuffer.h" +#include "entity/Balloon.h" +#include "entity/Duck.h" +#include "entity/EntityList.h" +#include "entity/Fountain.h" +#include "entity/Litter.h" +#include "entity/MoneyEffect.h" +#include "entity/Particle.h" +#include "entity/Sprite.h" #include "peep/Guest.h" #include "peep/Staff.h" #include "ride/Vehicle.h" -#include "world/Balloon.h" -#include "world/Duck.h" -#include "world/EntityList.h" -#include "world/Fountain.h" -#include "world/Litter.h" -#include "world/MoneyEffect.h" -#include "world/Particle.h" -#include "world/Sprite.h" static constexpr size_t MaximumGameStateSnapshots = 32; static constexpr uint32_t InvalidTick = 0xFFFFFFFF; diff --git a/src/openrct2/ParkFile.cpp b/src/openrct2/ParkFile.cpp index ffbf1ad0fc..7f78bf67e1 100644 --- a/src/openrct2/ParkFile.cpp +++ b/src/openrct2/ParkFile.cpp @@ -23,6 +23,14 @@ #include "core/OrcaStream.hpp" #include "core/Path.hpp" #include "drawing/Drawing.h" +#include "entity/Balloon.h" +#include "entity/Duck.h" +#include "entity/EntityList.h" +#include "entity/Fountain.h" +#include "entity/Litter.h" +#include "entity/MoneyEffect.h" +#include "entity/Particle.h" +#include "entity/Sprite.h" #include "interface/Viewport.h" #include "interface/Window.h" #include "localisation/Date.h" @@ -39,18 +47,10 @@ #include "ride/Vehicle.h" #include "scenario/Scenario.h" #include "scenario/ScenarioRepository.h" -#include "world/Balloon.h" #include "world/Climate.h" -#include "world/Duck.h" -#include "world/EntityList.h" #include "world/Entrance.h" -#include "world/Fountain.h" -#include "world/Litter.h" #include "world/Map.h" -#include "world/MoneyEffect.h" #include "world/Park.h" -#include "world/Particle.h" -#include "world/Sprite.h" #include #include diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index 8846137cbc..c6b99bc3f4 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -26,13 +26,13 @@ #include "config/Config.h" #include "core/DataSerialiser.h" #include "core/Path.hpp" +#include "entity/EntityTweener.h" +#include "entity/Sprite.h" #include "management/NewsItem.h" #include "object/ObjectManager.h" #include "object/ObjectRepository.h" #include "scenario/Scenario.h" -#include "world/EntityTweener.h" #include "world/Park.h" -#include "world/Sprite.h" #include "zlib.h" #include diff --git a/src/openrct2/actions/BalloonPressAction.cpp b/src/openrct2/actions/BalloonPressAction.cpp index 2c3fceafe8..7b8c1da5be 100644 --- a/src/openrct2/actions/BalloonPressAction.cpp +++ b/src/openrct2/actions/BalloonPressAction.cpp @@ -9,8 +9,8 @@ #include "BalloonPressAction.h" -#include "../world/Balloon.h" -#include "../world/Entity.h" +#include "../entity/Balloon.h" +#include "../entity/Entity.h" #include "GameAction.h" BalloonPressAction::BalloonPressAction(uint16_t spriteIndex) diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 686c4942b2..76485058ac 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -14,6 +14,7 @@ #include "../core/Guard.hpp" #include "../core/Memory.hpp" #include "../core/MemoryStream.h" +#include "../entity/MoneyEffect.h" #include "../localisation/Localisation.h" #include "../network/network.h" #include "../platform/platform.h" @@ -23,7 +24,6 @@ #include "../scripting/ScriptEngine.h" #include "../ui/UiContext.h" #include "../ui/WindowManager.h" -#include "../world/MoneyEffect.h" #include "../world/Park.h" #include "../world/Scenery.h" diff --git a/src/openrct2/actions/GuestSetFlagsAction.cpp b/src/openrct2/actions/GuestSetFlagsAction.cpp index de52b37a98..bdb4cb22f8 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/GuestSetFlagsAction.cpp @@ -11,7 +11,7 @@ #include "../Context.h" #include "../OpenRCT2.h" -#include "../world/Entity.h" +#include "../entity/Entity.h" GuestSetFlagsAction::GuestSetFlagsAction(uint16_t peepId, uint32_t flags) : _peepId(peepId) diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index af9f3769ad..86070d9714 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -13,11 +13,11 @@ #include "../Context.h" #include "../core/MemoryStream.h" #include "../drawing/Drawing.h" +#include "../entity/Entity.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../windows/Intent.h" -#include "../world/Entity.h" #include "../world/Park.h" GuestSetNameAction::GuestSetNameAction(uint16_t spriteIndex, const std::string& name) diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index 9c75fce9e5..ce854fafa3 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -10,10 +10,10 @@ #include "PeepPickupAction.h" #include "../Input.h" +#include "../entity/Entity.h" #include "../network/network.h" #include "../peep/Peep.h" #include "../util/Util.h" -#include "../world/Entity.h" PeepPickupAction::PeepPickupAction(PeepPickupType type, uint32_t spriteId, const CoordsXYZ& loc, NetworkPlayerId_t owner) : _type(type) diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 4666db5718..5d5c69e0b2 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -15,6 +15,8 @@ #include "../config/Config.h" #include "../core/String.hpp" #include "../drawing/Drawing.h" +#include "../entity/Duck.h" +#include "../entity/Sprite.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../network/network.h" @@ -27,13 +29,11 @@ #include "../windows/Intent.h" #include "../world/Banner.h" #include "../world/Climate.h" -#include "../world/Duck.h" #include "../world/Footpath.h" #include "../world/Location.hpp" #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Sprite.h" #include "../world/Surface.h" #include "ParkSetLoanAction.h" #include "ParkSetParameterAction.h" diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index d0d3917f27..8ece06bdee 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -9,9 +9,9 @@ #include "StaffFireAction.h" +#include "../entity/Entity.h" #include "../interface/Window.h" #include "../peep/Staff.h" -#include "../world/Entity.h" StaffFireAction::StaffFireAction(uint16_t spriteId) : _spriteId(spriteId) diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 1758b70c93..c643e1ca69 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -13,6 +13,7 @@ #include "../Context.h" #include "../core/MemoryStream.h" #include "../drawing/Drawing.h" +#include "../entity/Sprite.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" @@ -24,7 +25,6 @@ #include "../ui/WindowManager.h" #include "../world/Entrance.h" #include "../world/Park.h" -#include "../world/Sprite.h" /* rct2: 0x009929FC */ static constexpr const PeepSpriteType spriteTypes[] = { diff --git a/src/openrct2/actions/StaffSetColourAction.cpp b/src/openrct2/actions/StaffSetColourAction.cpp index e4ef8ad7c6..81bb7cd78e 100644 --- a/src/openrct2/actions/StaffSetColourAction.cpp +++ b/src/openrct2/actions/StaffSetColourAction.cpp @@ -12,12 +12,12 @@ #include "../Context.h" #include "../core/MemoryStream.h" #include "../drawing/Drawing.h" +#include "../entity/EntityList.h" #include "../localisation/StringIds.h" #include "../peep/Staff.h" #include "../ui/UiContext.h" #include "../ui/WindowManager.h" #include "../windows/Intent.h" -#include "../world/EntityList.h" StaffSetColourAction::StaffSetColourAction(StaffType staffType, uint8_t colour) : _staffType(static_cast(staffType)) diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index eb3a09ac7e..b4da89f683 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -10,11 +10,11 @@ #include "StaffSetCostumeAction.h" #include "../Context.h" +#include "../entity/Entity.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../windows/Intent.h" -#include "../world/Entity.h" /** rct2: 0x00982134 */ constexpr const bool peep_slow_walking_types[] = { diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index 2adf8554ca..e20485ec36 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -13,12 +13,12 @@ #include "../Context.h" #include "../core/MemoryStream.h" #include "../drawing/Drawing.h" +#include "../entity/Entity.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../peep/Staff.h" #include "../windows/Intent.h" -#include "../world/Entity.h" #include "../world/Park.h" StaffSetNameAction::StaffSetNameAction(uint16_t spriteIndex, const std::string& name) diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index deb3013ba1..751af768d2 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -10,12 +10,12 @@ #include "StaffSetOrdersAction.h" #include "../Context.h" +#include "../entity/Entity.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../peep/Staff.h" #include "../windows/Intent.h" -#include "../world/Entity.h" StaffSetOrdersAction::StaffSetOrdersAction(uint16_t spriteIndex, uint8_t ordersId) : _spriteIndex(spriteIndex) diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index 49231c99f0..4a5c9fdc65 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -9,10 +9,10 @@ #include "StaffSetPatrolAreaAction.h" +#include "../entity/Entity.h" #include "../interface/Window.h" #include "../peep/Peep.h" #include "../peep/Staff.h" -#include "../world/Entity.h" StaffSetPatrolAreaAction::StaffSetPatrolAreaAction(uint16_t spriteId, const CoordsXY& loc, const StaffSetPatrolAreaMode mode) : _spriteId(spriteId) diff --git a/src/openrct2/entity/EntityList.h b/src/openrct2/entity/EntityList.h index 60d967aac5..f604398bed 100644 --- a/src/openrct2/entity/EntityList.h +++ b/src/openrct2/entity/EntityList.h @@ -11,9 +11,9 @@ #include "../common.h" #include "../rct12/RCT12.h" +#include "../world/Location.hpp" #include "Entity.h" #include "EntityBase.h" -#include "Location.hpp" #include #include diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index 6da08d9e63..65ebf0862a 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -11,9 +11,9 @@ #include "../Game.h" #include "../scenario/Scenario.h" -#include "Footpath.h" -#include "Map.h" -#include "Scenery.h" +#include "../world/Footpath.h" +#include "../world/Map.h" +#include "../world/Scenery.h" #include "Sprite.h" enum class PATTERN diff --git a/src/openrct2/entity/Fountain.h b/src/openrct2/entity/Fountain.h index d8db48780a..06220322ca 100644 --- a/src/openrct2/entity/Fountain.h +++ b/src/openrct2/entity/Fountain.h @@ -10,8 +10,8 @@ #pragma once #include "../common.h" +#include "../world/Map.h" #include "EntityBase.h" -#include "Map.h" class DataSerialiser; diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 19b8bb87a8..907a16961e 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -3,8 +3,8 @@ #include "../Cheats.h" #include "../Game.h" #include "../localisation/StringIds.h" +#include "../world/Map.h" #include "EntityList.h" -#include "Map.h" #include "Sprite.h" static bool isLocationLitterable(const CoordsXYZ& mapPos) diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index aa474fd10e..6fef24af4a 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -14,8 +14,8 @@ #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../network/network.h" +#include "../world/Map.h" #include "Entity.h" -#include "Map.h" #include "Sprite.h" static constexpr const CoordsXY _moneyEffectMoveOffset[] = { diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index e16124a409..c68c19fdde 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -28,6 +28,8 @@ #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../drawing/Font.h" +#include "../entity/EntityList.h" +#include "../entity/Sprite.h" #include "../interface/Chat.h" #include "../interface/Colour.h" #include "../interface/Window_internal.h" @@ -48,10 +50,8 @@ #include "../util/Util.h" #include "../windows/Intent.h" #include "../world/Climate.h" -#include "../world/EntityList.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Sprite.h" #include "Viewport.h" #include diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index d1df3bfdb0..f32ac3b20b 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -18,6 +18,7 @@ #include "../core/JobPool.h" #include "../drawing/Drawing.h" #include "../drawing/IDrawingEngine.h" +#include "../entity/EntityList.h" #include "../paint/Paint.h" #include "../peep/Guest.h" #include "../peep/Staff.h" @@ -28,7 +29,6 @@ #include "../ui/WindowManager.h" #include "../util/Math.hpp" #include "../world/Climate.h" -#include "../world/EntityList.h" #include "../world/Map.h" #include "Colour.h" #include "Window.h" diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 14c9654de2..774a46cb55 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -13,6 +13,7 @@ #include "../Input.h" #include "../OpenRCT2.h" #include "../audio/audio.h" +#include "../entity/Entity.h" #include "../interface/Window.h" #include "../interface/Window_internal.h" #include "../localisation/Date.h" @@ -23,7 +24,6 @@ #include "../ride/Vehicle.h" #include "../util/Util.h" #include "../windows/Intent.h" -#include "../world/Entity.h" #include "../world/Location.hpp" News::ItemQueues gNewsItems; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 8f96dd2e95..0ef4f6105c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -20,6 +20,9 @@ #include "../actions/PeepPickupAction.h" #include "../core/Guard.hpp" #include "../core/Json.hpp" +#include "../entity/EntityList.h" +#include "../entity/EntityTweener.h" +#include "../entity/Sprite.h" #include "../localisation/Formatting.h" #include "../platform/Platform2.h" #include "../scenario/Scenario.h" @@ -27,10 +30,7 @@ #include "../ui/UiContext.h" #include "../ui/WindowManager.h" #include "../util/SawyerCoding.h" -#include "../world/EntityList.h" -#include "../world/EntityTweener.h" #include "../world/Location.hpp" -#include "../world/Sprite.h" #include "network.h" #include diff --git a/src/openrct2/paint/sprite/Paint.Sprite.cpp b/src/openrct2/paint/sprite/Paint.Sprite.cpp index f85702a72a..dcceb7bfb4 100644 --- a/src/openrct2/paint/sprite/Paint.Sprite.cpp +++ b/src/openrct2/paint/sprite/Paint.Sprite.cpp @@ -11,21 +11,21 @@ #include "../../drawing/Drawing.h" #include "../../drawing/LightFX.h" +#include "../../entity/Balloon.h" +#include "../../entity/Duck.h" +#include "../../entity/EntityList.h" +#include "../../entity/Fountain.h" +#include "../../entity/Litter.h" +#include "../../entity/MoneyEffect.h" +#include "../../entity/Particle.h" #include "../../interface/Viewport.h" #include "../../peep/Staff.h" #include "../../ride/RideData.h" #include "../../ride/TrackDesign.h" #include "../../ride/VehiclePaint.h" -#include "../../world/Balloon.h" #include "../../world/Climate.h" -#include "../../world/Duck.h" -#include "../../world/EntityList.h" -#include "../../world/Fountain.h" -#include "../../world/Litter.h" #include "../../world/MapAnimation.h" -#include "../../world/MoneyEffect.h" #include "../../world/Park.h" -#include "../../world/Particle.h" #include "../Paint.h" /** diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 33d181772c..c6b8edbeac 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -7,11 +7,14 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Paint.h" + #include "../../Context.h" #include "../../Game.h" #include "../../config/Config.h" #include "../../core/Numerics.hpp" #include "../../drawing/LightFX.h" +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" #include "../../object/FootpathObject.h" @@ -24,13 +27,11 @@ #include "../../ride/Track.h" #include "../../ride/TrackDesign.h" #include "../../ride/TrackPaint.h" -#include "../../world/Entity.h" #include "../../world/Footpath.h" #include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/Surface.h" #include "../../world/TileInspector.h" -#include "../Paint.h" #include "../Supports.h" #include "Paint.Surface.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 5cdecc095b..be4cdf1ad2 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -16,6 +16,7 @@ #include "../../core/Guard.hpp" #include "../../core/Numerics.hpp" #include "../../drawing/Drawing.h" +#include "../../entity/Entity.h" #include "../../interface/Colour.h" #include "../../interface/Viewport.h" #include "../../object/ObjectManager.h" @@ -26,7 +27,6 @@ #include "../../peep/Staff.h" #include "../../ride/TrackDesign.h" #include "../../sprites.h" -#include "../../world/Entity.h" #include "../../world/Surface.h" #include "../../world/TileInspector.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index 5970e06fb4..c56096b8c0 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -16,6 +16,10 @@ #include "../config/Config.h" #include "../core/Guard.hpp" #include "../core/Numerics.hpp" +#include "../entity/Balloon.h" +#include "../entity/MoneyEffect.h" +#include "../entity/Particle.h" +#include "../entity/Sprite.h" #include "../interface/Window_internal.h" #include "../localisation/Localisation.h" #include "../management/Finance.h" @@ -34,16 +38,12 @@ #include "../scripting/ScriptEngine.h" #include "../util/Math.hpp" #include "../windows/Intent.h" -#include "../world/Balloon.h" #include "../world/Climate.h" #include "../world/Footpath.h" #include "../world/LargeScenery.h" #include "../world/Map.h" -#include "../world/MoneyEffect.h" #include "../world/Park.h" -#include "../world/Particle.h" #include "../world/Scenery.h" -#include "../world/Sprite.h" #include "../world/Surface.h" #include "../world/TileElementsView.h" #include "GuestPathfinding.h" diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 3193b8d151..6e94b70040 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -19,6 +19,9 @@ #include "../audio/audio.h" #include "../config/Config.h" #include "../core/Guard.hpp" +#include "../entity/Balloon.h" +#include "../entity/EntityTweener.h" +#include "../entity/Sprite.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../management/Finance.h" @@ -34,10 +37,8 @@ #include "../sprites.h" #include "../util/Util.h" #include "../windows/Intent.h" -#include "../world/Balloon.h" #include "../world/Climate.h" #include "../world/ConstructionClearance.h" -#include "../world/EntityTweener.h" #include "../world/Entrance.h" #include "../world/Footpath.h" #include "../world/LargeScenery.h" @@ -45,7 +46,6 @@ #include "../world/Park.h" #include "../world/Scenery.h" #include "../world/SmallScenery.h" -#include "../world/Sprite.h" #include "../world/Surface.h" #include "GuestPathfinding.h" #include "Staff.h" diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index f9b4402b59..ce1890b4c7 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -11,10 +11,10 @@ #include "../Identifiers.h" #include "../common.h" +#include "../entity/EntityBase.h" #include "../ride/RideTypes.h" #include "../ride/Station.h" #include "../util/Util.h" -#include "../world/EntityBase.h" #include "../world/Location.hpp" #include diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 399ec278b6..688b8560a1 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -16,6 +16,7 @@ #include "../actions/StaffSetOrdersAction.h" #include "../audio/audio.h" #include "../config/Config.h" +#include "../entity/Sprite.h" #include "../interface/Viewport.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" @@ -37,7 +38,6 @@ #include "../world/Footpath.h" #include "../world/Scenery.h" #include "../world/SmallScenery.h" -#include "../world/Sprite.h" #include "../world/Surface.h" #include "GuestPathfinding.h" #include "Peep.h" diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index de4f3bff34..3d38fd92ca 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -23,6 +23,14 @@ #include "../core/Memory.hpp" #include "../core/Path.hpp" #include "../core/String.hpp" +#include "../entity/Balloon.h" +#include "../entity/Duck.h" +#include "../entity/EntityList.h" +#include "../entity/Fountain.h" +#include "../entity/Litter.h" +#include "../entity/MoneyEffect.h" +#include "../entity/Particle.h" +#include "../entity/Sprite.h" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" @@ -46,22 +54,14 @@ #include "../scenario/ScenarioSources.h" #include "../util/SawyerCoding.h" #include "../util/Util.h" -#include "../world/Balloon.h" #include "../world/Climate.h" -#include "../world/Duck.h" -#include "../world/EntityList.h" #include "../world/Entrance.h" #include "../world/Footpath.h" -#include "../world/Fountain.h" #include "../world/LargeScenery.h" -#include "../world/Litter.h" #include "../world/MapAnimation.h" -#include "../world/MoneyEffect.h" #include "../world/Park.h" -#include "../world/Particle.h" #include "../world/Scenery.h" #include "../world/SmallScenery.h" -#include "../world/Sprite.h" #include "../world/Surface.h" #include "../world/TilePointerIndex.hpp" #include "../world/Wall.h" diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 245398b047..dd55bb2627 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -11,11 +11,11 @@ #include "../common.h" #include "../core/FileSystem.hpp" +#include "../entity/EntityList.h" #include "../object/Object.h" #include "../rct12/RCT12.h" #include "../ride/RideRatings.h" #include "../ride/VehicleColour.h" -#include "../world/EntityList.h" #include #include diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index dc64d651cd..ec6ace5485 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -22,6 +22,15 @@ #include "../core/Path.hpp" #include "../core/Random.hpp" #include "../core/String.hpp" +#include "../entity/Balloon.h" +#include "../entity/Duck.h" +#include "../entity/EntityList.h" +#include "../entity/EntityTweener.h" +#include "../entity/Fountain.h" +#include "../entity/Litter.h" +#include "../entity/MoneyEffect.h" +#include "../entity/Particle.h" +#include "../entity/Sprite.h" #include "../interface/Viewport.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" @@ -54,20 +63,11 @@ #include "../scenario/ScenarioRepository.h" #include "../util/SawyerCoding.h" #include "../util/Util.h" -#include "../world/Balloon.h" #include "../world/Climate.h" -#include "../world/Duck.h" -#include "../world/EntityList.h" -#include "../world/EntityTweener.h" #include "../world/Entrance.h" -#include "../world/Fountain.h" -#include "../world/Litter.h" #include "../world/MapAnimation.h" -#include "../world/MoneyEffect.h" #include "../world/Park.h" -#include "../world/Particle.h" #include "../world/Scenery.h" -#include "../world/Sprite.h" #include "../world/Surface.h" #include "../world/TilePointerIndex.hpp" diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 8532e08256..70cdbfebbe 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -10,9 +10,9 @@ #include "CableLift.h" #include "../audio/audio.h" +#include "../entity/EntityList.h" #include "../rct12/RCT12.h" #include "../util/Util.h" -#include "../world/EntityList.h" #include "Ride.h" #include "RideData.h" #include "Track.h" diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index d0200de66e..baccefafd5 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -25,6 +25,7 @@ #include "../core/FixedVector.h" #include "../core/Guard.hpp" #include "../core/Numerics.hpp" +#include "../entity/Sprite.h" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" @@ -53,7 +54,6 @@ #include "../world/MapAnimation.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Sprite.h" #include "CableLift.h" #include "RideAudio.h" #include "RideData.h" diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index ef3211f1f0..f4eee0f3ea 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -15,6 +15,9 @@ #include "../actions/RideSetVehicleAction.h" #include "../actions/TrackRemoveAction.h" #include "../common.h" +#include "../entity/Entity.h" +#include "../entity/EntityList.h" +#include "../entity/Sprite.h" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" @@ -27,8 +30,6 @@ #include "../windows/Intent.h" #include "../world/Banner.h" #include "../world/Climate.h" -#include "../world/Entity.h" -#include "../world/EntityList.h" #include "../world/Entrance.h" #include "../world/Footpath.h" #include "../world/Location.hpp" @@ -36,7 +37,6 @@ #include "../world/MapAnimation.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Sprite.h" #include "Ride.h" #include "RideData.h" #include "Track.h" diff --git a/src/openrct2/ride/ShopItem.h b/src/openrct2/ride/ShopItem.h index 0f9b450f60..e1b42a92aa 100644 --- a/src/openrct2/ride/ShopItem.h +++ b/src/openrct2/ride/ShopItem.h @@ -10,8 +10,8 @@ #pragma once #include "../common.h" +#include "../entity/Litter.h" #include "../util/Util.h" -#include "../world/Litter.h" struct Ride; enum class PeepThoughtType : uint8_t; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 0e7f1388b5..8ec18d6204 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -18,6 +18,8 @@ #include "../audio/audio.h" #include "../config/Config.h" #include "../core/Memory.hpp" +#include "../entity/Particle.h" +#include "../entity/Sprite.h" #include "../interface/Viewport.h" #include "../localisation/Localisation.h" #include "../management/NewsItem.h" @@ -31,10 +33,8 @@ #include "../world/Map.h" #include "../world/MapAnimation.h" #include "../world/Park.h" -#include "../world/Particle.h" #include "../world/Scenery.h" #include "../world/SmallScenery.h" -#include "../world/Sprite.h" #include "../world/Surface.h" #include "../world/Wall.h" #include "CableLift.h" diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 2146af930d..1fd340808e 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -11,8 +11,8 @@ #include "../audio/audio.h" #include "../common.h" +#include "../entity/EntityBase.h" #include "../ride/RideTypes.h" -#include "../world/EntityBase.h" #include "../world/Location.hpp" #include "Station.h" #include "VehicleColour.h" diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index 84ecc2748d..30715bb3a3 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -12,12 +12,12 @@ #include "../Game.h" #include "../drawing/Drawing.h" #include "../drawing/LightFX.h" +#include "../entity/Entity.h" #include "../interface/Viewport.h" #include "../paint/Paint.h" #include "../paint/sprite/Paint.Sprite.h" #include "../ride/RideData.h" #include "../ride/Vehicle.h" -#include "../world/Entity.h" #include "Track.h" #include diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index aaabb4d2e2..f434207be5 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -8,12 +8,12 @@ *****************************************************************************/ #include "../../drawing/Drawing.h" +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../paint/tile_element/Paint.TileElement.h" #include "../../sprites.h" -#include "../../world/Entity.h" #include "../../world/Map.h" #include "../RideData.h" #include "../TrackData.h" diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 1e36848b05..a1c44e6456 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -7,11 +7,11 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../peep/Guest.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 81309353fa..3d1d9e83ce 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -8,11 +8,11 @@ *****************************************************************************/ #include "../../config/Config.h" +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../peep/Guest.h" -#include "../../world/Entity.h" #include "../../world/Map.h" #include "../../world/Surface.h" #include "../RideData.h" diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index c00d152c05..19835d7db5 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -8,11 +8,11 @@ *****************************************************************************/ #include "../../common.h" +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../peep/Guest.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 7c8851fb4a..d6d31ad980 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -7,12 +7,12 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../localisation/Localisation.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../sprites.h" -#include "../../world/Entity.h" #include "../../world/Map.h" #include "../RideData.h" #include "../TrackData.h" diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index 558fd8690f..1f0f89b438 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -8,13 +8,13 @@ *****************************************************************************/ #include "../../drawing/Drawing.h" +#include "../../entity/Sprite.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../paint/tile_element/Paint.TileElement.h" #include "../../sprites.h" #include "../../world/Map.h" -#include "../../world/Sprite.h" #include "../RideData.h" #include "../TrackData.h" #include "../TrackPaint.h" diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 74566fb116..a8582aa635 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -20,6 +20,7 @@ #include "../config/Config.h" #include "../core/Guard.hpp" #include "../core/Random.hpp" +#include "../entity/Duck.h" #include "../interface/Viewport.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" @@ -43,7 +44,6 @@ #include "../util/Util.h" #include "../windows/Intent.h" #include "../world/Climate.h" -#include "../world/Duck.h" #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index b7de2b2c80..1a14621ae1 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -11,6 +11,7 @@ #include "../common.h" #include "../core/Random.hpp" +#include "../entity/EntityList.h" #include "../management/Finance.h" #include "../management/Research.h" #include "../object/Object.h" @@ -18,7 +19,6 @@ #include "../ride/RideRatings.h" #include "../world/Banner.h" #include "../world/Climate.h" -#include "../world/EntityList.h" #include "../world/Map.h" #include "../world/MapAnimation.h" diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index 3877eee64f..3a900aede6 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -13,10 +13,10 @@ # include "../../../Context.h" # include "../../../common.h" +# include "../../../entity/EntityList.h" +# include "../../../entity/Sprite.h" # include "../../../peep/Peep.h" # include "../../../util/Util.h" -# include "../../../world/EntityList.h" -# include "../../../world/Sprite.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" diff --git a/src/openrct2/scripting/bindings/world/ScMap.cpp b/src/openrct2/scripting/bindings/world/ScMap.cpp index 0a672ad6b1..405b45fb04 100644 --- a/src/openrct2/scripting/bindings/world/ScMap.cpp +++ b/src/openrct2/scripting/bindings/world/ScMap.cpp @@ -12,18 +12,18 @@ # include "ScMap.hpp" # include "../../../common.h" +# include "../../../entity/Balloon.h" +# include "../../../entity/Duck.h" +# include "../../../entity/EntityList.h" +# include "../../../entity/Fountain.h" +# include "../../../entity/Litter.h" +# include "../../../entity/MoneyEffect.h" +# include "../../../entity/Particle.h" # include "../../../peep/Guest.h" # include "../../../peep/Staff.h" # include "../../../ride/Ride.h" # include "../../../ride/TrainManager.h" -# include "../../../world/Balloon.h" -# include "../../../world/Duck.h" -# include "../../../world/EntityList.h" -# include "../../../world/Fountain.h" -# include "../../../world/Litter.h" # include "../../../world/Map.h" -# include "../../../world/MoneyEffect.h" -# include "../../../world/Particle.h" # include "../../Duktape.hpp" # include "../entity/ScEntity.hpp" # include "../entity/ScGuest.hpp" diff --git a/src/openrct2/scripting/bindings/world/ScTile.cpp b/src/openrct2/scripting/bindings/world/ScTile.cpp index 28d4d2751b..17344dba11 100644 --- a/src/openrct2/scripting/bindings/world/ScTile.cpp +++ b/src/openrct2/scripting/bindings/world/ScTile.cpp @@ -14,10 +14,10 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../core/Guard.hpp" +# include "../../../entity/Sprite.h" # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" -# include "../../../world/Sprite.h" # include "../../../world/Surface.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 6605812e97..6033ef5d5e 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -14,10 +14,10 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../core/Guard.hpp" +# include "../../../entity/Sprite.h" # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" -# include "../../../world/Sprite.h" # include "../../../world/Surface.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.hpp b/src/openrct2/scripting/bindings/world/ScTileElement.hpp index feca670d5c..586103fa05 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.hpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.hpp @@ -14,10 +14,10 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../core/Guard.hpp" +# include "../../../entity/Sprite.h" # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" -# include "../../../world/Sprite.h" # include "../../../world/Surface.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 0e048cedd6..61fb01c0e6 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -15,6 +15,8 @@ #include "../actions/FootpathRemoveAction.h" #include "../actions/LandSetRightsAction.h" #include "../core/Guard.hpp" +#include "../entity/EntityList.h" +#include "../entity/Sprite.h" #include "../interface/Window_internal.h" #include "../localisation/Localisation.h" #include "../management/Finance.h" @@ -30,11 +32,9 @@ #include "../ride/Track.h" #include "../ride/TrackData.h" #include "../util/Util.h" -#include "EntityList.h" #include "Map.h" #include "MapAnimation.h" #include "Park.h" -#include "Sprite.h" #include "Surface.h" #include diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index f80a5a5271..8ae4e93391 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -11,6 +11,7 @@ #include "../Context.h" #include "../Game.h" +#include "../entity/EntityList.h" #include "../interface/Viewport.h" #include "../object/StationObject.h" #include "../peep/Peep.h" @@ -19,7 +20,6 @@ #include "../ride/Track.h" #include "../world/Wall.h" #include "Banner.h" -#include "EntityList.h" #include "Footpath.h" #include "LargeScenery.h" #include "Map.h" diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index ddcec0d235..2aa4df84b7 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -19,6 +19,7 @@ #include "../config/Config.h" #include "../core/Memory.hpp" #include "../core/String.hpp" +#include "../entity/Litter.h" #include "../interface/Colour.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" @@ -36,7 +37,6 @@ #include "../util/Util.h" #include "../windows/Intent.h" #include "Entrance.h" -#include "Litter.h" #include "Map.h" #include "Surface.h" diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 278d6cb947..03ba51ebea 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -19,6 +19,7 @@ #include "../actions/SmallSceneryRemoveAction.h" #include "../actions/WallRemoveAction.h" #include "../common.h" +#include "../entity/Fountain.h" #include "../localisation/Localisation.h" #include "../network/network.h" #include "../object/ObjectList.h" @@ -26,7 +27,6 @@ #include "../scenario/Scenario.h" #include "Climate.h" #include "Footpath.h" -#include "Fountain.h" #include "LargeScenery.h" #include "Map.h" #include "Park.h" diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 8d6bbd9e53..ecbb48e9e9 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -17,15 +17,15 @@ #include #include #include +#include +#include #include #include #include #include -#include #include #include #include -#include #include using namespace OpenRCT2; diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 2a8285229b..ab259cfa15 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -25,14 +25,14 @@ #include #include #include +#include +#include #include #include #include #include #include -#include #include -#include #include #include From 03fb9b390f459d1287bd8010f1ae69c3aecec141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:58:01 +0200 Subject: [PATCH 09/12] Rename Sprite to EntityRegistry --- src/openrct2-ui/WindowManager.cpp | 2 +- src/openrct2-ui/interface/ViewportInteraction.cpp | 2 +- src/openrct2-ui/interface/Window.cpp | 2 +- src/openrct2-ui/scripting/ScTitleSequence.hpp | 2 +- src/openrct2-ui/title/TitleSequencePlayer.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2/Game.cpp | 2 +- src/openrct2/GameState.cpp | 2 +- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/ParkFile.cpp | 2 +- src/openrct2/ReplayManager.cpp | 2 +- src/openrct2/actions/SetCheatAction.cpp | 2 +- src/openrct2/actions/StaffHireNewAction.cpp | 2 +- src/openrct2/entity/{Sprite.cpp => EntityRegistry.cpp} | 2 +- src/openrct2/entity/{Sprite.h => EntityRegistry.h} | 0 src/openrct2/entity/Litter.cpp | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 2 +- src/openrct2/libopenrct2.vcxproj | 4 ++-- src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/paint/tile_element/Paint.Path.cpp | 3 +-- src/openrct2/peep/Guest.cpp | 2 +- src/openrct2/peep/Peep.cpp | 2 +- src/openrct2/peep/Staff.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/RideConstruction.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/transport/SuspendedMonorail.cpp | 2 +- src/openrct2/scripting/bindings/entity/ScEntity.hpp | 2 +- src/openrct2/scripting/bindings/world/ScTile.cpp | 2 +- src/openrct2/scripting/bindings/world/ScTileElement.cpp | 2 +- src/openrct2/scripting/bindings/world/ScTileElement.hpp | 2 +- src/openrct2/world/Footpath.cpp | 2 +- test/tests/PlayTests.cpp | 2 +- test/tests/S6ImportExportTests.cpp | 2 +- 36 files changed, 36 insertions(+), 37 deletions(-) rename src/openrct2/entity/{Sprite.cpp => EntityRegistry.cpp} (99%) rename src/openrct2/entity/{Sprite.h => EntityRegistry.h} (100%) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 1fa73f6dc0..cc5b861ba7 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index d0503d828e..19523c86fb 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 7f213856c4..c2f7df569d 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index 0ea84d6a88..411fb29c4d 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -16,7 +16,7 @@ # include # include # include -# include +# include # include # include # include diff --git a/src/openrct2-ui/title/TitleSequencePlayer.cpp b/src/openrct2-ui/title/TitleSequencePlayer.cpp index be1fb8b856..069ef308e6 100644 --- a/src/openrct2-ui/title/TitleSequencePlayer.cpp +++ b/src/openrct2-ui/title/TitleSequencePlayer.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 4f6793daf7..2bb0fe4840 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index b04dc48f86..1a9d16fb67 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -25,7 +25,7 @@ #include "core/Console.hpp" #include "core/FileScanner.h" #include "core/Path.hpp" -#include "entity/Sprite.h" +#include "entity/EntityRegistry.h" #include "interface/Colour.h" #include "interface/Screenshot.h" #include "interface/Viewport.h" diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 88dcfe67d2..ce56d00782 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -19,7 +19,7 @@ #include "ReplayManager.h" #include "actions/GameAction.h" #include "config/Config.h" -#include "entity/Sprite.h" +#include "entity/EntityRegistry.h" #include "interface/Screenshot.h" #include "localisation/Date.h" #include "localisation/Localisation.h" diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 3a0b00dbee..bf3cf80d2f 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -13,11 +13,11 @@ #include "entity/Balloon.h" #include "entity/Duck.h" #include "entity/EntityList.h" +#include "entity/EntityRegistry.h" #include "entity/Fountain.h" #include "entity/Litter.h" #include "entity/MoneyEffect.h" #include "entity/Particle.h" -#include "entity/Sprite.h" #include "peep/Guest.h" #include "peep/Staff.h" #include "ride/Vehicle.h" diff --git a/src/openrct2/ParkFile.cpp b/src/openrct2/ParkFile.cpp index 7f78bf67e1..a148006835 100644 --- a/src/openrct2/ParkFile.cpp +++ b/src/openrct2/ParkFile.cpp @@ -26,11 +26,11 @@ #include "entity/Balloon.h" #include "entity/Duck.h" #include "entity/EntityList.h" +#include "entity/EntityRegistry.h" #include "entity/Fountain.h" #include "entity/Litter.h" #include "entity/MoneyEffect.h" #include "entity/Particle.h" -#include "entity/Sprite.h" #include "interface/Viewport.h" #include "interface/Window.h" #include "localisation/Date.h" diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index c6b99bc3f4..151c5d3274 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -26,8 +26,8 @@ #include "config/Config.h" #include "core/DataSerialiser.h" #include "core/Path.hpp" +#include "entity/EntityRegistry.h" #include "entity/EntityTweener.h" -#include "entity/Sprite.h" #include "management/NewsItem.h" #include "object/ObjectManager.h" #include "object/ObjectRepository.h" diff --git a/src/openrct2/actions/SetCheatAction.cpp b/src/openrct2/actions/SetCheatAction.cpp index 5d5c69e0b2..3b8c165d75 100644 --- a/src/openrct2/actions/SetCheatAction.cpp +++ b/src/openrct2/actions/SetCheatAction.cpp @@ -16,7 +16,7 @@ #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../entity/Duck.h" -#include "../entity/Sprite.h" +#include "../entity/EntityRegistry.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../network/network.h" diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index c643e1ca69..6944570e61 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -13,7 +13,7 @@ #include "../Context.h" #include "../core/MemoryStream.h" #include "../drawing/Drawing.h" -#include "../entity/Sprite.h" +#include "../entity/EntityRegistry.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" diff --git a/src/openrct2/entity/Sprite.cpp b/src/openrct2/entity/EntityRegistry.cpp similarity index 99% rename from src/openrct2/entity/Sprite.cpp rename to src/openrct2/entity/EntityRegistry.cpp index 882d9beb88..477a561116 100644 --- a/src/openrct2/entity/Sprite.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -7,7 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "Sprite.h" +#include "EntityRegistry.h" #include "../Game.h" #include "../core/ChecksumStream.h" diff --git a/src/openrct2/entity/Sprite.h b/src/openrct2/entity/EntityRegistry.h similarity index 100% rename from src/openrct2/entity/Sprite.h rename to src/openrct2/entity/EntityRegistry.h diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 907a16961e..9ddecf9700 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -5,7 +5,7 @@ #include "../localisation/StringIds.h" #include "../world/Map.h" #include "EntityList.h" -#include "Sprite.h" +#include "EntityRegistry.h" static bool isLocationLitterable(const CoordsXYZ& mapPos) { diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index c68c19fdde..9156864e20 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -29,7 +29,7 @@ #include "../drawing/Drawing.h" #include "../drawing/Font.h" #include "../entity/EntityList.h" -#include "../entity/Sprite.h" +#include "../entity/EntityRegistry.h" #include "../interface/Chat.h" #include "../interface/Colour.h" #include "../interface/Window_internal.h" diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 731425205f..766eeef138 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -210,12 +210,12 @@ + - @@ -665,12 +665,12 @@ + - diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 0ef4f6105c..1c38c79f22 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -21,8 +21,8 @@ #include "../core/Guard.hpp" #include "../core/Json.hpp" #include "../entity/EntityList.h" +#include "../entity/EntityRegistry.h" #include "../entity/EntityTweener.h" -#include "../entity/Sprite.h" #include "../localisation/Formatting.h" #include "../platform/Platform2.h" #include "../scenario/Scenario.h" diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index c6b8edbeac..1a2b28b884 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -7,8 +7,6 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "../Paint.h" - #include "../../Context.h" #include "../../Game.h" #include "../../config/Config.h" @@ -32,6 +30,7 @@ #include "../../world/Scenery.h" #include "../../world/Surface.h" #include "../../world/TileInspector.h" +#include "../Paint.h" #include "../Supports.h" #include "Paint.Surface.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index c56096b8c0..fd004e97cf 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -17,9 +17,9 @@ #include "../core/Guard.hpp" #include "../core/Numerics.hpp" #include "../entity/Balloon.h" +#include "../entity/EntityRegistry.h" #include "../entity/MoneyEffect.h" #include "../entity/Particle.h" -#include "../entity/Sprite.h" #include "../interface/Window_internal.h" #include "../localisation/Localisation.h" #include "../management/Finance.h" diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index 6e94b70040..096d4a8a43 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -20,8 +20,8 @@ #include "../config/Config.h" #include "../core/Guard.hpp" #include "../entity/Balloon.h" +#include "../entity/EntityRegistry.h" #include "../entity/EntityTweener.h" -#include "../entity/Sprite.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../management/Finance.h" diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 688b8560a1..d4e3acca6e 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -16,7 +16,7 @@ #include "../actions/StaffSetOrdersAction.h" #include "../audio/audio.h" #include "../config/Config.h" -#include "../entity/Sprite.h" +#include "../entity/EntityRegistry.h" #include "../interface/Viewport.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 3d38fd92ca..ff8bee8b0d 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -26,11 +26,11 @@ #include "../entity/Balloon.h" #include "../entity/Duck.h" #include "../entity/EntityList.h" +#include "../entity/EntityRegistry.h" #include "../entity/Fountain.h" #include "../entity/Litter.h" #include "../entity/MoneyEffect.h" #include "../entity/Particle.h" -#include "../entity/Sprite.h" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index ec6ace5485..c72d06fbe0 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -25,12 +25,12 @@ #include "../entity/Balloon.h" #include "../entity/Duck.h" #include "../entity/EntityList.h" +#include "../entity/EntityRegistry.h" #include "../entity/EntityTweener.h" #include "../entity/Fountain.h" #include "../entity/Litter.h" #include "../entity/MoneyEffect.h" #include "../entity/Particle.h" -#include "../entity/Sprite.h" #include "../interface/Viewport.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index baccefafd5..a6f37a275e 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -25,7 +25,7 @@ #include "../core/FixedVector.h" #include "../core/Guard.hpp" #include "../core/Numerics.hpp" -#include "../entity/Sprite.h" +#include "../entity/EntityRegistry.h" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index f4eee0f3ea..d327627ae5 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -17,7 +17,7 @@ #include "../common.h" #include "../entity/Entity.h" #include "../entity/EntityList.h" -#include "../entity/Sprite.h" +#include "../entity/EntityRegistry.h" #include "../interface/Window.h" #include "../localisation/Date.h" #include "../localisation/Localisation.h" diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 8ec18d6204..c717cfdc03 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -18,8 +18,8 @@ #include "../audio/audio.h" #include "../config/Config.h" #include "../core/Memory.hpp" +#include "../entity/EntityRegistry.h" #include "../entity/Particle.h" -#include "../entity/Sprite.h" #include "../interface/Viewport.h" #include "../localisation/Localisation.h" #include "../management/NewsItem.h" diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index 1f0f89b438..4b98dc6947 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -8,7 +8,7 @@ *****************************************************************************/ #include "../../drawing/Drawing.h" -#include "../../entity/Sprite.h" +#include "../../entity/EntityRegistry.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" diff --git a/src/openrct2/scripting/bindings/entity/ScEntity.hpp b/src/openrct2/scripting/bindings/entity/ScEntity.hpp index 3a900aede6..b08067f26a 100644 --- a/src/openrct2/scripting/bindings/entity/ScEntity.hpp +++ b/src/openrct2/scripting/bindings/entity/ScEntity.hpp @@ -14,7 +14,7 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../entity/EntityList.h" -# include "../../../entity/Sprite.h" +# include "../../../entity/EntityRegistry.h" # include "../../../peep/Peep.h" # include "../../../util/Util.h" # include "../../Duktape.hpp" diff --git a/src/openrct2/scripting/bindings/world/ScTile.cpp b/src/openrct2/scripting/bindings/world/ScTile.cpp index 17344dba11..50b4c6a522 100644 --- a/src/openrct2/scripting/bindings/world/ScTile.cpp +++ b/src/openrct2/scripting/bindings/world/ScTile.cpp @@ -14,7 +14,7 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../core/Guard.hpp" -# include "../../../entity/Sprite.h" +# include "../../../entity/EntityRegistry.h" # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 6033ef5d5e..bc19abc6d3 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -14,7 +14,7 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../core/Guard.hpp" -# include "../../../entity/Sprite.h" +# include "../../../entity/EntityRegistry.h" # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.hpp b/src/openrct2/scripting/bindings/world/ScTileElement.hpp index 586103fa05..40661f0525 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.hpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.hpp @@ -14,7 +14,7 @@ # include "../../../Context.h" # include "../../../common.h" # include "../../../core/Guard.hpp" -# include "../../../entity/Sprite.h" +# include "../../../entity/EntityRegistry.h" # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 61fb01c0e6..b44a65c7cd 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -16,7 +16,7 @@ #include "../actions/LandSetRightsAction.h" #include "../core/Guard.hpp" #include "../entity/EntityList.h" -#include "../entity/Sprite.h" +#include "../entity/EntityRegistry.h" #include "../interface/Window_internal.h" #include "../localisation/Localisation.h" #include "../management/Finance.h" diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index ecbb48e9e9..f4a4a3230e 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -17,8 +17,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index ab259cfa15..3d81db9431 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -25,8 +25,8 @@ #include #include #include +#include #include -#include #include #include #include From 00242523282d693cc56aad58e0f35158162faad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 17:19:52 +0200 Subject: [PATCH 10/12] Fix includes --- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/GuestList.cpp | 2 +- src/openrct2-ui/windows/Map.cpp | 4 ++-- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2/Context.cpp | 4 ++-- src/openrct2/Editor.cpp | 4 ++-- src/openrct2/actions/RideDemolishAction.cpp | 2 +- src/openrct2/cmdline/SimulateCommands.cpp | 2 +- src/openrct2/drawing/LightFX.cpp | 2 +- src/openrct2/entity/Balloon.cpp | 2 +- src/openrct2/entity/Duck.cpp | 2 +- src/openrct2/entity/EntityTweener.cpp | 2 +- src/openrct2/entity/Fountain.cpp | 2 +- src/openrct2/entity/MoneyEffect.cpp | 2 +- src/openrct2/entity/Particle.cpp | 2 +- src/openrct2/interface/Window_internal.cpp | 4 ++-- src/openrct2/paint/sprite/Paint.Litter.cpp | 2 +- src/openrct2/paint/sprite/Paint.Misc.cpp | 10 +++++----- src/openrct2/ride/TrainManager.cpp | 4 ++-- src/openrct2/ride/gentle/Circus.cpp | 2 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 2 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 2 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 2 +- src/openrct2/ride/thrill/3dCinema.cpp | 2 +- src/openrct2/ride/thrill/Enterprise.cpp | 2 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 2 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 2 +- src/openrct2/ride/thrill/SwingingInverterShip.cpp | 2 +- src/openrct2/ride/thrill/SwingingShip.cpp | 2 +- src/openrct2/ride/thrill/Twist.cpp | 2 +- src/openrct2/ride/water/SplashBoats.cpp | 2 +- 31 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 888c7bb636..9e6cfe7915 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -25,7 +26,6 @@ #include #include #include -#include #include // clang-format off diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 6c9cf7c723..895de1fca0 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include static constexpr const rct_string_id WINDOW_TITLE = STR_GUESTS; diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index a04abb06da..d473f02d3e 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -24,17 +24,17 @@ #include #include #include +#include +#include #include #include #include #include #include #include -#include #include #include #include -#include #include #include diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index b09b54eb17..3ef101662c 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -53,7 +54,6 @@ #include #include #include -#include #include #include #include diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index 8c9a49d1c6..a6bad7b8cd 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -39,6 +39,8 @@ #include "core/String.hpp" #include "drawing/IDrawingEngine.h" #include "drawing/LightFX.h" +#include "entity/EntityRegistry.h" +#include "entity/EntityTweener.h" #include "interface/Chat.h" #include "interface/InteractiveConsole.h" #include "interface/Viewport.h" @@ -65,9 +67,7 @@ #include "ui/UiContext.h" #include "ui/WindowManager.h" #include "util/Util.h" -#include "world/EntityTweener.h" #include "world/Park.h" -#include "world/Sprite.h" #include #include diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 72f815119d..c76173755a 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -19,6 +19,8 @@ #include "actions/LandBuyRightsAction.h" #include "actions/LandSetRightsAction.h" #include "audio/audio.h" +#include "entity/EntityList.h" +#include "entity/EntityRegistry.h" #include "interface/Viewport.h" #include "interface/Window_internal.h" #include "localisation/Localisation.h" @@ -36,12 +38,10 @@ #include "util/Util.h" #include "windows/Intent.h" #include "world/Climate.h" -#include "world/EntityList.h" #include "world/Entrance.h" #include "world/Footpath.h" #include "world/Park.h" #include "world/Scenery.h" -#include "world/Sprite.h" #include #include diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index cab6435f44..5b167de738 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -14,6 +14,7 @@ #include "../GameState.h" #include "../core/MemoryStream.h" #include "../drawing/Drawing.h" +#include "../entity/EntityList.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../management/NewsItem.h" @@ -23,7 +24,6 @@ #include "../ui/UiContext.h" #include "../ui/WindowManager.h" #include "../world/Banner.h" -#include "../world/EntityList.h" #include "../world/Park.h" #include "MazeSetTrackAction.h" #include "TrackRemoveAction.h" diff --git a/src/openrct2/cmdline/SimulateCommands.cpp b/src/openrct2/cmdline/SimulateCommands.cpp index 9709e41634..26a1ff0ea5 100644 --- a/src/openrct2/cmdline/SimulateCommands.cpp +++ b/src/openrct2/cmdline/SimulateCommands.cpp @@ -12,9 +12,9 @@ #include "../GameState.h" #include "../OpenRCT2.h" #include "../core/Console.hpp" +#include "../entity/EntityRegistry.h" #include "../network/network.h" #include "../platform/platform.h" -#include "../world/Sprite.h" #include "CommandLine.hpp" #include diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 30861d5299..5b19babe33 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -14,6 +14,7 @@ # include "../Game.h" # include "../common.h" # include "../config/Config.h" +# include "../entity/Entity.h" # include "../interface/Viewport.h" # include "../interface/Window.h" # include "../interface/Window_internal.h" @@ -22,7 +23,6 @@ # include "../ride/Vehicle.h" # include "../util/Util.h" # include "../world/Climate.h" -# include "../world/Entity.h" # include "../world/Map.h" # include "Drawing.h" diff --git a/src/openrct2/entity/Balloon.cpp b/src/openrct2/entity/Balloon.cpp index 05d41729ca..46c37af892 100644 --- a/src/openrct2/entity/Balloon.cpp +++ b/src/openrct2/entity/Balloon.cpp @@ -14,7 +14,7 @@ #include "../network/network.h" #include "../scenario/Scenario.h" #include "../util/Util.h" -#include "Sprite.h" +#include "EntityRegistry.h" template<> bool EntityBase::Is() const { diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index 440ee09412..fc20164eaf 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -14,7 +14,7 @@ #include "../scenario/Scenario.h" #include "../sprites.h" #include "../world/Surface.h" -#include "Sprite.h" +#include "EntityRegistry.h" #include #include diff --git a/src/openrct2/entity/EntityTweener.cpp b/src/openrct2/entity/EntityTweener.cpp index 721c2b715c..ccb350b5e1 100644 --- a/src/openrct2/entity/EntityTweener.cpp +++ b/src/openrct2/entity/EntityTweener.cpp @@ -12,7 +12,7 @@ #include "../peep/Staff.h" #include "../ride/Vehicle.h" #include "EntityList.h" -#include "Sprite.h" +#include "EntityRegistry.h" #include void EntityTweener::PopulateEntities() diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index 65ebf0862a..9d804d7057 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -14,7 +14,7 @@ #include "../world/Footpath.h" #include "../world/Map.h" #include "../world/Scenery.h" -#include "Sprite.h" +#include "EntityRegistry.h" enum class PATTERN { diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index 6fef24af4a..10327bdc6b 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -16,7 +16,7 @@ #include "../network/network.h" #include "../world/Map.h" #include "Entity.h" -#include "Sprite.h" +#include "EntityRegistry.h" static constexpr const CoordsXY _moneyEffectMoveOffset[] = { { 1, -1 }, diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index 1c711420a1..a1690662e4 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -11,7 +11,7 @@ #include "../audio/audio.h" #include "../paint/sprite/Paint.Sprite.h" #include "../scenario/Scenario.h" -#include "Sprite.h" +#include "EntityRegistry.h" #include diff --git a/src/openrct2/interface/Window_internal.cpp b/src/openrct2/interface/Window_internal.cpp index 35aaa071db..c5ff819125 100644 --- a/src/openrct2/interface/Window_internal.cpp +++ b/src/openrct2/interface/Window_internal.cpp @@ -1,7 +1,7 @@ #include "Window_internal.h" -#include "../world/Entity.h" -#include "../world/EntityList.h" +#include "../entity/Entity.h" +#include "../entity/EntityList.h" #include "Viewport.h" void rct_window::SetLocation(const CoordsXYZ& coords) diff --git a/src/openrct2/paint/sprite/Paint.Litter.cpp b/src/openrct2/paint/sprite/Paint.Litter.cpp index b06495eebc..c80fd38ad1 100644 --- a/src/openrct2/paint/sprite/Paint.Litter.cpp +++ b/src/openrct2/paint/sprite/Paint.Litter.cpp @@ -7,8 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Litter.h" #include "../../interface/Viewport.h" -#include "../../world/Litter.h" #include "../Paint.h" #include "Paint.Sprite.h" diff --git a/src/openrct2/paint/sprite/Paint.Misc.cpp b/src/openrct2/paint/sprite/Paint.Misc.cpp index 4e119ace7e..98519cbd37 100644 --- a/src/openrct2/paint/sprite/Paint.Misc.cpp +++ b/src/openrct2/paint/sprite/Paint.Misc.cpp @@ -8,13 +8,13 @@ *****************************************************************************/ #include "../../drawing/Drawing.h" +#include "../../entity/Balloon.h" +#include "../../entity/Duck.h" +#include "../../entity/Fountain.h" +#include "../../entity/MoneyEffect.h" +#include "../../entity/Particle.h" #include "../../interface/Viewport.h" #include "../../localisation/StringIds.h" -#include "../../world/Balloon.h" -#include "../../world/Duck.h" -#include "../../world/Fountain.h" -#include "../../world/MoneyEffect.h" -#include "../../world/Particle.h" #include "../Paint.h" #include "Paint.Sprite.h" diff --git a/src/openrct2/ride/TrainManager.cpp b/src/openrct2/ride/TrainManager.cpp index eea7d347ef..6d12824ace 100644 --- a/src/openrct2/ride/TrainManager.cpp +++ b/src/openrct2/ride/TrainManager.cpp @@ -9,8 +9,8 @@ #include "TrainManager.h" -#include "../world/Entity.h" -#include "../world/EntityList.h" +#include "../entity/Entity.h" +#include "../entity/EntityList.h" #include "Vehicle.h" namespace TrainManager diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index a26a4bd67e..781afaed2f 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -7,10 +7,10 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index 19e14172e3..baa4f52efb 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -7,10 +7,10 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index cc05ce5b17..eec24a95d5 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -7,10 +7,10 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index 545b5fb0af..e49dd47410 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -7,10 +7,10 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 4abb5b05e9..358cc0b41f 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -7,10 +7,10 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index c89cc39bd0..c4f09dc2b8 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -8,10 +8,10 @@ *****************************************************************************/ #include "../../common.h" +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 8481ea262d..f919c3b47f 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -7,11 +7,11 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 0d80da8ad9..f0ed28fcd2 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -7,10 +7,10 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index bcbdb97980..76a22e985b 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -7,11 +7,11 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index f57d67cac5..83d22b212d 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -7,11 +7,11 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../object/StationObject.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 4422b484ce..0080f3cc49 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -8,10 +8,10 @@ *****************************************************************************/ #include "../../common.h" +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 097d29bf6b..1e3a21a58b 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -8,11 +8,11 @@ *****************************************************************************/ #include "../../config/Config.h" +#include "../../entity/Entity.h" #include "../../interface/Viewport.h" #include "../../paint/Paint.h" #include "../../paint/Supports.h" #include "../../paint/sprite/Paint.Sprite.h" -#include "../../world/Entity.h" #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" From 213064e312c5b6fa7ef68f73bbef98c09144e1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 18:25:43 +0200 Subject: [PATCH 11/12] Revert old storage until the complex member types are gone --- src/openrct2/entity/EntityRegistry.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index 477a561116..a020a56b40 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -36,20 +36,12 @@ union Entity { - EntityBase base{}; - Vehicle vehicle; - Guest guest; - Staff staff; - Litter litter; - SteamParticle steamParticle; - MoneyEffect money; - VehicleCrashParticle crashParticle; - ExplosionCloud explosionCloud; - CrashSplashParticle crashSplash; - ExplosionFlare explosionFlare; - JumpingFountain jumpingFountain; - Balloon balloon; - Duck duck; + uint8_t pad_00[0x200]; + EntityBase base; + Entity() + : pad_00() + { + } }; static Entity _entities[MAX_ENTITIES]{}; From 860fb77da4daf4b1c3ae59769ee2c0bc02349efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 24 Nov 2021 19:03:41 +0200 Subject: [PATCH 12/12] Apply review suggestions --- src/openrct2/entity/EntityRegistry.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index a020a56b40..a1f48a6c17 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -153,7 +153,7 @@ EntityBase* GetEntity(size_t entityIndex) { return nullptr; } - openrct2_assert(entityIndex < MAX_ENTITIES, "Tried getting sprite %u", entityIndex); + openrct2_assert(entityIndex < MAX_ENTITIES, "Tried getting entity %u", entityIndex); return TryGetEntity(entityIndex); }