From 1f15bc5b0d18a10624d928f438edee9e0d4dc1be Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 1 Oct 2019 01:02:49 +0200 Subject: [PATCH] - moced I_DetectOS call into D_DoomMain This requires the console and was the reason for this strange setup. # Conflicts: # src/posix/cocoa/i_main.mm --- src/d_main.cpp | 1 + src/posix/cocoa/i_main.mm | 3 +-- src/posix/sdl/i_main.cpp | 5 +++++ src/win32/i_main.cpp | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index c6ef4727d..bbc5e8c86 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2334,6 +2334,7 @@ void D_DoomMain (void) const char *batchout = Args->CheckValue("-errorlog"); C_InitConsole(80*8, 25*8, false); + I_DetectOS(); // +logfile gets checked too late to catch the full startup log in the logfile so do some extra check for it here. FString logfile = Args->TakeValue("+logfile"); diff --git a/src/posix/cocoa/i_main.mm b/src/posix/cocoa/i_main.mm index 87d16095a..bf5c2ea75 100644 --- a/src/posix/cocoa/i_main.mm +++ b/src/posix/cocoa/i_main.mm @@ -76,7 +76,7 @@ void Mac_I_FatalError(const char* const message) } -static void I_DetectOS() +void I_DetectOS() { SInt32 majorVersion = 0; Gestalt(gestaltSystemVersionMajor, &majorVersion); @@ -158,7 +158,6 @@ void OriginalMainTry(int argc, char** argv) progdir = [[exePath stringByDeletingLastPathComponent] UTF8String]; progdir += "/"; - I_DetectOS(); D_DoomMain(); } diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index e48786097..93ef90752 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -150,6 +150,11 @@ static int DoomSpecificInfo (char *buffer, char *end) return p; } +void I_DetectOS() +{ + // The POSIX version never implemented this. +} + void I_StartupJoysticks(); void I_ShutdownJoysticks(); diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 619e73888..afd278139 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -999,7 +999,6 @@ void DoMain (HINSTANCE hInstance) CoInitialize (NULL); atexit (UnCOM); - I_DetectOS (); D_DoomMain (); } catch (class CNoRunExit &)