1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 07:44:38 +01:00

Use scenario repository to load SFMM in title sequence

This commit is contained in:
Ted John
2017-01-22 21:57:14 +00:00
parent efb64603eb
commit d5f2ea814a
2 changed files with 13 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ extern "C"
IObjectRepository * objRepo = CreateObjectRepository(OpenRCT2::_env);
ITrackDesignRepository * tdRepo = CreateTrackDesignRepository(OpenRCT2::_env);
CreateScenarioRepository(OpenRCT2::_env);
IScenarioRepository * scenarioRepo = CreateScenarioRepository(OpenRCT2::_env);
if (!language_open(gConfigGeneral.language))
{
@@ -174,6 +174,7 @@ extern "C"
// as its not required until the player wants to place a new ride.
tdRepo->Scan();
scenarioRepo->Scan();
TitleSequenceManager::Scan();
if (!gOpenRCT2Headless)

View File

@@ -39,6 +39,8 @@ extern "C"
class TitleSequencePlayer final : public ITitleSequencePlayer
{
private:
static constexpr const char * SFMM_FILENAME = "Six Flags Magic Mountain.SC6";
uint32 _sequenceId = 0;
TitleSequence * _sequence = nullptr;
sint32 _position = 0;
@@ -231,7 +233,15 @@ private:
break;
case TITLE_SCRIPT_LOADMM:
{
const utf8 * path = get_file_path(PATH_ID_SIXFLAGS_MAGICMOUNTAIN);
IScenarioRepository * scenarioRepo = GetScenarioRepository();
const scenario_index_entry * entry = scenarioRepo->GetByFilename(SFMM_FILENAME);
if (entry == nullptr)
{
Console::Error::WriteLine("%s not found.", SFMM_FILENAME);
return false;
}
const utf8 * path = entry->path;
if (!LoadParkFromFile(path))
{
Console::Error::WriteLine("Failed to load: \"%s\" for the title sequence.", path);