mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-25 19:30:53 +00:00
Avoid some division.
This commit is contained in:
parent
ea36554c6a
commit
b782165b6a
@ -68,10 +68,12 @@ static void RotateUV(TransformedVertex v[4], float flippedMatrix[16]) {
|
||||
Vec4f br;
|
||||
Vec3ByMatrix44(br.AsArray(), v[0].pos, flippedMatrix);
|
||||
|
||||
float x1 = tl.x / tl.w;
|
||||
float x2 = br.x / br.w;
|
||||
float y1 = tl.y / tl.w;
|
||||
float y2 = br.y / br.w;
|
||||
const float invtlw = 1.0f / tl.w;
|
||||
const float invbrw = 1.0f / br.w;
|
||||
const float x1 = tl.x * invtlw;
|
||||
const float x2 = br.x * invbrw;
|
||||
const float y1 = tl.y * invtlw;
|
||||
const float y2 = br.y * invbrw;
|
||||
|
||||
if ((x1 < x2 && y1 < y2) || (x1 > x2 && y1 > y2))
|
||||
SwapUVs(v[1], v[3]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user