mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-26 03:35:27 +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;
|
Vec4f br;
|
||||||
Vec3ByMatrix44(br.AsArray(), v[0].pos, flippedMatrix);
|
Vec3ByMatrix44(br.AsArray(), v[0].pos, flippedMatrix);
|
||||||
|
|
||||||
float x1 = tl.x / tl.w;
|
const float invtlw = 1.0f / tl.w;
|
||||||
float x2 = br.x / br.w;
|
const float invbrw = 1.0f / br.w;
|
||||||
float y1 = tl.y / tl.w;
|
const float x1 = tl.x * invtlw;
|
||||||
float y2 = br.y / br.w;
|
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))
|
if ((x1 < x2 && y1 < y2) || (x1 > x2 && y1 > y2))
|
||||||
SwapUVs(v[1], v[3]);
|
SwapUVs(v[1], v[3]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user