[Scummvm-cvs-logs] SF.net SVN: scummvm:[35267] scummvm/trunk/engines/saga
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Dec 7 01:27:39 CET 2008
Revision: 35267
http://scummvm.svn.sourceforge.net/scummvm/?rev=35267&view=rev
Author: thebluegr
Date: 2008-12-07 00:27:39 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
Some dirty rectangle related code
Modified Paths:
--------------
scummvm/trunk/engines/saga/objectmap.cpp
scummvm/trunk/engines/saga/render.cpp
scummvm/trunk/engines/saga/render.h
Modified: scummvm/trunk/engines/saga/objectmap.cpp
===================================================================
--- scummvm/trunk/engines/saga/objectmap.cpp 2008-12-07 00:19:50 UTC (rev 35266)
+++ scummvm/trunk/engines/saga/objectmap.cpp 2008-12-07 00:27:39 UTC (rev 35267)
@@ -171,6 +171,8 @@
} else {
if (pointsCount > 2) {
// Otherwise draw a polyline
+ // Do a full refresh so that the polyline can be shown
+ vm->_render->setFullRefresh(true);
vm->_gfx->drawPolyLine(points, pointsCount, color);
}
}
Modified: scummvm/trunk/engines/saga/render.cpp
===================================================================
--- scummvm/trunk/engines/saga/render.cpp 2008-12-07 00:19:50 UTC (rev 35266)
+++ scummvm/trunk/engines/saga/render.cpp 2008-12-07 00:27:39 UTC (rev 35267)
@@ -204,14 +204,22 @@
_system->updateScreen();
}
+void Render::addDirtyRect(Common::Rect rect) {
+ // Check if the new rectangle is contained within another in the list
+ Common::List<Common::Rect>::const_iterator it;
+ for (it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
+ if (it->contains(rect))
+ return;
+ }
+
+ _dirtyRects.push_back(rect);
+}
+
void Render::drawDirtyRects() {
if (_fullRefresh) {
_system->copyRectToScreen(_vm->_gfx->getBackBufferPixels(), _vm->_gfx->getBackBufferWidth(), 0, 0,
_vm->_gfx->getBackBufferWidth(), _vm->_gfx->getBackBufferHeight());
} else {
-
- // TODO: check if dirty rectangles are intersecting or contained within each other
-
Common::List<Common::Rect>::const_iterator it;
for (it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
g_system->copyRectToScreen(_vm->_gfx->getBackBufferPixels(), it->width(), it->left, it->top, it->width(), it->height());
Modified: scummvm/trunk/engines/saga/render.h
===================================================================
--- scummvm/trunk/engines/saga/render.h 2008-12-07 00:19:50 UTC (rev 35266)
+++ scummvm/trunk/engines/saga/render.h 2008-12-07 00:27:39 UTC (rev 35267)
@@ -79,9 +79,7 @@
return &_backGroundSurface;
}
- void addDirtyRect(Common::Rect rect) {
- _dirtyRects.push_back(rect);
- }
+ void addDirtyRect(Common::Rect rect);
void clearDirtyRects() {
_dirtyRects.clear();
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