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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Sep 21 10:41:27 CEST 2007


Revision: 29003
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29003&view=rev
Author:   thebluegr
Date:     2007-09-21 01:41:27 -0700 (Fri, 21 Sep 2007)

Log Message:
-----------
The animation of the crystals in Mickey is shown correctly now

Modified Paths:
--------------
    scummvm/trunk/engines/agi/picture.cpp
    scummvm/trunk/engines/agi/picture.h

Modified: scummvm/trunk/engines/agi/picture.cpp
===================================================================
--- scummvm/trunk/engines/agi/picture.cpp	2007-09-21 07:54:43 UTC (rev 29002)
+++ scummvm/trunk/engines/agi/picture.cpp	2007-09-21 08:41:27 UTC (rev 29003)
@@ -44,6 +44,7 @@
 	_pictureVersion = AGIPIC_V2;
 	_minCommand = 0xf0;
 	_flags = 0;
+	_currentStep = 0;
 }
 
 void PictureMgr::putVirtPixel(int x, int y) {
@@ -577,6 +578,7 @@
 void PictureMgr::drawPicture() {
 	uint8 act;
 	int drawing;
+	int iteration = 0;
 
 	_patCode = 0;
 	_patNum = 0;
@@ -749,21 +751,27 @@
 		default:
 			warning("Unknown picture opcode (%x) at (%x)", act, _foffs - 1);
 		}
-		if ((_flags & kPicFStep) && _vm->getGameType() == GType_PreAGI) {
-			// FIXME: This is used by Mickey for the crystal animation, but
-			// currently it's very very very slow
-			/*
+
+		// This is used by Mickey for the crystal animation
+		// One frame of the crystal animation is shown on each iteration, based on _currentStep
+		if ((_flags & kPicFStep) && _vm->getGameType() == GType_PreAGI && _currentStep == iteration) {
 			int storedXOffset = _xOffset;
 			int storedYOffset = _yOffset;
-			// FIXME: picture coordinates are correct for Mickey only
+			// Note that picture coordinates are correct for Mickey only
 			showPic(10, 0, _width, _height);
 			_gfx->doUpdate();
 			g_system->updateScreen();
 			_xOffset = storedXOffset;
 			_yOffset = storedYOffset;
-			g_system->delayMillis(25);
-			*/
+			_currentStep++;
+			if (_currentStep > 14)	// crystal animation is 15 frames
+				_currentStep = 0;
+			// reset the picture step flag - it will be set when the next frame of the crystal animation is drawn
+			_flags &= ~kPicFStep;
+			return;		// return back to the game loop
 		}
+
+		iteration++;
 	}
 }
 

Modified: scummvm/trunk/engines/agi/picture.h
===================================================================
--- scummvm/trunk/engines/agi/picture.h	2007-09-21 07:54:43 UTC (rev 29002)
+++ scummvm/trunk/engines/agi/picture.h	2007-09-21 08:41:27 UTC (rev 29003)
@@ -139,6 +139,7 @@
 	int _xOffset, _yOffset;
 
 	int _flags;
+	int _currentStep;
 };
 
 } // End of namespace Agi


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