From ba629379ca7b610ef3d3a3a7adef11080e085bce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 30 Jan 2017 00:25:40 +0100 Subject: [PATCH 1/3] - fixed: for levels with 0-length lines the allocation size of the lines array was too large because it didn't subtract those deleted lines. --- src/p_setup.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index e2dee7cf1..df41345f4 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -2093,9 +2093,7 @@ void P_LoadLineDefs (MapData * map) maplinedef_t *mld; int numlines = lumplen / sizeof(maplinedef_t); - level.lines.Alloc(numlines); linemap.Resize(numlines); - memset (&level.lines[0], 0, numlines*sizeof(line_t)); mldf = new char[lumplen]; map->Read(ML_LINEDEFS, mldf); @@ -2140,6 +2138,8 @@ void P_LoadLineDefs (MapData * map) i++; } } + level.lines.Alloc(numlines); + memset(&level.lines[0], 0, numlines * sizeof(line_t)); P_AllocateSideDefs (map, sidecount); @@ -2192,9 +2192,7 @@ void P_LoadLineDefs2 (MapData * map) maplinedef2_t *mld; int numlines = lumplen / sizeof(maplinedef2_t); - level.lines.Alloc(numlines); linemap.Resize(numlines); - memset (&level.lines[0], 0, numlines*sizeof(line_t)); mldf = new char[lumplen]; map->Read(ML_LINEDEFS, mldf); @@ -2233,6 +2231,8 @@ void P_LoadLineDefs2 (MapData * map) { ForceNodeBuild = true; } + level.lines.Alloc(numlines); + memset(&level.lines[0], 0, numlines * sizeof(line_t)); P_AllocateSideDefs (map, sidecount); From 7c5e3fb67719d819207dcaa76992c31b59e05c36 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 30 Jan 2017 14:18:42 +0100 Subject: [PATCH 2/3] - disabled angular interpolation again. This can only be used if the entirety of the game code is aware and dealing with this properly. However, that isn't the case so the amount of glitches this causes far exceeds the number of desired interpolations. --- src/gl/scene/gl_sprite.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 4f5e1a4c3..e4c9f45af 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -737,7 +737,8 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) int clipres = GLRenderer->mClipPortal->ClipPoint(thingpos); if (clipres == GLPortal::PClip_InFront) return; } - Angles = thing->InterpolatedAngles(r_TicFracF); + // disabled because almost none of the actual game code is even remotely prepared for this. Sorry for the few cases where it may be desired, but the overall effect is too bad. + Angles = thing->Angles;// InterpolatedAngles(r_TicFracF); player_t *player = &players[consoleplayer]; FloatRect r; From 0e5aee48aaa983eb6eca512dbf3f4efd34645ca8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 30 Jan 2017 22:23:36 +0100 Subject: [PATCH 3/3] - clamp MAPINFO provided fog density values to a valid range because negative values can trigger undefined shader behavior. --- src/gl/data/gl_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gl/data/gl_data.cpp b/src/gl/data/gl_data.cpp index d386428a2..bb73ad3ae 100644 --- a/src/gl/data/gl_data.cpp +++ b/src/gl/data/gl_data.cpp @@ -413,7 +413,7 @@ void InitGLRMapinfoData() if (opt != NULL) { - gl_SetFogParams(opt->fogdensity, level.info->outsidefog, opt->outsidefogdensity, opt->skyfog); + gl_SetFogParams(clamp(opt->fogdensity, 0, 255), level.info->outsidefog, clamp(opt->outsidefogdensity, 0, 255), opt->skyfog); glset.map_lightmode = opt->lightmode; glset.map_lightadditivesurfaces = opt->lightadditivesurfaces; glset.map_attenuate = opt->attenuate;