2017-03-24 18:29:45 +01:00
|
|
|
/*****************************************************************************
|
2024-01-01 12:52:28 +01:00
|
|
|
* Copyright (c) 2014-2024 OpenRCT2 developers
|
2018-06-15 14:07:34 +02:00
|
|
|
*
|
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
|
|
|
*
|
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
|
|
|
*****************************************************************************/
|
2017-03-24 18:29:45 +01:00
|
|
|
|
|
|
|
#include <openrct2/Context.h>
|
2017-06-04 00:10:20 +02:00
|
|
|
#include <openrct2/OpenRCT2.h>
|
2023-02-23 00:03:30 +01:00
|
|
|
#include <openrct2/command_line/CommandLine.hpp>
|
2022-02-18 21:57:00 +01:00
|
|
|
#include <openrct2/platform/Platform.h>
|
2017-06-25 19:49:04 +02:00
|
|
|
|
2017-03-24 18:29:45 +01:00
|
|
|
using namespace OpenRCT2;
|
|
|
|
|
|
|
|
/**
|
2021-01-10 19:23:35 +01:00
|
|
|
* Main entry point for non-Windows systems. Windows instead uses its own DLL proxy.
|
2018-06-22 23:25:16 +02:00
|
|
|
*/
|
|
|
|
int main(int argc, const char** argv)
|
2017-03-24 18:29:45 +01:00
|
|
|
{
|
2019-10-05 21:26:55 +02:00
|
|
|
int32_t rc = EXIT_SUCCESS;
|
2023-02-23 00:03:30 +01:00
|
|
|
int runGame = CommandLineRun(argv, argc);
|
2020-01-19 22:48:50 +01:00
|
|
|
if (runGame == EXITCODE_CONTINUE)
|
2017-06-04 00:10:20 +02:00
|
|
|
{
|
|
|
|
gOpenRCT2Headless = true;
|
2017-06-08 00:17:19 +02:00
|
|
|
gOpenRCT2NoGraphics = true;
|
2017-06-04 00:10:20 +02:00
|
|
|
|
|
|
|
// Run OpenRCT2 with a plain context
|
|
|
|
auto context = CreateContext();
|
2019-10-05 21:26:55 +02:00
|
|
|
rc = context->RunOpenRCT2(argc, argv);
|
2017-06-04 00:10:20 +02:00
|
|
|
}
|
2020-01-19 22:48:50 +01:00
|
|
|
else if (runGame == EXITCODE_FAIL)
|
2019-10-05 21:26:55 +02:00
|
|
|
{
|
|
|
|
rc = EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
return rc;
|
2017-03-24 18:29:45 +01:00
|
|
|
}
|