mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-03-06 14:27:44 +00:00
Optimise non smooth texture repeat to only effect texture boundaries, rather than poly boundaries. Fixes a few ugly artefacts
This commit is contained in:
parent
661f19be19
commit
ce03c13847
|
@ -823,14 +823,29 @@ void CNew3D::OffsetTexCoords(R3DPoly& r3dPoly, float offset[2])
|
|||
max = std::max(r3dPoly.v[j].texcoords[i], max);
|
||||
}
|
||||
|
||||
float fTemp;
|
||||
float iTemp;
|
||||
bool fractMin;
|
||||
bool fractMax;
|
||||
|
||||
fTemp = modf(min, &iTemp);
|
||||
fractMin = fTemp > 0;
|
||||
|
||||
fTemp = modf(max, &iTemp);
|
||||
fractMax = fTemp > 0;
|
||||
|
||||
for (int j = 0; j < r3dPoly.number && min != max; j++) {
|
||||
|
||||
if (r3dPoly.v[j].texcoords[i] == min) {
|
||||
r3dPoly.v[j].texcoords[i] += offset[i];
|
||||
if (!fractMin) {
|
||||
if (r3dPoly.v[j].texcoords[i] == min) {
|
||||
r3dPoly.v[j].texcoords[i] += offset[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (r3dPoly.v[j].texcoords[i] == max) {
|
||||
r3dPoly.v[j].texcoords[i] -= offset[i];
|
||||
if (!fractMax) {
|
||||
if (r3dPoly.v[j].texcoords[i] == max) {
|
||||
r3dPoly.v[j].texcoords[i] -= offset[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue