DS GX: Fix texture clipping issues

This commit is contained in:
Vicki Pfau 2017-03-01 23:13:00 -08:00
parent 0c60619651
commit 80ff9596b9
2 changed files with 5 additions and 5 deletions

View File

@ -20,8 +20,8 @@ struct DSGXSoftwarePolygon {
uint16_t* texBase;
uint16_t* palBase;
int texFormat;
unsigned texW;
unsigned texH;
int texW;
int texH;
int32_t topY;
int32_t bottomY;
int32_t topZ;

View File

@ -43,8 +43,8 @@ static color_t _lookupColor(struct DSGXSoftwareEndpoint* ep, struct DSGXSoftware
// TODO: Optimize
uint16_t texel;
uint16_t s = ep->s >> 4;
uint16_t t = ep->t >> 4;
int16_t s = ep->s >> 4;
int16_t t = ep->t >> 4;
if (!DSGXTexParamsIsSRepeat(poly->poly->texParams)) {
if (s < 0) {
s = 0;
@ -62,7 +62,7 @@ static color_t _lookupColor(struct DSGXSoftwareEndpoint* ep, struct DSGXSoftware
if (!DSGXTexParamsIsTRepeat(poly->poly->texParams)) {
if (t < 0) {
t = 0;
} else if (s >= poly->texH) {
} else if (t >= poly->texH) {
t = poly->texW - 1;
}
} else if (DSGXTexParamsIsTMirror(poly->poly->texParams)) {