[Scummvm-cvs-logs] SF.net SVN: scummvm:[33195] scummvm/branches/gsoc2008-gui/gui/ThemeRenderer .cpp
Tanoku at users.sourceforge.net
Tanoku at users.sourceforge.net
Tue Jul 22 14:07:04 CEST 2008
Revision: 33195
http://scummvm.svn.sourceforge.net/scummvm/?rev=33195&view=rev
Author: Tanoku
Date: 2008-07-22 12:07:03 +0000 (Tue, 22 Jul 2008)
Log Message:
-----------
Bugfix: Segmentation fault when removing unused dirty rects.
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-07-22 10:17:27 UTC (rev 33194)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-07-22 12:07:03 UTC (rev 33195)
@@ -589,31 +589,17 @@
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);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list