fixed gExitCode

This commit is contained in:
Lomash Gupta authored and Tulio Leao committed 2020-01-19 18:35:24 -03:00
1 parent d798811c4a
commit 36840f3fe0
5 files changed
+13 -13

No files matched your search

+4 -2
View File
@@ -27,7 +27,9 @@ int main(int argc, const char** argv)
// Run OpenRCT2 with a plain context
auto context = CreateContext();
context->RunOpenRCT2(argc, argv);
if((context->RunOpenRCT2(argc, argv)) == EXIT_SUCCESS) {
return EXIT_SUCCESS;
}
}
return gExitCode;
return EXIT_FAILURE;
}
+7 -6
View File
@@ -38,6 +38,7 @@ int NormalisedMain(int argc, const char** argv)
int main(int argc, const char** argv)
#endif
{
std::unique_ptr<IContext> context;
int runGame = cmdline_run(argv, argc);
core_init();
RegisterBitmapReader();
@@ -46,8 +47,7 @@ int main(int argc, const char** argv)
if (gOpenRCT2Headless)
{
// Run OpenRCT2 with a plain context
auto context = CreateContext();
context->RunOpenRCT2(argc, argv);
context = CreateContext();
}
else
{
@@ -55,12 +55,13 @@ int main(int argc, const char** argv)
auto env = to_shared(CreatePlatformEnvironment());
auto audioContext = to_shared(CreateAudioContext());
auto uiContext = to_shared(CreateUiContext(env));
auto context = CreateContext(env, audioContext, uiContext);
context->RunOpenRCT2(argc, argv);
context = CreateContext(env, audioContext, uiContext);
}
if (context->RunOpenRCT2(argc, argv) == EXIT_SUCCESS) {
return EXIT_SUCCESS;
}
}
return gExitCode;
return EXIT_FAILURE;
}
#ifdef __ANDROID__
+2 -1
View File
@@ -243,8 +243,9 @@ namespace OpenRCT2
if (Initialise())
{
Launch();
return EXIT_SUCCESS;
}
return gExitCode;
return EXIT_FAILURE;
}
void WriteLine(const std::string& s) override
-1
View File
@@ -9,7 +9,6 @@
#include "OpenRCT2.h"
int32_t gExitCode;
int32_t gOpenRCT2StartupAction = STARTUP_ACTION_TITLE;
utf8 gOpenRCT2StartupActionPath[512] = { 0 };
utf8 gExePath[MAX_PATH];
-3
View File
@@ -34,9 +34,6 @@ enum
SCREEN_FLAGS_EDITOR = (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER),
};
/** The exit code for OpenRCT2 when it exits. */
extern int32_t gExitCode;
extern int32_t gOpenRCT2StartupAction;
extern utf8 gOpenRCT2StartupActionPath[512];
extern utf8 gExePath[MAX_PATH];