From 745b147d185f38d710649c61aceac68a93fbbc3e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 15 Apr 2014 16:40:53 +0200 Subject: [PATCH 1/6] - fixed typo in xlat files (they don't use exactly C syntax.) --- wadsrc/static/xlat/defines.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/xlat/defines.i b/wadsrc/static/xlat/defines.i index 0acc2465e..04c8b21cc 100644 --- a/wadsrc/static/xlat/defines.i +++ b/wadsrc/static/xlat/defines.i @@ -240,5 +240,5 @@ enum // ML_PASSTHROUGH = -1, ML_TRANSLUCENT = -2, - ML_TRANSPARENT = -3, + ML_TRANSPARENT = -3 } \ No newline at end of file From e5578934ad711fa2e38369f1bbe9e1eb36fc191e Mon Sep 17 00:00:00 2001 From: Gaerzi Date: Tue, 15 Apr 2014 17:16:33 +0200 Subject: [PATCH 2/6] Init new non-0 fields for non-UDMF maps. --- src/p_mobj.cpp | 3 --- src/p_setup.cpp | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 291f51a94..2a26d7ef0 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4795,10 +4795,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) // Set various UDMF options if (mthing->alpha != -1) - { - DPrintf("Setting alpha to %f", FIXED2FLOAT(mthing->alpha)); mobj->alpha = mthing->alpha; - } if (mthing->RenderStyle != STYLE_Count) mobj->RenderStyle = (ERenderStyle)mthing->RenderStyle; if (mthing->scaleX) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 315da4ffc..b2d007f97 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1764,6 +1764,9 @@ void P_LoadThings (MapData * map) mti[i].Conversation = 0; mti[i].SkillFilter = MakeSkill(flags); mti[i].ClassFilter = 0xffff; // Doom map format doesn't have class flags so spawn for all player classes + mti[i].RenderStyle = STYLE_Count; + mti[i].alpha = -1; + mti[i].health = 1; flags &= ~MTF_SKILLMASK; mti[i].flags = (short)((flags & 0xf) | 0x7e0); if (gameinfo.gametype == GAME_Strife) From 8e3360453fa5d90cbfda05e28817060d8f98dde3 Mon Sep 17 00:00:00 2001 From: Gaerzi Date: Tue, 15 Apr 2014 17:18:55 +0200 Subject: [PATCH 3/6] Hexen too. --- src/p_setup.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index b2d007f97..f56d761f2 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1840,6 +1840,9 @@ void P_LoadThings2 (MapData * map) mti[i].flags &= ~(MTF_SKILLMASK|MTF_CLASS_MASK); mti[i].Conversation = 0; mti[i].gravity = FRACUNIT; + mti[i].RenderStyle = STYLE_Count; + mti[i].alpha = -1; + mti[i].health = 1; } delete[] mtp; } From 6f2fd8edbfec14a62a6a96ddf3b1050ab3ad9bcb Mon Sep 17 00:00:00 2001 From: Gaerzi Date: Tue, 15 Apr 2014 17:22:56 +0200 Subject: [PATCH 4/6] Hexen also needs to init 0 fields. --- src/p_setup.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index f56d761f2..c14fcdec0 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1843,6 +1843,7 @@ void P_LoadThings2 (MapData * map) mti[i].RenderStyle = STYLE_Count; mti[i].alpha = -1; mti[i].health = 1; + mti[i].fillcolor = 0 = mti[i].scaleX = mti[i].scaleY = mti[i].score = 0; } delete[] mtp; } From c54f5571ea174c19022354eb35dd3704d08f5ac8 Mon Sep 17 00:00:00 2001 From: Gaerzi Date: Tue, 15 Apr 2014 17:24:01 +0200 Subject: [PATCH 5/6] Typo. --- src/p_setup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index c14fcdec0..77b9b077b 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1843,7 +1843,7 @@ void P_LoadThings2 (MapData * map) mti[i].RenderStyle = STYLE_Count; mti[i].alpha = -1; mti[i].health = 1; - mti[i].fillcolor = 0 = mti[i].scaleX = mti[i].scaleY = mti[i].score = 0; + mti[i].fillcolor = mti[i].scaleX = mti[i].scaleY = mti[i].score = 0; } delete[] mtp; } From 48b926e5b47cf2380db412b6c08e8c7aeec1138a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 16 Apr 2014 09:53:07 +0200 Subject: [PATCH 6/6] - check +logfile explicitly at the start of execution. Due to the custom CVAR rewrite it would get called so late that it'd miss half of the log. - added version check for Windows 8. I also would have liked to add 8.1 but due to some incredibly stupid changes in the version API it's no longer possible to reliably retrieve the correct Windows version for later builds. --- src/c_cmds.cpp | 26 ++++++++++++++++---------- src/c_dispatch.h | 2 ++ src/d_main.cpp | 7 +++++++ src/win32/i_system.cpp | 12 ++++++++++++ 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index cdf615ef4..0e7adb8ef 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -441,27 +441,33 @@ CCMD (exec) } } +void execLogfile(const char *fn) +{ + if ((Logfile = fopen(fn, "w"))) + { + const char *timestr = myasctime(); + Printf("Log started: %s\n", timestr); + } + else + { + Printf("Could not start log\n"); + } +} + CCMD (logfile) { - const char *timestr = myasctime (); if (Logfile) { - Printf ("Log stopped: %s\n", timestr); + const char *timestr = myasctime(); + Printf("Log stopped: %s\n", timestr); fclose (Logfile); Logfile = NULL; } if (argv.argc() >= 2) { - if ( (Logfile = fopen (argv[1], "w")) ) - { - Printf ("Log started: %s\n", timestr); - } - else - { - Printf ("Could not start log\n"); - } + execLogfile(argv[1]); } } diff --git a/src/c_dispatch.h b/src/c_dispatch.h index 96dc50644..f4518608d 100644 --- a/src/c_dispatch.h +++ b/src/c_dispatch.h @@ -168,4 +168,6 @@ extern unsigned int MakeKey (const char *s); extern unsigned int MakeKey (const char *s, size_t len); extern unsigned int SuperFastHash (const char *data, size_t len); +void execLogfile(const char *fn); + #endif //__C_DISPATCH_H__ diff --git a/src/d_main.cpp b/src/d_main.cpp index 6c938ef53..695e7e517 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2223,6 +2223,13 @@ void D_DoomMain (void) FString *args; int argcount; + // +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"); + if (logfile != NULL) + { + execLogfile(logfile); + } + D_DoomInit(); PClass::StaticInit (); atterm(FinalGC); diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index a82cb65f9..4690c253d 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -581,6 +581,18 @@ void I_DetectOS(void) osname = "Server 2008 R2"; } } + else if (info.dwMinorVersion == 2) + { + // Microsoft broke this API for 8.1 so without jumping through hoops it won't be possible anymore to detect never versions aside from the build number, especially for older compilers. + if (info.wProductType == VER_NT_WORKSTATION) + { + osname = "8 (or higher)"; + } + else + { + osname = "Server 2012 (or higher)"; + } + } } break;