- fixed: positioning of camera textures on 2-sided walls was not correct.

This commit is contained in:
Christoph Oelckers 2016-02-14 14:33:52 +01:00
parent 71fc4c295f
commit 141065c3d5

View file

@ -678,6 +678,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
GLSeg glsave=glseg; GLSeg glsave=glseg;
fixed_t texturetop, texturebottom; fixed_t texturetop, texturebottom;
bool wrap = (seg->linedef->flags&ML_WRAP_MIDTEX) || (seg->sidedef->Flags&WALLF_WRAP_MIDTEX); bool wrap = (seg->linedef->flags&ML_WRAP_MIDTEX) || (seg->sidedef->Flags&WALLF_WRAP_MIDTEX);
bool mirrory = false;
// //
// //
@ -690,6 +691,12 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
// At this point slopes don't matter because they don't affect the texture's z-position // At this point slopes don't matter because they don't affect the texture's z-position
gltexture->GetTexCoordInfo(&tci, seg->sidedef->GetTextureXScale(side_t::mid), seg->sidedef->GetTextureYScale(side_t::mid)); gltexture->GetTexCoordInfo(&tci, seg->sidedef->GetTextureXScale(side_t::mid), seg->sidedef->GetTextureYScale(side_t::mid));
if (tci.mRenderHeight < 0)
{
mirrory = true;
tci.mRenderHeight = -tci.mRenderHeight;
tci.mScaleY = -tci.mScaleY;
}
fixed_t rowoffset = tci.RowOffset(seg->sidedef->GetTextureYOffset(side_t::mid)); fixed_t rowoffset = tci.RowOffset(seg->sidedef->GetTextureYOffset(side_t::mid));
if ((seg->linedef->flags & ML_DONTPEGBOTTOM) >0) if ((seg->linedef->flags & ML_DONTPEGBOTTOM) >0)
{ {
@ -840,6 +847,11 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
flags|=GLT_CLAMPY; flags|=GLT_CLAMPY;
} }
} }
if (mirrory)
{
tci.mRenderHeight = -tci.mRenderHeight;
tci.mScaleY = -tci.mScaleY;
}
SetWallCoordinates(seg, &tci, FIXED2FLOAT(texturetop), topleft, topright, bottomleft, bottomright, t_ofs); SetWallCoordinates(seg, &tci, FIXED2FLOAT(texturetop), topleft, topright, bottomleft, bottomright, t_ofs);
// //