mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- fixed: negative texture scales should not affect the direction a wall scrolls in.
This commit is contained in:
parent
cb758f6dab
commit
32da1de385
1 changed files with 18 additions and 12 deletions
|
@ -352,15 +352,18 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla
|
|||
|
||||
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;
|
||||
else return rowoffset / mScale.Y;
|
||||
if (scale == 1.f || mWorldPanning) return rowoffset;
|
||||
else return rowoffset / scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mWorldPanning) return rowoffset / mTempScale.Y;
|
||||
else return rowoffset / mScale.Y;
|
||||
if (mWorldPanning) return rowoffset / tscale;
|
||||
else return rowoffset / scale;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -372,15 +375,17 @@ float FTexCoordInfo::RowOffset(float rowoffset) 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;
|
||||
else return textureoffset / mScale.X;
|
||||
if (scale == 1.f || mWorldPanning) return textureoffset;
|
||||
else return textureoffset / scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mWorldPanning) return textureoffset / mTempScale.X;
|
||||
else return textureoffset / mScale.X;
|
||||
if (mWorldPanning) return textureoffset / tscale;
|
||||
else return textureoffset / scale;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -394,8 +399,9 @@ float FTexCoordInfo::TextureAdjustWidth() const
|
|||
{
|
||||
if (mWorldPanning)
|
||||
{
|
||||
if (mTempScale.X == 1.f) return mRenderWidth;
|
||||
else return mWidth / mTempScale.X;
|
||||
float tscale = fabs(mTempScale.X);
|
||||
if (tscale == 1.f) return mRenderWidth;
|
||||
else return mWidth / fabs(tscale);
|
||||
}
|
||||
else return mWidth;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue