From a3a350e6e8b8ff1d07453a0fce8904975da55ad5 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 7 Dec 2017 16:31:27 -0500 Subject: [PATCH 01/11] - fixed: make level.ShaderStartTime use the same values as what screen->FrameTime normally gets. --- 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 dfa7ecb26..ea8b69649 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3627,7 +3627,7 @@ void P_SetupLevel (const char *lumpname, int position) bool buildmap; const int *oldvertextable = NULL; - level.ShaderStartTime = I_msTime(); // indicate to the shader system that the level just started + level.ShaderStartTime = I_msTimeFS(); // indicate to the shader system that the level just started // This is motivated as follows: From 0bd9437a962e8608906ce66cd6819cc1a39b4608 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 9 Dec 2017 11:37:25 +0200 Subject: [PATCH 02/11] Fixed loading of external DeHackEd patches https://forum.zdoom.org/viewtopic.php?t=58685 --- src/d_dehacked.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index f68fd1d63..cd6525304 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2490,7 +2490,7 @@ bool D_LoadDehFile(const char *patchfile) { FileReader fr; - if (!fr.Open(patchfile)) + if (fr.Open(patchfile)) { PatchSize = fr.GetLength(); From 81769518c9825b4891b1d48f0e213432aedb050f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 9 Dec 2017 11:57:05 +0200 Subject: [PATCH 03/11] Fixed inconsistent angle of spawned leaves https://forum.zdoom.org/viewtopic.php?t=58664 --- wadsrc/static/zscript/hexen/hexenspecialdecs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/hexen/hexenspecialdecs.txt b/wadsrc/static/zscript/hexen/hexenspecialdecs.txt index 626e499aa..f300dc526 100644 --- a/wadsrc/static/zscript/hexen/hexenspecialdecs.txt +++ b/wadsrc/static/zscript/hexen/hexenspecialdecs.txt @@ -458,7 +458,7 @@ class LeafSpawner : Actor if (mo) { - mo.Thrust(random[LeafSpawn]() / 128. + 3); + mo.Thrust(random[LeafSpawn]() / 128. + 3, angle); mo.target = self; mo.special1 = 0; } From e3ba9567c9073f064bebb26688f01c95a43d78f5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 9 Dec 2017 12:57:09 +0200 Subject: [PATCH 04/11] Fixed English localization issues https://forum.zdoom.org/viewtopic.php?t=58684 --- wadsrc/static/language.enu | 3 +-- wadsrc/static/menudef.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index e68c9ae86..c66c97612 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -1777,7 +1777,7 @@ MOUSEMNU_LOOKSTRAFE = "Lookstrafe"; // Joystick Menu -JOYMNU_CONFIG = "CONFIGURE CONTROLLER"; +JOYMNU_TITLE = "CONFIGURE CONTROLLER"; JOYMNU_OPTIONS = "CONTROLLER OPTIONS"; JOYMNU_NOMENU = "Block controller input in menu"; @@ -2796,7 +2796,6 @@ OPTVAL_TRANSLUCENTFUZZ = "Translucent fuzz"; OPTVAL_NOISE = "Noise"; OPTVAL_SMOOTHNOISE = "Smooth Noise"; OPTVAL_JAGGEDFUZZ = "Jagged fuzz"; -OPTVAL_NORMAL = "Normal"; OPTVAL_GREENMAGENTA = "Green/Magenta"; OPTVAL_REDCYAN = "Red/Cyan"; OPTVAL_AMBERBLUE = "Amber/Blue"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 3d0621c3f..9e45f4137 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -608,7 +608,7 @@ OptionValue "Inversion" OptionMenu "JoystickConfigMenu" protected { - Title "$JOY_CONFIG" + Title "$JOYMNU_TITLE" Class "JoystickConfigMenu" // Will be filled in by joystick code. } From eb5da3e641273acfefe611e13da8159eeb8023b4 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 9 Dec 2017 06:09:39 -0500 Subject: [PATCH 05/11] - fixed: if the level is started before the first timer call, pass an earlier timestamp to screen->FrameTime --- src/i_time.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i_time.cpp b/src/i_time.cpp index bd8a3817a..29119ddb4 100644 --- a/src/i_time.cpp +++ b/src/i_time.cpp @@ -166,7 +166,7 @@ uint64_t I_msTime() uint64_t I_msTimeFS() // from "start" { - return NSToMS(I_nsTime() - FirstFrameStartTime); + return (FirstFrameStartTime == 0) ? 0 : NSToMS(I_nsTime() - FirstFrameStartTime); } int I_GetTime() From ebb926e7b052572decb40d259062a3c08ddbf8df Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 9 Dec 2017 17:38:34 +0200 Subject: [PATCH 06/11] Added free space margin aka safe frame for automap am_freespacemargin CVAR and corresponding menu options can set empty space margin for automap in percentage of zoomed out size https://forum.zdoom.org/viewtopic.php?t=58653 --- src/am_map.cpp | 19 +++++++++++++++++-- wadsrc/static/language.enu | 1 + wadsrc/static/menudef.txt | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/am_map.cpp b/src/am_map.cpp index d5c6a05f0..5ab41cd09 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -98,6 +98,20 @@ CVAR (Bool, am_showkeys, true, CVAR_ARCHIVE); CVAR (Int, am_showtriggerlines, 0, CVAR_ARCHIVE); CVAR (Int, am_showthingsprites, 0, CVAR_ARCHIVE); +CUSTOM_CVAR (Int, am_emptyspacemargin, 0, CVAR_ARCHIVE) +{ + if (self < 0) + { + self = 0; + } + else if (self > 50) + { + self = 50; + } + + AM_NewResolution(); +} + //============================================================================= // // Automap colors @@ -1063,8 +1077,9 @@ static void AM_findMinMaxBoundaries () static void AM_calcMinMaxMtoF() { - double a = SCREENWIDTH / max_w; - double b = StatusBar->GetTopOfStatusbar() / max_h; + const double safe_frame = 1.0 - am_emptyspacemargin / 100.0; + double a = safe_frame * (SCREENWIDTH / max_w); + double b = safe_frame * (StatusBar->GetTopOfStatusbar() / max_h); min_scale_mtof = a < b ? a : b; max_scale_mtof = SCREENHEIGHT / (2*PLAYERRADIUS); diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index c66c97612..a147eeb80 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -1941,6 +1941,7 @@ AUTOMAPMNU_SHOWKEYS = "Show keys (cheat)"; AUTOMAPMNU_SHOWTRIGGERLINES = "Show trigger lines"; AUTOMAPMNU_SHOWTHINGSPRITES = "Show things as sprites"; AUTOMAPMNU_PTOVERLAY = "Overlay portals"; +AUTOMAPMNU_EMPTYSPACEMARGIN = "Empty space margin"; // Automap Controls MAPCNTRLMNU_TITLE = "CUSTOMIZE MAP CONTROLS"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 9e45f4137..9574608f3 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1091,6 +1091,7 @@ OptionMenu AutomapOptions protected Option "$AUTOMAPMNU_TEXTURED", "am_textured", "OnOff" Option "$AUTOMAPMNU_FOLLOW", "am_followplayer", "OnOff" Option "$AUTOMAPMNU_PTOVERLAY", "am_portaloverlay", "OnOff" + Slider "$AUTOMAPMNU_EMPTYSPACEMARGIN", "am_emptyspacemargin", 0, 50, 5, 0 StaticText " " Option "$AUTOMAPMNU_SHOWITEMS", "am_showitems", "OnOff" Option "$AUTOMAPMNU_SHOWMONSTERS", "am_showmonsters", "OnOff" From 1559d74c2ca336bfaf21bcd1f4978d1185fd1102 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 10 Dec 2017 04:22:13 -0500 Subject: [PATCH 07/11] - repaired the video scaling code --- src/gl/renderer/gl_renderer.cpp | 6 ++++-- src/gl/system/gl_framebuffer.cpp | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gl/renderer/gl_renderer.cpp b/src/gl/renderer/gl_renderer.cpp index af910921b..74bd81c17 100644 --- a/src/gl/renderer/gl_renderer.cpp +++ b/src/gl/renderer/gl_renderer.cpp @@ -75,7 +75,6 @@ #include "r_videoscale.h" EXTERN_CVAR(Int, screenblocks) -EXTERN_CVAR(Int, vid_scalemode) CVAR(Bool, gl_scale_viewport, true, CVAR_ARCHIVE); @@ -312,7 +311,10 @@ void FGLRenderer::SetOutputViewport(GL_IRECT *bounds) mSceneViewport.height = height; // Scale viewports to fit letterbox - if ((gl_scale_viewport && !framebuffer->IsFullscreen() && vid_scalemode == 0) || !FGLRenderBuffers::IsEnabled()) + bool notScaled = ((mScreenViewport.width == ViewportScaledWidth(mScreenViewport.width, mScreenViewport.height)) && + (mScreenViewport.width == ViewportScaledHeight(mScreenViewport.width, mScreenViewport.height)) && + !ViewportIsScaled43()); + if ((gl_scale_viewport && !framebuffer->IsFullscreen() && notScaled) || !FGLRenderBuffers::IsEnabled()) { mScreenViewport.width = mOutputLetterbox.width; mScreenViewport.height = mOutputLetterbox.height; diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 7425271be..d6eb142d8 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -56,7 +56,6 @@ EXTERN_CVAR (Float, vid_brightness) EXTERN_CVAR (Float, vid_contrast) EXTERN_CVAR (Bool, vid_vsync) -EXTERN_CVAR(Int, vid_scalemode) CVAR(Bool, gl_aalines, false, CVAR_ARCHIVE) From a89bc237897d91191a27b770b74b7cf6ace2ed6e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 10 Dec 2017 13:24:16 +0200 Subject: [PATCH 08/11] Fixed crash when loading saved game with missing ACS module --- src/p_acs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 3d93e7a0a..22afac1b6 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3655,6 +3655,12 @@ void DLevelScript::Serialize(FSerializer &arc) if (arc.isReading()) { activeBehavior = FBehavior::StaticGetModule(lib); + + if (nullptr == activeBehavior) + { + I_Error("Could not find ACS module"); + } + pc = activeBehavior->Ofs2PC(pcofs); } } From acc943329bad48d3a602d778674d8afebbc1a3df Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 10 Dec 2017 14:35:30 +0200 Subject: [PATCH 09/11] Added null check for probe in SectorAction.OnDestroy() Absence of check led to unhandled VM abort exception in case of saved game failed to load --- wadsrc/static/zscript/shared/sectoraction.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/wadsrc/static/zscript/shared/sectoraction.txt b/wadsrc/static/zscript/shared/sectoraction.txt index 32302959a..fb7edfb19 100644 --- a/wadsrc/static/zscript/shared/sectoraction.txt +++ b/wadsrc/static/zscript/shared/sectoraction.txt @@ -37,13 +37,16 @@ class SectorAction : Actor else { Actor probe = CurSector.SecActTarget; - while (probe.tracer != self && probe.tracer != null) + if (null != probe) { - probe = probe.tracer; - } - if (probe.tracer == self) - { - probe.tracer = tracer; + while (probe.tracer != self && probe.tracer != null) + { + probe = probe.tracer; + } + if (probe.tracer == self) + { + probe.tracer = tracer; + } } } } From 724c9976951bcf85a82ea9d06e125fee640a811c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 10 Dec 2017 15:10:32 +0200 Subject: [PATCH 10/11] Fixed error check when saving GL nodes --- src/p_glnodes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index 977426e57..bd574ad83 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -1137,7 +1137,8 @@ static void CreateCachedNodes(MapData *map) if (fw != nullptr) { - if (fw->Write(compressed, outlen+offset) != 1) + const size_t length = outlen + offset; + if (fw->Write(compressed, length) != length) { Printf("Error saving nodes to file %s\n", path.GetChars()); } From 6b42036eb6a17af9d01406be9630709ca770dba5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 10 Dec 2017 21:26:52 +0100 Subject: [PATCH 11/11] - fixed: AActor::UnlinkFromWorld must also destroy all portal link nodes for the calling actor. --- src/p_maputl.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index e6b39e586..31ab08496 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -343,6 +343,16 @@ void AActor::UnlinkFromWorld (FLinkContext *ctx) } BlockNode = NULL; } + ClearRenderSectorList(); + ClearRenderLineList(); +} + +DEFINE_ACTION_FUNCTION(AActor, UnlinkFromWorld) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_POINTER_DEF(ctx, FLinkContext); + self->UnlinkFromWorld(ctx); // fixme + return 0; } @@ -429,15 +439,6 @@ bool AActor::FixMapthingPos() return success; } -DEFINE_ACTION_FUNCTION(AActor, UnlinkFromWorld) -{ - PARAM_SELF_PROLOGUE(AActor); - PARAM_POINTER_DEF(ctx, FLinkContext); - self->UnlinkFromWorld(ctx); // fixme - return 0; -} - - //========================================================================== // // P_SetThingPosition