diff -r 4049803a71c9 src/gfx.cpp --- a/src/gfx.cpp Fri Mar 09 18:45:07 2012 +0000 +++ b/src/gfx.cpp Tue Mar 13 12:43:13 2012 -0600 @@ -1712,6 +1712,7 @@ * * @see SetDirtyBlocks */ +extern uint dirtyblock_colour; void DrawDirtyBlocks() { byte *b = _dirty_blocks; @@ -1801,6 +1802,7 @@ } while (b++, (x += DIRTY_BLOCK_WIDTH) != w); } while (b += -(int)(w / DIRTY_BLOCK_WIDTH) + _dirty_bytes_per_line, (y += DIRTY_BLOCK_HEIGHT) != h); + ++dirtyblock_colour; _invalid_rect.left = w; _invalid_rect.top = h; _invalid_rect.right = 0; diff -r 4049803a71c9 src/viewport.cpp --- a/src/viewport.cpp Fri Mar 09 18:45:07 2012 +0000 +++ b/src/viewport.cpp Tue Mar 13 12:43:13 2012 -0600 @@ -1344,6 +1344,10 @@ * Draws the bounding boxes of all ParentSprites * @param psd Array of ParentSprites */ +#include "table/palettes.h" +static void ViewportDrawDirtyBoxes(); +uint dirtyblock_colour = 0; + static void ViewportDrawBoundingBoxes(const ParentSpriteToSortVector *psd) { const ParentSpriteToDraw * const *psd_end = psd->End(); @@ -1361,6 +1365,26 @@ } } +static void ViewportDrawDirtyBoxes() +{ + Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); + const DrawPixelInfo *dpi = _cur_dpi; + void *dst; + int right = dpi->width >> dpi->zoom; + int bottom = dpi->height >> dpi->zoom; + + dirtyblock_colour %= 16; + int colour = _string_colourmap[dirtyblock_colour]; + + dst = dpi->dst_ptr; + + byte bo = ((dpi->left + dpi->top) >> dpi->zoom) & 1; + do { + for (int i = (bo ^= 1); i < right; i += 2) blitter->SetPixel(dst, i, 0, (uint8)colour); + dst = blitter->MoveTo(dst, 0, 1); + } while (--bottom > 0); +} + static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDrawVector *sstdv) { DrawPixelInfo dp; @@ -1457,6 +1481,7 @@ ViewportDrawParentSprites(&_vd.parent_sprites_to_sort, &_vd.child_screen_sprites_to_draw); if (_draw_bounding_boxes) ViewportDrawBoundingBoxes(&_vd.parent_sprites_to_sort); + if (_draw_bounding_boxes) ViewportDrawDirtyBoxes(); if (_vd.string_sprites_to_draw.Length() != 0) ViewportDrawStrings(&_vd.dpi, &_vd.string_sprites_to_draw);