mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 15:54:31 +01:00
Load and save interface chunk
This commit is contained in:
@@ -68,6 +68,7 @@ void ParkFile::Save(const std::string_view& path)
|
||||
WriteAuthoringChunk();
|
||||
WriteObjectsChunk();
|
||||
WriteGeneralChunk();
|
||||
WriteInterfaceChunk();
|
||||
WriteTilesChunk();
|
||||
|
||||
// TODO avoid copying the buffer
|
||||
@@ -233,6 +234,17 @@ void ParkFile::WriteGeneralChunk()
|
||||
EndChunk();
|
||||
}
|
||||
|
||||
void ParkFile::WriteInterfaceChunk()
|
||||
{
|
||||
BeginChunk(ParkFileChunkType::INTERFACE);
|
||||
WriteValue(gSavedViewX);
|
||||
WriteValue(gSavedViewY);
|
||||
WriteValue(gSavedViewZoom);
|
||||
WriteValue(gSavedViewRotation);
|
||||
WriteValue<uint32_t>(gLastEntranceStyle);
|
||||
EndChunk();
|
||||
}
|
||||
|
||||
void ParkFile::WriteTilesChunk()
|
||||
{
|
||||
BeginChunk(ParkFileChunkType::TILES);
|
||||
@@ -299,6 +311,7 @@ void ParkFile::Import()
|
||||
{
|
||||
ReadTilesChunk();
|
||||
ReadGeneralChunk();
|
||||
ReadInterfaceChunk();
|
||||
}
|
||||
|
||||
ParkFile::Header ParkFile::ReadHeader(std::istream& fs)
|
||||
@@ -393,6 +406,18 @@ void ParkFile::ReadGeneralChunk()
|
||||
}
|
||||
}
|
||||
|
||||
void ParkFile::ReadInterfaceChunk()
|
||||
{
|
||||
if (SeekChunk(ParkFileChunkType::INTERFACE))
|
||||
{
|
||||
gSavedViewX = ReadValue<uint16_t>();
|
||||
gSavedViewY = ReadValue<uint16_t>();
|
||||
gSavedViewZoom = ReadValue<uint8_t>();
|
||||
gSavedViewRotation = ReadValue<uint8_t>();
|
||||
gLastEntranceStyle = ReadValue<uint32_t>();
|
||||
}
|
||||
}
|
||||
|
||||
void ParkFile::ReadTilesChunk()
|
||||
{
|
||||
if (SeekChunk(ParkFileChunkType::TILES))
|
||||
|
||||
@@ -68,9 +68,11 @@ namespace OpenRCT2
|
||||
void WriteAuthoringChunk();
|
||||
void WriteObjectsChunk();
|
||||
void WriteGeneralChunk();
|
||||
void WriteInterfaceChunk();
|
||||
void WriteTilesChunk();
|
||||
|
||||
void ReadGeneralChunk();
|
||||
void ReadInterfaceChunk();
|
||||
void ReadTilesChunk();
|
||||
|
||||
Header ReadHeader(std::istream& fs);
|
||||
|
||||
Reference in New Issue
Block a user