From 28604bad62ab89b50d791f6bf2af424f4aee02d6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Dec 2016 14:06:51 +0100 Subject: [PATCH 1/3] - fixed: The polyobject init specials must be cleared after Polyobject initialization is done, because they can block usage of regular lines colinear with the polyobject --- src/po_man.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/po_man.cpp b/src/po_man.cpp index c779a8049d..05d067e527 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -1773,7 +1773,14 @@ void PO_Init (void) } } } - + // clear all polyobj specials so that they do not obstruct using other lines. + for (int i = 0; i < numlines; i++) + { + if (lines[i].special == Polyobj_ExplicitLine || lines[i].special == Polyobj_StartLine) + { + lines[i].special = 0; + } + } } //========================================================================== From 5117b32431f946ea3ce08277dcf80c0a1fe2ad2c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Dec 2016 14:42:06 +0100 Subject: [PATCH 2/3] - fixed: The math for emulating the old slop overflow was not correct and made the affected sectors in void.wad display incorrectly. - set compat_polyobj for void.wad because its polyobjects glitch quite a bit with the normal setting. --- src/p_slopes.cpp | 4 ++-- wadsrc/static/compatibility.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_slopes.cpp b/src/p_slopes.cpp index 66b3d07476..7413922e25 100644 --- a/src/p_slopes.cpp +++ b/src/p_slopes.cpp @@ -178,8 +178,8 @@ void P_SetSlope (secplane_t *plane, bool setCeil, int xyangi, int zangi, const D if (ib_compatflags & BCOMPATF_SETSLOPEOVERFLOW) { // We have to consider an integer multiplication overflow here. - norm[0] = FixedToFloat(FloatToFixed(zang.Cos()) * FloatToFixed(xyang.Cos())); - norm[1] = FixedToFloat(FloatToFixed(zang.Cos()) * FloatToFixed(xyang.Sin())); + norm[0] = FixedToFloat(FloatToFixed(zang.Cos()) * FloatToFixed(xyang.Cos())) / 65536.; + norm[1] = FixedToFloat(FloatToFixed(zang.Cos()) * FloatToFixed(xyang.Sin())) / 65536.; } else { diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index d964cbf75f..73a4f5af2f 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -27,6 +27,7 @@ setwallyscale 717 front bot 1.090909 setslopeoverflow + polyobj } B2D8DA03489D1C67F60DC87FBC4EA338 // map01 - Massmouth 2 From 30cbce051e08a7ff6b8f7161cee44159e24ad90e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Dec 2016 15:44:46 +0100 Subject: [PATCH 3/3] - fixed: Custom automap colors were not invalidated on restart. - fixed: D_DoomMain has 3 calls to D_DoomLoop but only the main call of these was capable of a clean restart. --- src/am_map.cpp | 5 ++++ src/am_map.h | 1 + src/d_main.cpp | 69 +++++++++++++++++++++++++++----------------------- 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/src/am_map.cpp b/src/am_map.cpp index d74927b684..70153404a7 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -473,6 +473,11 @@ static AMColorset AMMod; static AMColorset AMModOverlay; +void AM_ClearColorsets() +{ + AMModOverlay.defined = false; + AMMod.defined = false; +} //============================================================================= // // diff --git a/src/am_map.h b/src/am_map.h index dadacde553..fd9079c1e3 100644 --- a/src/am_map.h +++ b/src/am_map.h @@ -27,6 +27,7 @@ class FSerializer; void AM_StaticInit(); +void AM_ClearColorsets(); // reset data for a restart. // Called by main loop. bool AM_Responder (event_t* ev, bool last); diff --git a/src/d_main.cpp b/src/d_main.cpp index dad2b86d95..1f9fcdbcab 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2592,44 +2592,48 @@ void D_DoomMain (void) G_DeferedPlayDemo (v); D_DoomLoop (); // never returns } - - v = Args->CheckValue ("-timedemo"); - if (v) + else { - G_TimeDemo (v); - D_DoomLoop (); // never returns - } - - if (gameaction != ga_loadgame && gameaction != ga_loadgamehidecon) - { - if (autostart || netgame) + v = Args->CheckValue("-timedemo"); + if (v) { - // Do not do any screenwipes when autostarting a game. - if (!Args->CheckParm("-warpwipe")) - { - NoWipe = TICRATE; - } - CheckWarpTransMap (startmap, true); - if (demorecording) - G_BeginRecording (startmap); - G_InitNew (startmap, false); - if (StoredWarp.IsNotEmpty()) - { - AddCommandString(StoredWarp.LockBuffer()); - StoredWarp = NULL; - } + G_TimeDemo(v); + D_DoomLoop(); // never returns } else { - D_StartTitle (); // start up intro loop + if (gameaction != ga_loadgame && gameaction != ga_loadgamehidecon) + { + if (autostart || netgame) + { + // Do not do any screenwipes when autostarting a game. + if (!Args->CheckParm("-warpwipe")) + { + NoWipe = TICRATE; + } + CheckWarpTransMap(startmap, true); + if (demorecording) + G_BeginRecording(startmap); + G_InitNew(startmap, false); + if (StoredWarp.IsNotEmpty()) + { + AddCommandString(StoredWarp.LockBuffer()); + StoredWarp = NULL; + } + } + else + { + D_StartTitle(); // start up intro loop + } + } + else if (demorecording) + { + G_BeginRecording(NULL); + } + + atterm(D_QuitNetGame); // killough } } - else if (demorecording) - { - G_BeginRecording (NULL); - } - - atterm (D_QuitNetGame); // killough } else { @@ -2643,7 +2647,7 @@ void D_DoomMain (void) } D_DoomLoop (); // this only returns if a 'restart' CCMD is given. - +maxberestart: // // Clean up after a restart // @@ -2654,6 +2658,7 @@ void D_DoomMain (void) M_ClearMenus(); // close menu if open F_EndFinale(); // If an intermission is active, end it now + AM_ClearColorsets(); // clean up game state ST_Clear();