diff --git a/src/g_level.h b/src/g_level.h index f894b03f9..986014214 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -246,6 +246,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 1efb20bba..1a5be6b59 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -1472,6 +1472,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/polyrenderer/scene/poly_wall.cpp b/src/polyrenderer/scene/poly_wall.cpp index 3ba2e9f56..64bf80ab7 100644 --- a/src/polyrenderer/scene/poly_wall.cpp +++ b/src/polyrenderer/scene/poly_wall.cpp @@ -609,7 +609,7 @@ PolyWallTextureCoordsU::PolyWallTextureCoordsU(FTexture *tex, const seg_t *lines PolyWallTextureCoordsV::PolyWallTextureCoordsV(FTexture *tex, const line_t *line, const side_t *side, side_t::ETexpart wallpart, double topz, double bottomz, double unpeggedceil, double topTexZ, double bottomTexZ) { double yoffset = side->GetTextureYOffset(wallpart); - if (tex->bWorldPanning) + if (tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) yoffset *= side->GetTextureYScale(wallpart) * tex->Scale.Y; switch (wallpart) diff --git a/src/swrenderer/line/r_line.cpp b/src/swrenderer/line/r_line.cpp index 77ac90f5b..10c63ed17 100644 --- a/src/swrenderer/line/r_line.cpp +++ b/src/swrenderer/line/r_line.cpp @@ -455,7 +455,7 @@ namespace swrenderer double yscale = pic->Scale.Y * sidedef->GetTextureYScale(side_t::mid); fixed_t xoffset = FLOAT2FIXED(sidedef->GetTextureXOffset(side_t::mid)); - if (pic->bWorldPanning) + if (pic->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { xoffset = xs_RoundToInt(xoffset * lwallscale); } @@ -848,7 +848,7 @@ namespace swrenderer mTopPart.TextureMid = (mBackSector->GetPlaneTexZ(sector_t::ceiling) - Thread->Viewport->viewpoint.Pos.Z) * yrepeat; } } - if (mTopPart.Texture->bWorldPanning) + if (mTopPart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { mTopPart.TextureMid += rowoffset * yrepeat; } @@ -904,7 +904,7 @@ namespace swrenderer mMiddlePart.TextureMid = (mFrontSector->GetPlaneTexZ(sector_t::ceiling) - Thread->Viewport->viewpoint.Pos.Z) * yrepeat + mMiddlePart.Texture->GetHeight(); } } - if (mMiddlePart.Texture->bWorldPanning) + if (mMiddlePart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { mMiddlePart.TextureMid += rowoffset * yrepeat; } @@ -969,7 +969,7 @@ namespace swrenderer mBottomPart.TextureMid = (mBackSector->GetPlaneTexZ(sector_t::floor) - Thread->Viewport->viewpoint.Pos.Z) * yrepeat + mBottomPart.Texture->GetHeight(); } } - if (mBottomPart.Texture->bWorldPanning) + if (mBottomPart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { mBottomPart.TextureMid += rowoffset * yrepeat; } @@ -1144,7 +1144,7 @@ namespace swrenderer lwallscale = xscale; } fixed_t offset; - if (mTopPart.Texture->bWorldPanning) + if (mTopPart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { offset = xs_RoundToInt(mTopPart.TextureOffsetU * xscale); } @@ -1191,7 +1191,7 @@ namespace swrenderer lwallscale = xscale; } fixed_t offset; - if (mMiddlePart.Texture->bWorldPanning) + if (mMiddlePart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { offset = xs_RoundToInt(mMiddlePart.TextureOffsetU * xscale); } @@ -1239,7 +1239,7 @@ namespace swrenderer lwallscale = xscale; } fixed_t offset; - if (mBottomPart.Texture->bWorldPanning) + if (mBottomPart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { offset = xs_RoundToInt(mBottomPart.TextureOffsetU * xscale); } diff --git a/src/swrenderer/line/r_renderdrawsegment.cpp b/src/swrenderer/line/r_renderdrawsegment.cpp index fbc18b0c6..88fd52271 100644 --- a/src/swrenderer/line/r_renderdrawsegment.cpp +++ b/src/swrenderer/line/r_renderdrawsegment.cpp @@ -221,7 +221,7 @@ namespace swrenderer MaskedScaleY = -MaskedScaleY; sprflipvert = true; } - if (tex->bWorldPanning) + if (tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { // rowoffset is added before the multiply so that the masked texture will // still be positioned in world units rather than texels. @@ -354,7 +354,7 @@ namespace swrenderer } else { // Texture does wrap vertically. - if (tex->bWorldPanning) + if (tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { // rowoffset is added before the multiply so that the masked texture will // still be positioned in world units rather than texels. @@ -470,7 +470,7 @@ namespace swrenderer rowoffset += rw_pic->GetHeight(); } double texturemid = (planez - Thread->Viewport->viewpoint.Pos.Z) * yscale; - if (rw_pic->bWorldPanning) + if (rw_pic->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING)) { // rowoffset is added before the multiply so that the masked texture will // still be positioned in world units rather than texels. diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 9ee130ad6..5ddead9f4 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -46,6 +46,7 @@ #include "m_fixed.h" #include "textures/textures.h" #include "v_palette.h" +#include "g_levellocals.h" typedef FTexture * (*CreateFunc)(FileReader & file, int lumpnum); @@ -1099,6 +1100,6 @@ 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(); }