GBA Video: Slight optimizations
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Feb 2016 02:38:44 -0800
2 files changed,
11 insertions(+),
3 deletions(-)
M
src/gba/renderers/software-bg.c
→
src/gba/renderers/software-bg.c
@@ -41,10 +41,12 @@ for (outX = renderer->start, pixel = &renderer->row[outX]; outX < renderer->end; ++outX, ++pixel) { \
x += background->dx; \ y += background->dy; \ \ - MOSAIC(COORD) \ - \ uint32_t current = *pixel; \ - if (pixelData && IS_WRITABLE(current)) { \ + if (!IS_WRITABLE(current)) { \ + continue; \ + } \ + MOSAIC(COORD) \ + if (pixelData) { \ COMPOSITE_256_ ## OBJWIN (BLEND); \ } \ }
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -517,6 +517,12 @@ } else {
backdrop |= softwareRenderer->variantPalette[0]; } int end = softwareRenderer->windows[w].endX; + for (; x < end - 3; x += 4) { + softwareRenderer->row[x] = backdrop; + softwareRenderer->row[x + 1] = backdrop; + softwareRenderer->row[x + 2] = backdrop; + softwareRenderer->row[x + 3] = backdrop; + } for (; x < end; ++x) { softwareRenderer->row[x] = backdrop; }