mirror of https://github.com/mgba-emu/mgba.git
DS GX: Simplify loop
This commit is contained in:
parent
e9debb197e
commit
58381cf00f
|
@ -426,31 +426,23 @@ static void DSGXSoftwareRendererDrawScanline(struct DSGXRenderer* renderer, int
|
||||||
span = DSGXSoftwareSpanListGetPointer(&softwareRenderer->activeSpans, nextSpanId - 1);
|
span = DSGXSoftwareSpanListGetPointer(&softwareRenderer->activeSpans, nextSpanId - 1);
|
||||||
nextSpanX = span->ep[0].x >> 12;
|
nextSpanX = span->ep[0].x >> 12;
|
||||||
}
|
}
|
||||||
if (i < nextSpanX) {
|
while (i > (span->ep[0].x >> 12)) {
|
||||||
span = NULL;
|
if (i <= (span->ep[1].x >> 12)) {
|
||||||
} else {
|
_lerpEndpoint(span, &ep, i);
|
||||||
struct DSGXSoftwareSpan* testSpan = DSGXSoftwareSpanListGetPointer(&softwareRenderer->activeSpans, nextSpanId - 1);
|
color_t color = _lookupColor(&ep, span->poly);
|
||||||
while (i > (testSpan->ep[0].x >> 12)) {
|
|
||||||
if (i <= (testSpan->ep[1].x >> 12)) {
|
|
||||||
_lerpEndpoint(testSpan, &ep, i);
|
|
||||||
color_t color = _lookupColor(&ep, testSpan->poly);
|
|
||||||
if (scanline[i] == FLAG_UNWRITTEN) {
|
if (scanline[i] == FLAG_UNWRITTEN) {
|
||||||
scanline[i] = color;
|
scanline[i] = color;
|
||||||
}
|
}
|
||||||
if (ep.w >= depth) {
|
if (ep.w >= depth && color != FLAG_UNWRITTEN) {
|
||||||
depth = ep.w;
|
depth = ep.w;
|
||||||
span = testSpan;
|
|
||||||
if (color != FLAG_UNWRITTEN) {
|
|
||||||
scanline[i] = color;
|
scanline[i] = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
--nextSpanId;
|
--nextSpanId;
|
||||||
if (!nextSpanId) {
|
if (!nextSpanId) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
testSpan = DSGXSoftwareSpanListGetPointer(&softwareRenderer->activeSpans, nextSpanId - 1);
|
span = DSGXSoftwareSpanListGetPointer(&softwareRenderer->activeSpans, nextSpanId - 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue