mirror of https://github.com/mgba-emu/mgba.git
DS GX: Fix texture clipping issues
This commit is contained in:
parent
0c60619651
commit
80ff9596b9
|
@ -20,8 +20,8 @@ struct DSGXSoftwarePolygon {
|
||||||
uint16_t* texBase;
|
uint16_t* texBase;
|
||||||
uint16_t* palBase;
|
uint16_t* palBase;
|
||||||
int texFormat;
|
int texFormat;
|
||||||
unsigned texW;
|
int texW;
|
||||||
unsigned texH;
|
int texH;
|
||||||
int32_t topY;
|
int32_t topY;
|
||||||
int32_t bottomY;
|
int32_t bottomY;
|
||||||
int32_t topZ;
|
int32_t topZ;
|
||||||
|
|
|
@ -43,8 +43,8 @@ static color_t _lookupColor(struct DSGXSoftwareEndpoint* ep, struct DSGXSoftware
|
||||||
// TODO: Optimize
|
// TODO: Optimize
|
||||||
uint16_t texel;
|
uint16_t texel;
|
||||||
|
|
||||||
uint16_t s = ep->s >> 4;
|
int16_t s = ep->s >> 4;
|
||||||
uint16_t t = ep->t >> 4;
|
int16_t t = ep->t >> 4;
|
||||||
if (!DSGXTexParamsIsSRepeat(poly->poly->texParams)) {
|
if (!DSGXTexParamsIsSRepeat(poly->poly->texParams)) {
|
||||||
if (s < 0) {
|
if (s < 0) {
|
||||||
s = 0;
|
s = 0;
|
||||||
|
@ -62,7 +62,7 @@ static color_t _lookupColor(struct DSGXSoftwareEndpoint* ep, struct DSGXSoftware
|
||||||
if (!DSGXTexParamsIsTRepeat(poly->poly->texParams)) {
|
if (!DSGXTexParamsIsTRepeat(poly->poly->texParams)) {
|
||||||
if (t < 0) {
|
if (t < 0) {
|
||||||
t = 0;
|
t = 0;
|
||||||
} else if (s >= poly->texH) {
|
} else if (t >= poly->texH) {
|
||||||
t = poly->texW - 1;
|
t = poly->texW - 1;
|
||||||
}
|
}
|
||||||
} else if (DSGXTexParamsIsTMirror(poly->poly->texParams)) {
|
} else if (DSGXTexParamsIsTMirror(poly->poly->texParams)) {
|
||||||
|
|
Loading…
Reference in New Issue