gsdx-hack: remove an extra offset + duplicate linear computing

Initially code aligned texture on pixel boundary + 1/16th. It seems to work without it.
This commit is contained in:
Gregory Hainaut 2015-04-12 17:57:37 +02:00
parent 399ddbd74a
commit 815c99b6e4
1 changed files with 30 additions and 10 deletions

View File

@ -282,21 +282,41 @@ void GSRendererHW::RoundSpriteOffset()
// will be sampled so (t0 - 8) and (t1 - 8 + 16) must be valid. // will be sampled so (t0 - 8) and (t1 - 8 + 16) must be valid.
// //
// Minus half for t1 case might be too much // Minus half for t1 case might be too much
if (tx0 <= tx1) { if (linear) {
v[i].U = tx0 + half + 1; if (tx0 <= tx1) {
v[i+1].U = tx1 - half + 1 + 15; v[i].U = tx0 + half;
v[i+1].U = tx1 - half + 16;
} else {
v[i].U = tx0 + 15;
v[i+1].U = tx1 + 15 + 16;
}
} else { } else {
v[i].U = tx0 + 15; if (tx0 <= tx1) {
v[i+1].U = tx1 + 15 + 16; v[i].U = tx0;
v[i+1].U = tx1 + 16;
} else {
v[i].U = tx0 + 15;
v[i+1].U = tx1 + 15 + 16;
}
} }
#endif #endif
#if 1 #if 1
if (ty0 <= ty1) { if (linear) {
v[i].V = ty0 + half + 1; if (ty0 <= ty1) {
v[i+1].V = ty1 - half + 1 + 15; v[i].V = ty0 + half;
v[i+1].V = ty1 - half + 16;
} else {
v[i].V = ty0 + 15;
v[i+1].V = ty1 + 15 + 16;
}
} else { } else {
v[i].V = ty0 + 15; if (ty0 <= ty1) {
v[i+1].V = ty1 + 15 + 16; v[i].V = ty0;
v[i+1].V = ty1 + 16;
} else {
v[i].V = ty0 + 15;
v[i+1].V = ty1 + 15 + 16;
}
} }
#endif #endif