all repos — mgba @ 17ccb35c33c80580d0e2043413bd045e4d201ab1

mGBA Game Boy Advance Emulator

Small, trivial optimizations in GBAVideoSoftwareRendererDrawScanline
Jeffrey Pfau jeffrey@endrift.com
Thu, 24 Oct 2013 00:54:51 -0700
commit

17ccb35c33c80580d0e2043413bd045e4d201ab1

parent

6eafbc6331623f3c246f7ce6b5fef4c7e6189794

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -372,7 +372,8 @@ backdrop |= softwareRenderer->normalPalette[0];

} else { backdrop |= softwareRenderer->variantPalette[0]; } - for (; x < softwareRenderer->windows[w].endX; ++x) { + int end = softwareRenderer->windows[w].endX; + for (; x < end; ++x) { softwareRenderer->row[x] = backdrop; } }

@@ -388,7 +389,8 @@ backdrop |= softwareRenderer->normalPalette[0];

} else { backdrop |= softwareRenderer->variantPalette[0]; } - for (; x < softwareRenderer->windows[w].endX; ++x) { + int end = softwareRenderer->windows[w].endX; + for (; x < end; ++x) { uint32_t color = softwareRenderer->row[x]; if (color & FLAG_TARGET_1 && !(color & FLAG_FINALIZED)) { softwareRenderer->row[x] = _mix(softwareRenderer->bldb, backdrop, softwareRenderer->blda, color);