- fixed: negative texture scales should not affect the direction a wall scrolls in.

This commit is contained in:
Christoph Oelckers 2017-02-13 22:37:16 +01:00
parent cb758f6dab
commit 32da1de385

View file

@ -352,15 +352,18 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
float FTexCoordInfo::RowOffset(float rowoffset) const float FTexCoordInfo::RowOffset(float rowoffset) const
{ {
if (mTempScale.Y == 1.f) float tscale = fabs(mTempScale.Y);
float scale = fabs(mScale.Y);
if (tscale == 1.f)
{ {
if (mScale.Y == 1.f || mWorldPanning) return rowoffset; if (scale == 1.f || mWorldPanning) return rowoffset;
else return rowoffset / mScale.Y; else return rowoffset / scale;
} }
else else
{ {
if (mWorldPanning) return rowoffset / mTempScale.Y; if (mWorldPanning) return rowoffset / tscale;
else return rowoffset / mScale.Y; else return rowoffset / scale;
} }
} }
@ -372,15 +375,17 @@ float FTexCoordInfo::RowOffset(float rowoffset) const
float FTexCoordInfo::TextureOffset(float textureoffset) const float FTexCoordInfo::TextureOffset(float textureoffset) const
{ {
if (mTempScale.X == 1.f) float tscale = fabs(mTempScale.X);
float scale = fabs(mScale.X);
if (tscale == 1.f)
{ {
if (mScale.X == 1.f || mWorldPanning) return textureoffset; if (scale == 1.f || mWorldPanning) return textureoffset;
else return textureoffset / mScale.X; else return textureoffset / scale;
} }
else else
{ {
if (mWorldPanning) return textureoffset / mTempScale.X; if (mWorldPanning) return textureoffset / tscale;
else return textureoffset / mScale.X; else return textureoffset / scale;
} }
} }
@ -394,8 +399,9 @@ float FTexCoordInfo::TextureAdjustWidth() const
{ {
if (mWorldPanning) if (mWorldPanning)
{ {
if (mTempScale.X == 1.f) return mRenderWidth; float tscale = fabs(mTempScale.X);
else return mWidth / mTempScale.X; if (tscale == 1.f) return mRenderWidth;
else return mWidth / fabs(tscale);
} }
else return mWidth; else return mWidth;
} }