mirror of https://github.com/OpenRCT2/OpenRCT2.git
Load and save interface chunk
This commit is contained in:
parent
2fc8e06a95
commit
3aaef84392
|
@ -68,6 +68,7 @@ void ParkFile::Save(const std::string_view& path)
|
||||||
WriteAuthoringChunk();
|
WriteAuthoringChunk();
|
||||||
WriteObjectsChunk();
|
WriteObjectsChunk();
|
||||||
WriteGeneralChunk();
|
WriteGeneralChunk();
|
||||||
|
WriteInterfaceChunk();
|
||||||
WriteTilesChunk();
|
WriteTilesChunk();
|
||||||
|
|
||||||
// TODO avoid copying the buffer
|
// TODO avoid copying the buffer
|
||||||
|
@ -233,6 +234,17 @@ void ParkFile::WriteGeneralChunk()
|
||||||
EndChunk();
|
EndChunk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ParkFile::WriteInterfaceChunk()
|
||||||
|
{
|
||||||
|
BeginChunk(ParkFileChunkType::INTERFACE);
|
||||||
|
WriteValue(gSavedViewX);
|
||||||
|
WriteValue(gSavedViewY);
|
||||||
|
WriteValue(gSavedViewZoom);
|
||||||
|
WriteValue(gSavedViewRotation);
|
||||||
|
WriteValue<uint32_t>(gLastEntranceStyle);
|
||||||
|
EndChunk();
|
||||||
|
}
|
||||||
|
|
||||||
void ParkFile::WriteTilesChunk()
|
void ParkFile::WriteTilesChunk()
|
||||||
{
|
{
|
||||||
BeginChunk(ParkFileChunkType::TILES);
|
BeginChunk(ParkFileChunkType::TILES);
|
||||||
|
@ -299,6 +311,7 @@ void ParkFile::Import()
|
||||||
{
|
{
|
||||||
ReadTilesChunk();
|
ReadTilesChunk();
|
||||||
ReadGeneralChunk();
|
ReadGeneralChunk();
|
||||||
|
ReadInterfaceChunk();
|
||||||
}
|
}
|
||||||
|
|
||||||
ParkFile::Header ParkFile::ReadHeader(std::istream& fs)
|
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()
|
void ParkFile::ReadTilesChunk()
|
||||||
{
|
{
|
||||||
if (SeekChunk(ParkFileChunkType::TILES))
|
if (SeekChunk(ParkFileChunkType::TILES))
|
||||||
|
|
|
@ -68,9 +68,11 @@ namespace OpenRCT2
|
||||||
void WriteAuthoringChunk();
|
void WriteAuthoringChunk();
|
||||||
void WriteObjectsChunk();
|
void WriteObjectsChunk();
|
||||||
void WriteGeneralChunk();
|
void WriteGeneralChunk();
|
||||||
|
void WriteInterfaceChunk();
|
||||||
void WriteTilesChunk();
|
void WriteTilesChunk();
|
||||||
|
|
||||||
void ReadGeneralChunk();
|
void ReadGeneralChunk();
|
||||||
|
void ReadInterfaceChunk();
|
||||||
void ReadTilesChunk();
|
void ReadTilesChunk();
|
||||||
|
|
||||||
Header ReadHeader(std::istream& fs);
|
Header ReadHeader(std::istream& fs);
|
||||||
|
|
Loading…
Reference in New Issue