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

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Jun 15 12:32:25 CEST 2010


Revision: 49745
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49745&view=rev
Author:   sev
Date:     2010-06-15 10:32:25 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
AGI: Implemented immediate update for most of gfx to match original.

This fixes many subtle effects as in many cases there were no
special pausing and engine relied only on the slowliness of the
machine.

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

Modified: scummvm/trunk/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_cmd.cpp	2010-06-15 10:32:01 UTC (rev 49744)
+++ scummvm/trunk/engines/agi/op_cmd.cpp	2010-06-15 10:32:25 UTC (rev 49745)
@@ -741,6 +741,7 @@
 	g_sprites->eraseBoth();
 	g_picture->decodePicture(_v[p0], true);
 	g_sprites->blitBoth();
+	g_sprites->commitBoth();
 	game.pictureShown = 0;
 	debugC(6, kDebugLevelScripts, "--- end of draw pic %d ---", _v[p0]);
 
@@ -778,6 +779,7 @@
 	g_sprites->eraseBoth();
 	g_agi->agiLoadResource(rPICTURE, _v[p0]);
 	g_sprites->blitBoth();
+	g_sprites->commitBoth();
 }
 
 cmd(discard_pic) {
@@ -869,7 +871,7 @@
 	g_sprites->blitUpdSprites();
 	vt.flags &= ~DONTUPDATE;
 
-	g_sprites->commitBlock(vt.xPos, vt.yPos - vt.ySize + 1, vt.xPos + vt.xSize - 1, vt.yPos);
+	g_sprites->commitBlock(vt.xPos, vt.yPos - vt.ySize + 1, vt.xPos + vt.xSize - 1, vt.yPos, true);
 
 	debugC(4, kDebugLevelScripts, "vt entry #%d flags = %02x", p0, vt.flags);
 }
@@ -896,7 +898,7 @@
 	y1 = MIN((int)MIN(vt.yPos, vt.yPos2), MIN(vt.yPos - vt.celData->height, vt.yPos2 - vt.celData2->height));
 	y2 = MAX((int)MAX(vt.yPos, vt.yPos2), MAX(vt.yPos - vt.celData->height, vt.yPos2 - vt.celData2->height));
 
-	g_sprites->commitBlock(x1, y1, x2, y2);
+	g_sprites->commitBlock(x1, y1, x2, y2, true);
 }
 
 cmd(position) {
@@ -1804,6 +1806,7 @@
 				}
 			} else {
 				_sprites->blitBoth();
+				_sprites->commitBoth();
 				do {
 					mainCycle();
 				} while (!_debug.steps && _debug.enabled);

Modified: scummvm/trunk/engines/agi/sprite.cpp
===================================================================
--- scummvm/trunk/engines/agi/sprite.cpp	2010-06-15 10:32:01 UTC (rev 49744)
+++ scummvm/trunk/engines/agi/sprite.cpp	2010-06-15 10:32:25 UTC (rev 49745)
@@ -391,7 +391,7 @@
  * Copy sprites from the pic buffer to the screen buffer, and check if
  * sprites of the given list have moved.
  */
-void SpritesMgr::commitSprites(SpriteList &l) {
+void SpritesMgr::commitSprites(SpriteList &l, bool immediate) {
 	SpriteList::iterator iter;
 	for (iter = l.begin(); iter != l.end(); ++iter) {
 		Sprite *s = *iter;
@@ -404,7 +404,7 @@
 
 		s->v->celData2 = s->v->celData;
 
-		commitBlock(x1, y1, x2, y2);
+		commitBlock(x1, y1, x2, y2, immediate);
 
 		if (s->v->stepTimeCount != s->v->stepTime)
 			continue;
@@ -458,11 +458,11 @@
  */
 
 void SpritesMgr::commitUpdSprites() {
-	commitSprites(_sprUpd);
+	commitSprites(_sprUpd, true);
 }
 
 void SpritesMgr::commitNonupdSprites() {
-	commitSprites(_sprNonupd);
+	commitSprites(_sprNonupd, true);
 }
 
 // check moves in both lists
@@ -651,7 +651,7 @@
 
 	blitBoth();
 
-	commitBlock(x1, y1, x2, y2);
+	commitBlock(x1, y1, x2, y2, true);
 }
 
 /**
@@ -682,15 +682,15 @@
 
 	objsSaveArea(&s);
 	blitCel(x1, y1, 15, c, _vm->_game.views[n].agi256_2);
-	commitBlock(x1, y1, x2, y2);
+	commitBlock(x1, y1, x2, y2, true);
 	_vm->messageBox(_vm->_game.views[n].descr);
 	objsRestoreArea(&s);
-	commitBlock(x1, y1, x2, y2);
+	commitBlock(x1, y1, x2, y2, true);
 
 	free(s.buffer);
 }
 
-void SpritesMgr::commitBlock(int x1, int y1, int x2, int y2) {
+void SpritesMgr::commitBlock(int x1, int y1, int x2, int y2, bool immediate) {
 	int i, w, offset;
 	uint8 *q;
 
@@ -714,6 +714,9 @@
 	}
 
 	_gfx->flushBlockA(x1, y1 + offset, x2, y2 + offset);
+
+	if (immediate)
+		_gfx->doUpdate();
 }
 
 SpritesMgr::SpritesMgr(AgiEngine *agi, GfxMgr *gfx) {

Modified: scummvm/trunk/engines/agi/sprite.h
===================================================================
--- scummvm/trunk/engines/agi/sprite.h	2010-06-15 10:32:01 UTC (rev 49744)
+++ scummvm/trunk/engines/agi/sprite.h	2010-06-15 10:32:25 UTC (rev 49745)
@@ -65,7 +65,7 @@
 	void buildUpdBlitlist();
 	void buildNonupdBlitlist();
 	void freeList(SpriteList &l);
-	void commitSprites(SpriteList &l);
+	void commitSprites(SpriteList &l, bool immediate = false);
 	void eraseSprites(SpriteList &l);
 	void blitSprites(SpriteList &l);
 	static bool testUpdating(VtEntry *v, AgiEngine *);
@@ -88,7 +88,7 @@
 	void commitBoth();
 	void addToPic(int, int, int, int, int, int, int);
 	void showObj(int);
-	void commitBlock(int, int, int, int);
+	void commitBlock(int x1, int y1, int x2, int y2, bool immediate = false);
 };
 
 } // End of namespace Agi

Modified: scummvm/trunk/engines/agi/view.cpp
===================================================================
--- scummvm/trunk/engines/agi/view.cpp	2010-06-15 10:32:01 UTC (rev 49744)
+++ scummvm/trunk/engines/agi/view.cpp	2010-06-15 10:32:25 UTC (rev 49745)
@@ -311,6 +311,7 @@
 
 		v->flags |= UPDATE;
 		_sprites->blitBoth();
+		_sprites->commitBoth();
 	}
 }
 
@@ -324,6 +325,7 @@
 
 		v->flags &= ~UPDATE;
 		_sprites->blitBoth();
+		_sprites->commitBoth();
 	}
 }
 


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