From d535e290d31d6229c51c7c27766f2bb87b93e149 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 9 Jan 2017 22:28:28 +0000 Subject: [PATCH] Remove --console CLI switch --- src/openrct2/cmdline/RootCommands.cpp | 18 ------------------ src/openrct2/platform/platform.h | 2 -- src/openrct2/platform/shared.c | 4 ---- src/openrct2/platform/windows.c | 23 ----------------------- 4 files changed, 47 deletions(-) diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index fefd5c8869..0fe7173b17 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -39,10 +39,6 @@ extern "C" #define IMPLIES_SILENT_BREAKPAD #endif // USE_BREAKPAD -#if defined(__WINDOWS__) && !defined(DEBUG) - #define __PROVIDE_CONSOLE__ 1 -#endif // defined(__WINDOWS__) && !defined(DEBUG) - #ifndef DISABLE_NETWORK int gNetworkStart = NETWORK_MODE_NONE; char gNetworkStartHost[128]; @@ -51,10 +47,6 @@ int gNetworkStartPort = NETWORK_DEFAULT_PORT; static uint32 _port = 0; #endif -#ifdef __PROVIDE_CONSOLE__ - static bool _provideConsole; -#endif - static bool _help = false; static bool _version = false; static bool _noInstall = false; @@ -77,9 +69,6 @@ static const CommandLineOptionDefinition StandardOptions[] { CMDLINE_TYPE_SWITCH, &_about, NAC, "about", "show information about " OPENRCT2_NAME }, { CMDLINE_TYPE_SWITCH, &_verbose, NAC, "verbose", "log verbose messages" }, { CMDLINE_TYPE_SWITCH, &_headless, NAC, "headless", "run " OPENRCT2_NAME " headless" IMPLIES_SILENT_BREAKPAD }, -#ifdef __PROVIDE_CONSOLE__ - { CMDLINE_TYPE_SWITCH, &_provideConsole, NAC, "console", "creates a new or attaches to an existing console window for standard output" }, -#endif #ifndef DISABLE_NETWORK { CMDLINE_TYPE_INTEGER, &_port, NAC, "port", "port to use for hosting or joining a server" }, #endif @@ -166,13 +155,6 @@ exitcode_t CommandLine::HandleCommandDefault() { exitcode_t result = EXITCODE_CONTINUE; -#ifdef __PROVIDE_CONSOLE__ - if (_provideConsole) - { - platform_windows_open_console(); - } -#endif - if (_about) { PrintAbout(); diff --git a/src/openrct2/platform/platform.h b/src/openrct2/platform/platform.h index 27cc648cfb..32652a44fb 100644 --- a/src/openrct2/platform/platform.h +++ b/src/openrct2/platform/platform.h @@ -220,8 +220,6 @@ void core_init(); #include #undef GetMessage - void platform_windows_open_console(); - void platform_windows_close_console(); int windows_get_registry_install_info(rct2_install_info *installInfo, char *source, char *font, uint8 charset); HWND windows_get_window_handle(); void platform_setup_file_associations(); diff --git a/src/openrct2/platform/shared.c b/src/openrct2/platform/shared.c index 6ee2e3ac89..d4673430ab 100644 --- a/src/openrct2/platform/shared.c +++ b/src/openrct2/platform/shared.c @@ -643,10 +643,6 @@ void platform_free() platform_close_window(); SDL_Quit(); - -#ifdef __WINDOWS__ - platform_windows_close_console(); -#endif } void platform_start_text_input(utf8* buffer, int max_length) diff --git a/src/openrct2/platform/windows.c b/src/openrct2/platform/windows.c index bf4a85b5bc..2cbcb1fbc8 100644 --- a/src/openrct2/platform/windows.c +++ b/src/openrct2/platform/windows.c @@ -47,7 +47,6 @@ static utf8 _userDataDirectoryPath[MAX_PATH] = { 0 }; static utf8 _openrctDataDirectoryPath[MAX_PATH] = { 0 }; -static bool _consoleIsAttached = false; utf8 **windows_get_command_line_args(int *outNumArgs); @@ -125,28 +124,6 @@ __declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInsta #endif // NO_RCT2 -void platform_windows_open_console() -{ - if (!AttachConsole(ATTACH_PARENT_PROCESS)) { - if (!AllocConsole()) { - return; - } - } - - freopen("CONIN$", "r", stdin); - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); - _consoleIsAttached = true; -} - -void platform_windows_close_console() -{ - if (_consoleIsAttached) { - _consoleIsAttached = false; - FreeConsole(); - } -} - utf8 **windows_get_command_line_args(int *outNumArgs) { int argc;