diff --git a/src/hwrenderer/scene/hw_walls.cpp b/src/hwrenderer/scene/hw_walls.cpp index 905e70b11..9b42ac5cc 100644 --- a/src/hwrenderer/scene/hw_walls.cpp +++ b/src/hwrenderer/scene/hw_walls.cpp @@ -1095,6 +1095,12 @@ void GLWall::CheckTexturePosition(FTexCoordInfo *tci) } } + +static void GetTexCoordInfo(FMaterial *tex, FTexCoordInfo *tci, side_t *side, int texpos) +{ + tci->GetFromTexture(tex->tex, (float)side->GetTextureXScale(texpos), (float)side->GetTextureYScale(texpos), !!(side->GetLevel()->flags3 & LEVEL3_FORCEWORLDPANNING)); +} + //========================================================================== // // Handle one sided walls, upper and lower texture @@ -1129,7 +1135,7 @@ void GLWall::DoTexture(HWDrawInfo *di, int _type,seg_t * seg, int peg, FTexCoordInfo tci; - gltexture->GetTexCoordInfo(&tci, seg->sidedef, texpos); + GetTexCoordInfo(gltexture, &tci, seg->sidedef, texpos); type = _type; @@ -1190,7 +1196,7 @@ void GLWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary, // Align the texture to the ORIGINAL sector's height!! // At this point slopes don't matter because they don't affect the texture's z-position - gltexture->GetTexCoordInfo(&tci, seg->sidedef, side_t::mid); + GetTexCoordInfo(gltexture, &tci, seg->sidedef, side_t::mid); if (tci.mRenderHeight < 0) { mirrory = true; @@ -1530,19 +1536,19 @@ void GLWall::BuildFFBlock(HWDrawInfo *di, seg_t * seg, F3DFloor * rover, { gltexture = FMaterial::ValidateTexture(seg->sidedef->GetTexture(side_t::top), false, true); if (!gltexture) return; - gltexture->GetTexCoordInfo(&tci, seg->sidedef, side_t::top); + GetTexCoordInfo(gltexture, &tci, seg->sidedef, side_t::top); } else if (rover->flags&FF_LOWERTEXTURE) { gltexture = FMaterial::ValidateTexture(seg->sidedef->GetTexture(side_t::bottom), false, true); if (!gltexture) return; - gltexture->GetTexCoordInfo(&tci, seg->sidedef, side_t::bottom); + GetTexCoordInfo(gltexture, &tci, seg->sidedef, side_t::bottom); } else { gltexture = FMaterial::ValidateTexture(mastersd->GetTexture(side_t::mid), false, true); if (!gltexture) return; - gltexture->GetTexCoordInfo(&tci, mastersd, side_t::mid); + GetTexCoordInfo(gltexture, &tci, mastersd, side_t::mid); } to = (rover->flags&(FF_UPPERTEXTURE | FF_LOWERTEXTURE)) ? 0 : tci.TextureOffset(mastersd->GetTextureXOffset(side_t::mid)); @@ -2195,7 +2201,7 @@ void GLWall::ProcessLowerMiniseg(HWDrawInfo *di, seg_t *seg, sector_t * frontsec { FTexCoordInfo tci; type = RENDERWALL_BOTTOM; - gltexture->GetTexCoordInfo(&tci, 1.f, 1.f); + tci.GetFromTexture(gltexture->tex, 1, 1, false); SetWallCoordinates(seg, &tci, bfh, bfh, bfh, ffh, ffh, 0); PutWall(di, false); } diff --git a/src/hwrenderer/textures/hw_material.h b/src/hwrenderer/textures/hw_material.h index 6bf3e265b..99f241434 100644 --- a/src/hwrenderer/textures/hw_material.h +++ b/src/hwrenderer/textures/hw_material.h @@ -94,16 +94,6 @@ public: *r = mSpriteRect; } - void GetTexCoordInfo(FTexCoordInfo *tci, float x, float y) const - { - tci->GetFromTexture(tex, x, y); - } - - void GetTexCoordInfo(FTexCoordInfo *tci, side_t *side, int texpos) const - { - GetTexCoordInfo(tci, (float)side->GetTextureXScale(texpos), (float)side->GetTextureYScale(texpos)); - } - // This is scaled size in integer units as needed by walls and flats int TextureHeight() const { return mRenderHeight; } int TextureWidth() const { return mRenderWidth; } diff --git a/src/p_3dmidtex.cpp b/src/p_3dmidtex.cpp index 64485522c..be5ab9000 100644 --- a/src/p_3dmidtex.cpp +++ b/src/p_3dmidtex.cpp @@ -236,7 +236,7 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, do FTexCoordInfo tci; // We only need the vertical positioning info here. - tci.GetFromTexture(tex, 1., (float)side->GetTextureYScale(side_t::mid)); + tci.GetFromTexture(tex, 1., (float)side->GetTextureYScale(side_t::mid), !!(line->GetLevel()->flags3 & LEVEL3_FORCEWORLDPANNING)); double y_offset = tci.RowOffset((float)side->GetTextureYOffset(side_t::mid)); double textureheight = tci.mRenderHeight; diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index 9e5b435d2..74ecf1313 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -2640,7 +2640,7 @@ static void Vec2OffsetZ(FLevelLocals *Level, double x, double y, double dx, doub } else { - DVector2 v = level.GetPortalOffsetPosition(x, y, dx, dy); + DVector2 v = Level->GetPortalOffsetPosition(x, y, dx, dy); *result = (DVector3(v, atz)); } } diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 118bbf5bc..6d8dc0198 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -870,7 +870,7 @@ float FTexCoordInfo::TextureAdjustWidth() const // //=========================================================================== -void FTexCoordInfo::GetFromTexture(FTexture *tex, float x, float y) +void FTexCoordInfo::GetFromTexture(FTexture *tex, float x, float y, bool forceworldpanning) { if (x == 1.f) { @@ -904,7 +904,7 @@ void FTexCoordInfo::GetFromTexture(FTexture *tex, float x, float y) mScale.Y = -mScale.Y; mRenderHeight = -mRenderHeight; } - mWorldPanning = tex->bWorldPanning || (level.flags3 & LEVEL3_FORCEWORLDPANNING); + mWorldPanning = tex->bWorldPanning || forceworldpanning; mWidth = tex->GetWidth(); } diff --git a/src/textures/textures.h b/src/textures/textures.h index 52ed052db..f23d3c3d6 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -755,7 +755,7 @@ struct FTexCoordInfo float RowOffset(float ofs) const; float TextureOffset(float ofs) const; float TextureAdjustWidth() const; - void GetFromTexture(FTexture *tex, float x, float y); + void GetFromTexture(FTexture *tex, float x, float y, bool forceworldpanning); };