mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
Fix RotateUV. Apparently the rules are reversed in through mode.
This commit is contained in:
@@ -348,11 +348,24 @@ static void SwapUVs(TransformedVertex &a, TransformedVertex &b) {
|
||||
// 1 0 0 1 1 2 3 0
|
||||
|
||||
// Used by Star Soldier and Ys vs Sora.
|
||||
static void RotateUVs(TransformedVertex v[4]) {
|
||||
if (/* (v[0].x > v[2].x && v[0].y < v[2].y) || */ // This first check seems wrong..
|
||||
(v[0].x < v[2].x && v[0].y > v[2].y)) {
|
||||
static void RotateUV(TransformedVertex v[4]) {
|
||||
float x1 = v[2].x;
|
||||
float x2 = v[0].x;
|
||||
float y1 = v[2].y;
|
||||
float y2 = v[0].y;
|
||||
|
||||
if ((x1 < x2 && y1 < y2) || (x1 > x2 && y1 > y2))
|
||||
SwapUVs(v[1], v[3]);
|
||||
}
|
||||
|
||||
static void RotateUVThrough(TransformedVertex v[4]) {
|
||||
float x1 = v[2].x;
|
||||
float x2 = v[0].x;
|
||||
float y1 = v[2].y;
|
||||
float y2 = v[0].y;
|
||||
|
||||
if ((x1 < x2 && y1 > y2) || (x1 > x2 && y1 < y2))
|
||||
SwapUVs(v[1], v[3]);
|
||||
}
|
||||
}
|
||||
|
||||
// This is the software transform pipeline, which is necessary for supporting RECT
|
||||
@@ -620,7 +633,10 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
|
||||
trans[3].u = saved.u;
|
||||
|
||||
// That's the four corners. Now process UV rotation.
|
||||
RotateUVs(trans);
|
||||
if (throughmode)
|
||||
RotateUVThrough(trans);
|
||||
else
|
||||
RotateUV(trans);
|
||||
|
||||
// bottom right
|
||||
trans[4] = trans[0];
|
||||
|
||||
Reference in New Issue
Block a user