[Scummvm-cvs-logs] SF.net SVN: scummvm:[45595] scummvm/trunk/engines/draci/game.cpp

spalek at users.sourceforge.net spalek at users.sourceforge.net
Sun Nov 1 11:15:48 CET 2009


Revision: 45595
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45595&view=rev
Author:   spalek
Date:     2009-11-01 10:15:48 +0000 (Sun, 01 Nov 2009)

Log Message:
-----------
Fix mistakenly ordered flushing revealed by the last commit

Modified Paths:
--------------
    scummvm/trunk/engines/draci/game.cpp

Modified: scummvm/trunk/engines/draci/game.cpp
===================================================================
--- scummvm/trunk/engines/draci/game.cpp	2009-11-01 10:03:37 UTC (rev 45594)
+++ scummvm/trunk/engines/draci/game.cpp	2009-11-01 10:15:48 UTC (rev 45595)
@@ -195,7 +195,7 @@
 	Text *speech = new Text("", _vm->_bigFont, kFontColour1, 0, 0, 0);
 	speechAnim->addFrame(speech, NULL);
 
-	// Initialize inventory animation
+	// Initialize inventory animation.  _iconsArchive is never flushed.
 	const BAFile *f = _vm->_iconsArchive->getFile(13);
 	Animation *inventoryAnim = _vm->_anims->addAnimation(kInventorySprite, 255, false);
 	Sprite *inventorySprite = new Sprite(f->_data, f->_length, 0, 0, true);
@@ -669,6 +669,7 @@
 	Animation *anim = _vm->_anims->getAnimation(anim_id);
 	if (!anim) {
 		anim = _vm->_anims->addItem(anim_id, false);
+		// _itemImagesArchive is never flushed.
 		const BAFile *img = _vm->_itemImagesArchive->getFile(2 * itemID);
 		Sprite *sp = new Sprite(img->_data, img->_length, 0, 0, true);
 		anim->addFrame(sp, NULL);
@@ -1129,8 +1130,9 @@
 		uint freq = animationReader.readUint16LE();
 		uint delay = animationReader.readUint16LE();
 
+		// _spritesArchive is flushed when entering a room.  All
+		// scripts in a room are responsible for loading their animations.
 		const BAFile *spriteFile = _vm->_spritesArchive->getFile(spriteNum);
-
 		Sprite *sp = new Sprite(spriteFile->_data, spriteFile->_length, x, y, true);
 
 		// Some frames set the scaled dimensions to 0 even though other frames
@@ -1219,6 +1221,8 @@
 		y = overlayReader.readUint16LE();
 		z = overlayReader.readByte();
 
+		// _overlaysArchive is flushed when entering a room and this
+		// code is called after the flushing has been done.
 		const BAFile *overlayFile;
 		overlayFile = _vm->_overlaysArchive->getFile(num);
 		Sprite *sp = new Sprite(overlayFile->_data, overlayFile->_length, x, y, true);
@@ -1226,8 +1230,6 @@
 		_vm->_anims->addOverlay(sp, z);
 	}
 
-	_vm->_overlaysArchive->clearCache();
-
 	_vm->_screen->getSurface()->markDirty();
 }
 
@@ -1274,6 +1276,7 @@
 	_vm->_walkingMapsArchive->clearCache();
 	_vm->_soundsArchive->clearCache();
 	_vm->_dubbingArchive->clearCache();
+	_vm->_overlaysArchive->clearCache();
 
 	_vm->_screen->clearScreen();
 


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