Fix mosiac on edges of mode 0 regions
Jeffrey Pfau jeffrey@endrift.com
Thu, 24 Jul 2014 01:13:14 -0700
1 files changed,
12 insertions(+),
11 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -1094,6 +1094,17 @@ } \
} #define DRAW_BACKGROUND_MODE_0(BPP, BLEND, OBJWIN) \ + uint32_t* pixel = &renderer->row[outX]; \ + if (background->mosaic && renderer->mosaic.bgH) { \ + int mosaicH = renderer->mosaic.bgH + 1; \ + int x; \ + int mosaicWait = outX % mosaicH; \ + int carryData = 0; \ + paletteData = 0; /* Quiets compiler warning */ \ + DRAW_BACKGROUND_MODE_0_MOSAIC_ ## BPP (BLEND, OBJWIN) \ + return; \ + } \ + \ if (inX & 0x7) { \ int mod8 = inX & 0x7; \ BACKGROUND_TEXT_SELECT_CHARACTER; \@@ -1119,17 +1130,7 @@ tileX = (inX & 0x7) != 0; \
outX = renderer->start + tileX * 8 - (inX & 0x7); \ } \ \ - uint32_t* pixel = &renderer->row[outX]; \ - if (background->mosaic && renderer->mosaic.bgH) { \ - int mosaicH = renderer->mosaic.bgH + 1; \ - int x; \ - int mosaicWait = outX % mosaicH; \ - int carryData = 0; \ - paletteData = 0; /* Quiets compiler warning */ \ - DRAW_BACKGROUND_MODE_0_MOSAIC_ ## BPP (BLEND, OBJWIN) \ - return; \ - } \ - \ + pixel = &renderer->row[outX]; \ DRAW_BACKGROUND_MODE_0_TILES_ ## BPP (BLEND, OBJWIN) static void _drawBackgroundMode0(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int y) {