1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

ensure only g1.dat exists, also allow title screen scenario to not exist

This commit is contained in:
IntelOrca
2015-02-06 23:15:11 +00:00
parent ce719ef086
commit 55dcef13ad
2 changed files with 16 additions and 22 deletions

View File

@@ -252,24 +252,7 @@ int check_file_path(int pathId)
HANDLE file = CreateFile(path, FILE_GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL);
switch (pathId) {
case PATH_ID_GAMECFG:
case PATH_ID_SCORES:
case PATH_ID_TRACKSIDX:
case PATH_ID_PLUGIN:
// Do nothing; these will be created later if they do not exist yet
break;
case PATH_ID_CUSTOM1:
if (file != INVALID_HANDLE_VALUE)
RCT2_GLOBAL(0x009AF164, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom1_size @ 0x009AF164
break;
case PATH_ID_CUSTOM2:
if (file != INVALID_HANDLE_VALUE)
RCT2_GLOBAL(0x009AF16E, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom2_size @ 0x009AF16E
break;
default:
case PATH_ID_G1:
if (file == INVALID_HANDLE_VALUE) {
// A data file is missing from the installation directory. The original implementation
// asks for a CD-ROM path at this point and stores it in cdrom_path @ 0x9AA318.
@@ -282,6 +265,16 @@ int check_file_path(int pathId)
return 0;
}
break;
case PATH_ID_CUSTOM1:
if (file != INVALID_HANDLE_VALUE)
RCT2_GLOBAL(0x009AF164, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom1_size @ 0x009AF164
break;
case PATH_ID_CUSTOM2:
if (file != INVALID_HANDLE_VALUE)
RCT2_GLOBAL(0x009AF16E, unsigned int) = SetFilePointer(file, 0, 0, FILE_END); // Store file size in music_custom2_size @ 0x009AF16E
break;
}
if (file != INVALID_HANDLE_VALUE)

View File

@@ -171,11 +171,12 @@ static void title_update_showcase()
_scriptWaitCounter = (*_currentScript++) * 32;
break;
case TITLE_SCRIPT_LOAD:
if (!scenario_load(get_file_path(PATH_ID_SIXFLAGS_MAGICMOUNTAIN))) {
log_fatal("OpenRCT2 can not currently cope when unable to load title screen scenario.");
exit(-1);
if (scenario_load(get_file_path(PATH_ID_SIXFLAGS_MAGICMOUNTAIN))) {
log_verbose("loaded title scenario");
} else {
RCT2_CALLPROC_EBPSAFE(0x006837E3);
title_create_windows();
}
log_verbose("loaded title scenario");
w = window_get_main();
w->viewport_target_sprite = -1;