Skip to content

Commit

Permalink
Merge pull request #16412
Browse files Browse the repository at this point in the history
  • Loading branch information
Broxzier committed Jan 10, 2022
2 parents 4a36520 + 4494eb3 commit 1085a30
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/openrct2-ui/title/TitleSequencePlayer.cpp
Expand Up @@ -465,6 +465,7 @@ class TitleSequencePlayer final : public ITitleSequencePlayer
News::InitQueue();
load_palette();
gScreenAge = 0;
gGamePaused = false;
gGameSpeed = 1;
}

Expand Down
17 changes: 13 additions & 4 deletions src/openrct2/ParkImporter.cpp
Expand Up @@ -23,24 +23,33 @@ namespace ParkImporter
{
std::unique_ptr<IParkImporter> parkImporter;
std::string extension = Path::GetExtension(hintPath);
if (ExtensionIsRCT1(extension))
auto* context = OpenRCT2::GetContext();
if (ExtensionIsOpenRCT2ParkFile(extension))
{
parkImporter = CreateParkFile(context->GetObjectRepository());
}
else if (ExtensionIsRCT1(extension))
{
parkImporter = CreateS4();
}
else
{
auto context = OpenRCT2::GetContext();
parkImporter = CreateS6(context->GetObjectRepository());
}
return parkImporter;
}

bool ExtensionIsRCT1(const std::string& extension)
bool ExtensionIsOpenRCT2ParkFile(std::string_view extension)
{
return String::Equals(extension, ".park", true);
}

bool ExtensionIsRCT1(std::string_view extension)
{
return String::Equals(extension, ".sc4", true) || String::Equals(extension, ".sv4", true);
}

bool ExtensionIsScenario(const std::string& extension)
bool ExtensionIsScenario(std::string_view extension)
{
return String::Equals(extension, ".sc4", true) || String::Equals(extension, ".sc6", true)
|| String::Equals(extension, ".sea", true);
Expand Down
5 changes: 3 additions & 2 deletions src/openrct2/ParkImporter.h
Expand Up @@ -64,8 +64,9 @@ namespace ParkImporter
[[nodiscard]] std::unique_ptr<IParkImporter> CreateS6(IObjectRepository& objectRepository);
[[nodiscard]] std::unique_ptr<IParkImporter> CreateParkFile(IObjectRepository& objectRepository);

bool ExtensionIsRCT1(const std::string& extension);
bool ExtensionIsScenario(const std::string& extension);
bool ExtensionIsOpenRCT2ParkFile(std::string_view extension);
bool ExtensionIsRCT1(std::string_view extension);
bool ExtensionIsScenario(std::string_view extension);
} // namespace ParkImporter

class ObjectLoadException : public std::exception
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/title/TitleSequence.cpp
Expand Up @@ -309,7 +309,7 @@ static std::vector<std::string> GetSaves(IZipArchive* zip)
{
auto name = zip->GetFileName(i);
auto ext = Path::GetExtension(name);
if (String::Equals(ext, ".sv6", true) || String::Equals(ext, ".sc6", true))
if (String::Equals(ext, ".sv6", true) || String::Equals(ext, ".sc6", true) || String::Equals(ext, ".park", true))
{
saves.push_back(std::move(name));
}
Expand Down

0 comments on commit 1085a30

Please sign in to comment.