Add option in the configfile for skipping the intro

Now it's possible to either provide the --skip-intro command line argument or have skip_intro set to 1 on the config file.
This commit is contained in:
IvanDSM 2020-05-11 05:13:51 -03:00
parent 61e7e8d032
commit ed524acd12
2 changed files with 5 additions and 2 deletions

View File

@ -174,7 +174,8 @@ s8 D_8032C9E0 = 0;
u8 unused3[4];
u8 unused4[2];
// For configfile intro skipping
extern unsigned int configSkipIntro;
void basic_update(s16 *arg);
@ -1199,7 +1200,7 @@ s32 init_level(void) {
if (gMarioState->action != ACT_UNINITIALIZED) {
if (save_file_exists(gCurrSaveFileNum - 1)) {
set_mario_action(gMarioState, ACT_IDLE, 0);
} else if (gCLIOpts.SkipIntro == 0) {
} else if (gCLIOpts.SkipIntro == 0 && configSkipIntro == 0) {
set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0);
val4 = 1;
}

View File

@ -69,6 +69,7 @@ bool configCameraInvertY = false;
bool configEnableCamera = false;
bool configCameraMouse = false;
#endif
unsigned int configSkipIntro = 0;
static const struct ConfigOption options[] = {
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configFullscreen},
@ -107,6 +108,7 @@ static const struct ConfigOption options[] = {
{.name = "bettercam_aggression", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraAggr},
{.name = "bettercam_pan_level", .type = CONFIG_TYPE_UINT, .uintValue = &configCameraPan},
#endif
{.name = "skip_intro", .type = CONFIG_TYPE_UINT, .uintValue = &configSkipIntro},
};
// Reads an entire line from a file (excluding the newline character) and returns an allocated string