From 74ea9143ee2f7b79eb399bb4571be2d36c3830dc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 15 Dec 2018 16:29:37 +0100 Subject: [PATCH] - added a 'forceworldpanning' map flag. Since unfortunately this cannot be set as a general default, let's at least make it as easy as possible to disable that panning+scaling madness without having to edit the texture data. --- src/g_level.h | 1 + src/g_mapinfo.cpp | 1 + src/swrenderer/textures/r_swtexture.h | 3 ++- src/textures/texture.cpp | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/g_level.h b/src/g_level.h index f512287d3..46ffbf795 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -247,6 +247,7 @@ enum ELevelFlags : unsigned int LEVEL3_NOCOLOREDSPRITELIGHTING = 0x00000010, // draw sprites only with color-less light LEVEL3_EXITNORMALUSED = 0x00000020, LEVEL3_EXITSECRETUSED = 0x00000040, + LEVEL3_FORCEWORLDPANNING = 0x00000080, // Forces the world panning flag for all textures, even those without it explicitly set. }; diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index e79abf0c8..4595afff0 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -1553,6 +1553,7 @@ MapFlagHandlers[] = { "forcefakecontrast", MITYPE_SETFLAG3, LEVEL3_FORCEFAKECONTRAST, 0 }, { "nolightfade", MITYPE_SETFLAG3, LEVEL3_NOLIGHTFADE, 0 }, { "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 }, + { "forceworldpanning", MITYPE_SETFLAG3, LEVEL3_FORCEWORLDPANNING, 0 }, { "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes { "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX, 0 }, { "compat_stairs", MITYPE_COMPATFLAG, COMPATF_STAIRINDEX, 0 }, diff --git a/src/swrenderer/textures/r_swtexture.h b/src/swrenderer/textures/r_swtexture.h index 14810b071..f03f8c86a 100644 --- a/src/swrenderer/textures/r_swtexture.h +++ b/src/swrenderer/textures/r_swtexture.h @@ -1,6 +1,7 @@ #pragma once #include "textures/textures.h" #include "v_video.h" +#include "g_levellocals.h" struct FSoftwareTextureSpan @@ -48,7 +49,7 @@ public: // The feature from hell... :( bool useWorldPanning() const { - return mTexture->bWorldPanning; + return mTexture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING); } bool isMasked() diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 6f01f0e4f..44203413a 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -51,6 +51,7 @@ #include "imagehelpers.h" #include "image.h" #include "formats/multipatchtexture.h" +#include "g_levellocals.h" FTexture *CreateBrightmapTexture(FImageSource*); @@ -903,7 +904,7 @@ void FTexCoordInfo::GetFromTexture(FTexture *tex, float x, float y) mScale.Y = -mScale.Y; mRenderHeight = -mRenderHeight; } - mWorldPanning = tex->bWorldPanning; + mWorldPanning = tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING); mWidth = tex->GetWidth(); }