diff options
author | Vicent Marti | 2008-07-22 12:07:03 +0000 |
---|---|---|
committer | Vicent Marti | 2008-07-22 12:07:03 +0000 |
commit | 1558fdb9186fd131d40a92b83c38d5dd76a3b353 (patch) | |
tree | 398685d9b0097e5b064488b8ce29d1649e648136 | |
parent | 7f3b60e2dae633dc08db7b99b5c27101e1712ae4 (diff) | |
download | scummvm-rg350-1558fdb9186fd131d40a92b83c38d5dd76a3b353.tar.gz scummvm-rg350-1558fdb9186fd131d40a92b83c38d5dd76a3b353.tar.bz2 scummvm-rg350-1558fdb9186fd131d40a92b83c38d5dd76a3b353.zip |
Bugfix: Segmentation fault when removing unused dirty rects.
svn-id: r33195
-rw-r--r-- | gui/ThemeRenderer.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/gui/ThemeRenderer.cpp b/gui/ThemeRenderer.cpp index c434a4a38b..2fb0f955ac 100644 --- a/gui/ThemeRenderer.cpp +++ b/gui/ThemeRenderer.cpp @@ -589,31 +589,17 @@ void ThemeRenderer::updateScreen() { void ThemeRenderer::renderDirtyScreen() { if (_dirtyScreen.empty()) return; - + Common::List<Common::Rect>::iterator cur; for (Common::List<Common::Rect>::iterator d = _dirtyScreen.begin(); d != _dirtyScreen.end(); ++d) { - cur = d; + cur = d++; + do { - ++d; if (cur->intersects(*d)) - _dirtyScreen.erase(d); + d = _dirtyScreen.erase(d); + else ++d; } while (d != _dirtyScreen.end()); - - - // FIXME: this square-merging algorithm can be rather slow, and I don't think it - // benefits us *that* much. Maybe we should just stick to finding dirty squares that overlap. - - // d = cur; - // - // do { - // ++d; - // if ((cur->top == d->top && cur->bottom == d->bottom && (ABS(cur->left - d->right) < 10 || ABS(cur->right - d->left) < 10)) || - // (cur->left == d->left && cur->right == d->right && (ABS(cur->top - d->bottom) < 10 || ABS(cur->bottom - d->top) < 10))) { - // cur->extend(*d); - // _dirtyScreen.erase(d); - // } - // } while (d != _dirtyScreen.end()); - + d = cur; _vectorRenderer->copyFrame(_system, *d); } |