Replace load_from_sv4() and load_from_sc4()

This commit is contained in:
Gymnasiast 2022-10-08 19:29:37 +02:00
parent 830fedb6b8
commit a3800320bc
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
3 changed files with 2 additions and 23 deletions

View File

@ -248,7 +248,7 @@ namespace Editor
*/
static bool LoadLandscapeFromSV4(const char* path)
{
load_from_sv4(path);
GetContext()->LoadParkFromFile(path);
ClearMapForEditing(true);
gEditorStep = EditorStep::LandscapeEditor;
@ -262,7 +262,7 @@ namespace Editor
static bool LoadLandscapeFromSC4(const char* path)
{
load_from_sc4(path);
GetContext()->LoadParkFromFile(path);
ClearMapForEditing(false);
gEditorStep = EditorStep::LandscapeEditor;

View File

@ -1279,6 +1279,3 @@ namespace RCT1
track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, ride_type_t rideType);
} // namespace RCT1
void load_from_sv4(const char* path);
void load_from_sc4(const char* path);

View File

@ -3082,21 +3082,3 @@ std::unique_ptr<IParkImporter> ParkImporter::CreateS4()
{
return std::make_unique<RCT1::S4Importer>();
}
void load_from_sv4(const utf8* path)
{
auto& objectMgr = GetContext()->GetObjectManager();
auto s4Importer = std::make_unique<RCT1::S4Importer>();
auto result = s4Importer->LoadSavedGame(path);
objectMgr.LoadObjects(result.RequiredObjects);
s4Importer->Import();
}
void load_from_sc4(const utf8* path)
{
auto& objectMgr = GetContext()->GetObjectManager();
auto s4Importer = std::make_unique<RCT1::S4Importer>();
auto result = s4Importer->LoadScenario(path);
objectMgr.LoadObjects(result.RequiredObjects);
s4Importer->Import();
}