Skip to content

Commit

Permalink
Remove entity save file code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Hopkinson committed Mar 26, 2024
1 parent f86ddbc commit fe4263e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 18 deletions.
6 changes: 0 additions & 6 deletions src/openrct2/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,6 @@ void GameLoadInit()
auto& gameState = GetGameState();
windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation);

if (gameState.CurrentlyFollowingEntity != EntityId::GetNull())
{
auto* mainWindow = WindowGetMain();
WindowFollowSprite(*mainWindow, gameState.CurrentlyFollowingEntity);
}

if (NetworkGetMode() != NETWORK_MODE_CLIENT)
{
GameActions::ClearQueue();
Expand Down
2 changes: 0 additions & 2 deletions src/openrct2/GameState.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "Date.h"
#include "Editor.h"
#include "Limits.h"
#include "entity/EntityRegistry.h"
#include "interface/ZoomLevel.h"
#include "management/Award.h"
#include "management/Finance.h"
Expand Down Expand Up @@ -134,7 +133,6 @@ namespace OpenRCT2
ScreenCoordsXY SavedView;
uint8_t SavedViewRotation;
ZoomLevel SavedViewZoom;
EntityId CurrentlyFollowingEntity{ EntityId::GetNull() };

ObjectEntryIndex LastEntranceStyle;

Expand Down
2 changes: 0 additions & 2 deletions src/openrct2/interface/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1822,15 +1822,13 @@ void WindowFollowSprite(WindowBase& w, EntityId spriteIndex)
if (spriteIndex.ToUnderlying() < MAX_ENTITIES || spriteIndex.IsNull())
{
w.viewport_smart_follow_sprite = spriteIndex;
GetGameState().CurrentlyFollowingEntity = spriteIndex;
}
}

void WindowUnfollowSprite(WindowBase& w)
{
w.viewport_smart_follow_sprite = EntityId::GetNull();
w.viewport_target_sprite = EntityId::GetNull();
GetGameState().CurrentlyFollowingEntity = EntityId::GetNull();
}

Viewport* WindowGetViewport(WindowBase* w)
Expand Down
8 changes: 1 addition & 7 deletions src/openrct2/park/ParkFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ namespace OpenRCT2

void ReadWriteInterfaceChunk(GameState_t& gameState, OrcaStream& os)
{
os.ReadWriteChunk(ParkFileChunkType::INTERFACE, [&gameState, &os](OrcaStream::ChunkStream& cs) {
os.ReadWriteChunk(ParkFileChunkType::INTERFACE, [&gameState](OrcaStream::ChunkStream& cs) {
cs.ReadWrite(gameState.SavedView.x);
cs.ReadWrite(gameState.SavedView.y);
if (cs.GetMode() == OrcaStream::Mode::READING)
Expand All @@ -617,12 +617,6 @@ namespace OpenRCT2
cs.Write(static_cast<int8_t>(gameState.SavedViewZoom));
}
cs.ReadWrite(gameState.SavedViewRotation);

if (os.GetHeader().TargetVersion >= PARK_FILE_CURRENT_VERSION)
cs.ReadWrite(gameState.CurrentlyFollowingEntity);
else
gameState.CurrentlyFollowingEntity = EntityId::GetNull();

cs.ReadWrite(gameState.LastEntranceStyle);
cs.ReadWrite(gameState.EditorStep);
});
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/park/ParkFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace OpenRCT2
struct GameState_t;

// Current version that is saved.
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 34;
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 33;

// The minimum version that is forwards compatible with the current version.
constexpr uint32_t PARK_FILE_MIN_VERSION = 33;
Expand Down

0 comments on commit fe4263e

Please sign in to comment.