[Scummvm-cvs-logs] SF.net SVN: scummvm: [26754] scummvm/trunk/engines/agi/view.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun May 6 01:54:29 CEST 2007


Revision: 26754
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26754&view=rev
Author:   thebluegr
Date:     2007-05-05 16:54:29 -0700 (Sat, 05 May 2007)

Log Message:
-----------
Fixed bug #1658643: AGI: SQ1 (2.2 DOS ENG) Graphic error, ego leaves behind copy
Also, removed one of the two workarounds for the KQ4 intro, as it's not needed

Modified Paths:
--------------
    scummvm/trunk/engines/agi/view.cpp

Modified: scummvm/trunk/engines/agi/view.cpp
===================================================================
--- scummvm/trunk/engines/agi/view.cpp	2007-05-05 16:10:12 UTC (rev 26753)
+++ scummvm/trunk/engines/agi/view.cpp	2007-05-05 23:54:29 UTC (rev 26754)
@@ -50,7 +50,6 @@
 	// in the KQ4 introduction
 	// It seems there's either a bug with KQ4's logic script 120 (the intro script)
 	// or flag 64 is not set correctly, which causes the erroneous behavior from the actors
-	// Check below in lSetLoop for the second part of this workaround
 	if (getFeatures() & GF_KQ4 && !(v->flags & UPDATE) && (v->currentView == 172))
 		return;
 
@@ -77,12 +76,6 @@
 	if (v->currentCel >= v->numCels)
 		v->currentCel = 0;
 
-	// WORKAROUND: This is the second part of the hack to fix the KQ4 introduction.
-	// Refer above to function lSetCel for the first part and an explanation
-	// FIXME: Remove this workaround
-	if (getFeatures() & GF_KQ4 && !(v->flags & UPDATE) && (v->currentView == 172))
-		return;
-
 	v->loopData = &_game.views[v->currentView].loop[n];
 }
 
@@ -282,6 +275,30 @@
  * @param n number of AGI view resource
  */
 void AgiEngine::setView(VtEntry *v, int n) {
+
+	uint16 viewFlags = 0;
+
+	// When setting a view to the view table, if there's already another view set in that
+	// view table entry and it's still drawn, erase the existing view before setting the new one
+	// Fixes bug #1658643: AGI: SQ1 (2.2 DOS ENG) Graphic error, ego leaves behind copy
+	if (v->viewData != NULL) {
+		if (v->currentView != n && v->flags & DRAWN) {
+			viewFlags = v->flags;			// Store the flags for the view
+			_sprites->eraseUpdSprites();
+			if (v->flags & UPDATE) {
+				v->flags &= ~DRAWN;
+			} else {
+				_sprites->eraseNonupdSprites();
+				v->flags &= ~DRAWN;
+				_sprites->blitNonupdSprites();
+			}
+			_sprites->blitUpdSprites();
+
+			_sprites->commitBlock(v->xPos, v->yPos - v->ySize + 1, v->xPos + v->xSize - 1, v->yPos);
+			v->flags = viewFlags;			// Restore the view's flags
+		}
+	}
+
 	v->viewData = &_game.views[n];
 	v->currentView = n;
 	v->numLoops = v->viewData->numLoops;


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