1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

fix edit command line function

This commit is contained in:
IntelOrca
2015-06-03 17:11:19 +01:00
parent f0c97c0fa8
commit 463131117c
3 changed files with 20 additions and 22 deletions

View File

@@ -118,7 +118,7 @@ static int cmdline_for_edit(const char **argv, int argc)
{
gOpenRCT2StartupAction = STARTUP_ACTION_EDIT;
if (argc >= 1)
strcpy(gOpenRCT2StartupActionPath, argv[1]);
strcpy(gOpenRCT2StartupActionPath, argv[0]);
return 0;
}

View File

@@ -164,29 +164,28 @@ bool openrct2_initialise()
void openrct2_launch()
{
if (openrct2_initialise()) {
switch (gOpenRCT2StartupAction) {
case STARTUP_ACTION_INTRO:
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8) = 8;
break;
case STARTUP_ACTION_TITLE:
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TITLE_DEMO;
break;
case STARTUP_ACTION_OPEN:
assert(gOpenRCT2StartupActionPath != NULL);
rct2_open_file(gOpenRCT2StartupActionPath);
switch (gOpenRCT2StartupAction) {
case STARTUP_ACTION_INTRO:
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8) = 8;
break;
case STARTUP_ACTION_TITLE:
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TITLE_DEMO;
break;
case STARTUP_ACTION_OPEN:
assert(gOpenRCT2StartupActionPath != NULL);
rct2_open_file(gOpenRCT2StartupActionPath);
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_PLAYING;
break;
case STARTUP_ACTION_EDIT:
if (strlen(gOpenRCT2StartupActionPath) == 0) {
editor_load();
} else {
editor_load_landscape(gOpenRCT2StartupActionPath);
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_PLAYING;
break;
case STARTUP_ACTION_EDIT:
if (strlen(gOpenRCT2StartupActionPath) == 0) {
editor_load();
} else {
editor_load_landscape(gOpenRCT2StartupActionPath);
}
break;
}
break;
}
openrct2_loop();
}
openrct2_dispose();

View File

@@ -124,7 +124,6 @@ int rct2_init()
title_load();
gfx_clear(RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo), 10);
RCT2_GLOBAL(RCT2_ADDRESS_RUN_INTRO_TICK_PART, uint8) = gConfigGeneral.play_intro ? 8 : 255;
}
log_verbose("initialising game finished");