mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-28 05:51:33 +00:00
- 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. # Conflicts: # src/swrenderer/textures/r_swtexture.h # src/textures/texture.cpp # Conflicts: # src/textures/texture.cpp
This commit is contained in:
parent
c0e9530fd0
commit
e87d04d843
6 changed files with 15 additions and 12 deletions
|
@ -246,6 +246,7 @@ enum ELevelFlags : unsigned int
|
||||||
LEVEL3_NOCOLOREDSPRITELIGHTING = 0x00000010, // draw sprites only with color-less light
|
LEVEL3_NOCOLOREDSPRITELIGHTING = 0x00000010, // draw sprites only with color-less light
|
||||||
LEVEL3_EXITNORMALUSED = 0x00000020,
|
LEVEL3_EXITNORMALUSED = 0x00000020,
|
||||||
LEVEL3_EXITSECRETUSED = 0x00000040,
|
LEVEL3_EXITSECRETUSED = 0x00000040,
|
||||||
|
LEVEL3_FORCEWORLDPANNING = 0x00000080, // Forces the world panning flag for all textures, even those without it explicitly set.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1472,6 +1472,7 @@ MapFlagHandlers[] =
|
||||||
{ "forcefakecontrast", MITYPE_SETFLAG3, LEVEL3_FORCEFAKECONTRAST, 0 },
|
{ "forcefakecontrast", MITYPE_SETFLAG3, LEVEL3_FORCEFAKECONTRAST, 0 },
|
||||||
{ "nolightfade", MITYPE_SETFLAG3, LEVEL3_NOLIGHTFADE, 0 },
|
{ "nolightfade", MITYPE_SETFLAG3, LEVEL3_NOLIGHTFADE, 0 },
|
||||||
{ "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 },
|
{ "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 },
|
||||||
|
{ "forceworldpanning", MITYPE_SETFLAG3, LEVEL3_FORCEWORLDPANNING, 0 },
|
||||||
{ "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes
|
{ "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes
|
||||||
{ "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX, 0 },
|
{ "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX, 0 },
|
||||||
{ "compat_stairs", MITYPE_COMPATFLAG, COMPATF_STAIRINDEX, 0 },
|
{ "compat_stairs", MITYPE_COMPATFLAG, COMPATF_STAIRINDEX, 0 },
|
||||||
|
|
|
@ -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)
|
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);
|
double yoffset = side->GetTextureYOffset(wallpart);
|
||||||
if (tex->bWorldPanning)
|
if (tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING))
|
||||||
yoffset *= side->GetTextureYScale(wallpart) * tex->Scale.Y;
|
yoffset *= side->GetTextureYScale(wallpart) * tex->Scale.Y;
|
||||||
|
|
||||||
switch (wallpart)
|
switch (wallpart)
|
||||||
|
|
|
@ -455,7 +455,7 @@ namespace swrenderer
|
||||||
double yscale = pic->Scale.Y * sidedef->GetTextureYScale(side_t::mid);
|
double yscale = pic->Scale.Y * sidedef->GetTextureYScale(side_t::mid);
|
||||||
fixed_t xoffset = FLOAT2FIXED(sidedef->GetTextureXOffset(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);
|
xoffset = xs_RoundToInt(xoffset * lwallscale);
|
||||||
}
|
}
|
||||||
|
@ -848,7 +848,7 @@ namespace swrenderer
|
||||||
mTopPart.TextureMid = (mBackSector->GetPlaneTexZ(sector_t::ceiling) - Thread->Viewport->viewpoint.Pos.Z) * yrepeat;
|
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;
|
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();
|
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;
|
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();
|
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;
|
mBottomPart.TextureMid += rowoffset * yrepeat;
|
||||||
}
|
}
|
||||||
|
@ -1144,7 +1144,7 @@ namespace swrenderer
|
||||||
lwallscale = xscale;
|
lwallscale = xscale;
|
||||||
}
|
}
|
||||||
fixed_t offset;
|
fixed_t offset;
|
||||||
if (mTopPart.Texture->bWorldPanning)
|
if (mTopPart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING))
|
||||||
{
|
{
|
||||||
offset = xs_RoundToInt(mTopPart.TextureOffsetU * xscale);
|
offset = xs_RoundToInt(mTopPart.TextureOffsetU * xscale);
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1191,7 @@ namespace swrenderer
|
||||||
lwallscale = xscale;
|
lwallscale = xscale;
|
||||||
}
|
}
|
||||||
fixed_t offset;
|
fixed_t offset;
|
||||||
if (mMiddlePart.Texture->bWorldPanning)
|
if (mMiddlePart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING))
|
||||||
{
|
{
|
||||||
offset = xs_RoundToInt(mMiddlePart.TextureOffsetU * xscale);
|
offset = xs_RoundToInt(mMiddlePart.TextureOffsetU * xscale);
|
||||||
}
|
}
|
||||||
|
@ -1239,7 +1239,7 @@ namespace swrenderer
|
||||||
lwallscale = xscale;
|
lwallscale = xscale;
|
||||||
}
|
}
|
||||||
fixed_t offset;
|
fixed_t offset;
|
||||||
if (mBottomPart.Texture->bWorldPanning)
|
if (mBottomPart.Texture->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING))
|
||||||
{
|
{
|
||||||
offset = xs_RoundToInt(mBottomPart.TextureOffsetU * xscale);
|
offset = xs_RoundToInt(mBottomPart.TextureOffsetU * xscale);
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,7 +221,7 @@ namespace swrenderer
|
||||||
MaskedScaleY = -MaskedScaleY;
|
MaskedScaleY = -MaskedScaleY;
|
||||||
sprflipvert = true;
|
sprflipvert = true;
|
||||||
}
|
}
|
||||||
if (tex->bWorldPanning)
|
if (tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING))
|
||||||
{
|
{
|
||||||
// rowoffset is added before the multiply so that the masked texture will
|
// rowoffset is added before the multiply so that the masked texture will
|
||||||
// still be positioned in world units rather than texels.
|
// still be positioned in world units rather than texels.
|
||||||
|
@ -354,7 +354,7 @@ namespace swrenderer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Texture does wrap vertically.
|
{ // 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
|
// rowoffset is added before the multiply so that the masked texture will
|
||||||
// still be positioned in world units rather than texels.
|
// still be positioned in world units rather than texels.
|
||||||
|
@ -470,7 +470,7 @@ namespace swrenderer
|
||||||
rowoffset += rw_pic->GetHeight();
|
rowoffset += rw_pic->GetHeight();
|
||||||
}
|
}
|
||||||
double texturemid = (planez - Thread->Viewport->viewpoint.Pos.Z) * yscale;
|
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
|
// rowoffset is added before the multiply so that the masked texture will
|
||||||
// still be positioned in world units rather than texels.
|
// still be positioned in world units rather than texels.
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "m_fixed.h"
|
#include "m_fixed.h"
|
||||||
#include "textures/textures.h"
|
#include "textures/textures.h"
|
||||||
#include "v_palette.h"
|
#include "v_palette.h"
|
||||||
|
#include "g_levellocals.h"
|
||||||
|
|
||||||
typedef FTexture * (*CreateFunc)(FileReader & file, int lumpnum);
|
typedef FTexture * (*CreateFunc)(FileReader & file, int lumpnum);
|
||||||
|
|
||||||
|
@ -1099,6 +1100,6 @@ void FTexCoordInfo::GetFromTexture(FTexture *tex, float x, float y)
|
||||||
mScale.Y = -mScale.Y;
|
mScale.Y = -mScale.Y;
|
||||||
mRenderHeight = -mRenderHeight;
|
mRenderHeight = -mRenderHeight;
|
||||||
}
|
}
|
||||||
mWorldPanning = tex->bWorldPanning;
|
mWorldPanning = tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING);
|
||||||
mWidth = tex->GetWidth();
|
mWidth = tex->GetWidth();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue