mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add Importing of RCTC scenarios (#4905)
This commit is contained in:
parent
f6cb95e534
commit
a345560509
|
@ -92,6 +92,7 @@ void S6Exporter::SaveScenario(SDL_RWops *rw)
|
|||
void S6Exporter::Save(SDL_RWops * rw, bool isScenario)
|
||||
{
|
||||
_s6.header.type = isScenario ? S6_TYPE_SCENARIO : S6_TYPE_SAVEDGAME;
|
||||
_s6.header.classic_flag = 0;
|
||||
_s6.header.num_packed_objects = uint16(ExportObjectsList.size());
|
||||
_s6.header.version = S6_RCT2_VERSION;
|
||||
_s6.header.magic_number = S6_MAGIC_NUMBER;
|
||||
|
|
|
@ -112,6 +112,7 @@ void S6Importer::LoadSavedGame(SDL_RWops *rw)
|
|||
{
|
||||
throw Exception("Data is not a saved game.");
|
||||
}
|
||||
log_verbose("saved game classic_flag = 0x%02x\n", _s6.header.classic_flag);
|
||||
|
||||
// Read packed objects
|
||||
// TODO try to contain this more and not store objects until later
|
||||
|
@ -133,6 +134,7 @@ void S6Importer::LoadScenario(SDL_RWops *rw)
|
|||
{
|
||||
throw Exception("Data is not a scenario.");
|
||||
}
|
||||
log_verbose("scenario classic_flag = 0x%02x\n", _s6.header.classic_flag);
|
||||
|
||||
sawyercoding_read_chunk_safe(rw, &_s6.info, sizeof(_s6.info));
|
||||
|
||||
|
|
|
@ -38,7 +38,8 @@
|
|||
* size: 0x20
|
||||
*/
|
||||
typedef struct rct_s6_header {
|
||||
uint16 type; // 0x00
|
||||
uint8 type; // 0x00
|
||||
uint8 classic_flag; // 0x01
|
||||
uint16 num_packed_objects; // 0x02
|
||||
uint32 version; // 0x04
|
||||
uint32 magic_number; // 0x08
|
||||
|
|
Loading…
Reference in New Issue