mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- match alignment of NPOT flat textures to the software renderer
Tested in RR E1L4, sector 224+40, probably needs more checking in other places as well to confirm that it is correct there as well.
This commit is contained in:
parent
b4a968841a
commit
7b14aacdf4
1 changed files with 4 additions and 7 deletions
|
@ -143,13 +143,10 @@ public:
|
||||||
sinalign = float(vang.Sin());
|
sinalign = float(vang.Sin());
|
||||||
|
|
||||||
int pow2width = 1 << sizeToBits((int)tx->GetDisplayWidth());
|
int pow2width = 1 << sizeToBits((int)tx->GetDisplayWidth());
|
||||||
if (pow2width < (int)tx->GetDisplayWidth()) pow2width *= 2;
|
|
||||||
|
|
||||||
int pow2height = 1 << sizeToBits((int)tx->GetDisplayHeight());
|
int pow2height = 1 << sizeToBits((int)tx->GetDisplayHeight());
|
||||||
if (pow2height < (int)tx->GetDisplayHeight()) pow2height *= 2;
|
|
||||||
|
|
||||||
xpanning = pow2width * xpan / (256.f * tx->GetDisplayWidth());
|
xpanning = xpan / 256.f;
|
||||||
ypanning = pow2height * ypan / (256.f * tx->GetDisplayHeight());
|
ypanning = ypan / 256.f;
|
||||||
|
|
||||||
float scalefactor = (stat & CSTAT_SECTOR_TEXHALF) ? 8.0f : 16.0f;
|
float scalefactor = (stat & CSTAT_SECTOR_TEXHALF) ? 8.0f : 16.0f;
|
||||||
|
|
||||||
|
@ -167,8 +164,8 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xscaled = scalefactor * (int)tx->GetDisplayWidth();
|
xscaled = scalefactor * pow2width;
|
||||||
yscaled = scalefactor * (int)tx->GetDisplayHeight();
|
yscaled = scalefactor * pow2height;
|
||||||
}
|
}
|
||||||
|
|
||||||
FVector2 GetUV(int x, int y, float z)
|
FVector2 GetUV(int x, int y, float z)
|
||||||
|
|
Loading…
Reference in a new issue