[Scummvm-cvs-logs] SF.net SVN: scummvm:[35288] scummvm/trunk/engines/saga

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Dec 8 23:07:14 CET 2008


Revision: 35288
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35288&view=rev
Author:   thebluegr
Date:     2008-12-08 22:07:14 +0000 (Mon, 08 Dec 2008)

Log Message:
-----------
Some more dirty rectangle changes (still incomplete)

Modified Paths:
--------------
    scummvm/trunk/engines/saga/isomap.cpp
    scummvm/trunk/engines/saga/render.cpp
    scummvm/trunk/engines/saga/scene.cpp
    scummvm/trunk/engines/saga/sprite.cpp

Modified: scummvm/trunk/engines/saga/isomap.cpp
===================================================================
--- scummvm/trunk/engines/saga/isomap.cpp	2008-12-08 21:48:29 UTC (rev 35287)
+++ scummvm/trunk/engines/saga/isomap.cpp	2008-12-08 22:07:14 UTC (rev 35288)
@@ -882,7 +882,7 @@
 	int rectX = MAX<int>(drawPoint.x, 0);
 	int rectY = MAX<int>(drawPoint.y, 0);
 	int rectX2 = MIN<int>(drawPoint.x + SAGA_ISOTILE_WIDTH, _tileClip.right);
-	int rectY2 = MIN<int>(drawPoint.y + height, _tileClip.bottom);
+	int rectY2 = lowBound;
 	_vm->_render->addDirtyRect(Common::Rect(rectX, rectY, rectX2, rectY2));
 }
 

Modified: scummvm/trunk/engines/saga/render.cpp
===================================================================
--- scummvm/trunk/engines/saga/render.cpp	2008-12-08 21:48:29 UTC (rev 35287)
+++ scummvm/trunk/engines/saga/render.cpp	2008-12-08 22:07:14 UTC (rev 35288)
@@ -207,8 +207,8 @@
 	// Clip rectangle
 	int x1 = MAX<int>(rect.left, 0);
 	int y1 = MAX<int>(rect.top, 0);
-	int x2 = MIN<int>(rect.width(), _backGroundSurface.w);
-	int y2 = MIN<int>(rect.height(), _backGroundSurface.h);
+	int x2 = MIN<int>(rect.right, _backGroundSurface.w);
+	int y2 = MIN<int>(rect.bottom, _backGroundSurface.h);
 	if (x2 > x1 && y2 > y1) {
 		Common::Rect rectClipped(x1, y1, x2, y2);
 		// Check if the new rectangle is contained within another in the list
@@ -216,8 +216,11 @@
  		for (it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
 			if (it->contains(rectClipped))
 				return;
+			if (rectClipped.contains(*it)) {
+				_dirtyRects.erase(it);
+				break;	// we need to break now, as the list is changed
+			}
 		}
-
 		_dirtyRects.push_back(rectClipped);
 	}
 }
@@ -226,6 +229,7 @@
 	if (!_fullRefresh) {
  	 	Common::List<Common::Rect>::const_iterator it;
  	 	for (it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
+			//_backGroundSurface.frameRect(*it, 1);		// DEBUG
 			g_system->copyRectToScreen((byte *)_backGroundSurface.pixels, _backGroundSurface.w, it->left, it->top, it->width(), it->height());
 		}
 	}
@@ -236,6 +240,7 @@
 	if (!_fullRefresh) {
  	 	Common::List<Common::Rect>::const_iterator it;
  	 	for (it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
+			//_backGroundSurface.frameRect(*it, 2);		// DEBUG
 			g_system->copyRectToScreen(_vm->_gfx->getBackBufferPixels(), _backGroundSurface.w, it->left, it->top, it->width(), it->height());
 		}
 	} else {

Modified: scummvm/trunk/engines/saga/scene.cpp
===================================================================
--- scummvm/trunk/engines/saga/scene.cpp	2008-12-08 21:48:29 UTC (rev 35287)
+++ scummvm/trunk/engines/saga/scene.cpp	2008-12-08 22:07:14 UTC (rev 35288)
@@ -589,9 +589,6 @@
 	Event *q_event;
 	static PalEntry current_pal[PAL_ENTRIES];
 
-	// Since we are loading a new scene, do a full refresh
-	_vm->_render->setFullRefresh(true);
-
 	if (loadSceneParams->transitionType == kTransitionFade)
 		_vm->_interface->setFadeMode(kFadeOut);
 
@@ -1185,6 +1182,7 @@
 
 		_vm->_scene->getBGInfo(bgInfo);
 		_vm->_render->getBackGroundSurface()->blit(bgInfo.bounds, bgInfo.buffer);
+		_vm->_render->addDirtyRect(bgInfo.bounds);
 	} else {
 		_vm->_gfx->getBackBufferRect(rect);
 		_vm->_render->getBackGroundSurface()->blit(rect, (const byte *)_vm->_gfx->getBackBufferPixels());

Modified: scummvm/trunk/engines/saga/sprite.cpp
===================================================================
--- scummvm/trunk/engines/saga/sprite.cpp	2008-12-08 21:48:29 UTC (rev 35287)
+++ scummvm/trunk/engines/saga/sprite.cpp	2008-12-08 22:07:14 UTC (rev 35288)
@@ -253,7 +253,7 @@
 		srcRowPointer += width;
 	}
 
-	_vm->_render->addDirtyRect(Common::Rect(spritePointer.x, spritePointer.y, spritePointer.x + clipWidth, spritePointer.y + clipHeight));
+	_vm->_render->addDirtyRect(clipRect);
 }
 
 void Sprite::draw(const Rect &clipRect, SpriteList &spriteList, int32 spriteNumber, const Point &screenCoord, int scale) {
@@ -395,8 +395,7 @@
 		sourceRowPointer += width;
 	}
 
-	_vm->_render->addDirtyRect(Common::Rect(clipData.destPoint.x, clipData.destPoint.y, 
-								clipData.destPoint.x + clipData.drawWidth, clipData.destPoint.y + clipData.drawHeight));
+	_vm->_render->addDirtyRect(clipRect);
 }
 
 void Sprite::decodeRLEBuffer(const byte *inputBuffer, size_t inLength, size_t outLength) {


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