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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Sep 21 21:12:53 CEST 2007


Revision: 29007
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29007&view=rev
Author:   thebluegr
Date:     2007-09-21 12:12:53 -0700 (Fri, 21 Sep 2007)

Log Message:
-----------
Several bug fixes for Mickey's Space Adventure:
- Fixed a logic bug, where it was possible that the planets were not initialized properly when flipping XL30's switch without holding any crystal. Note that this breaks older Mickey saved games
- Fixed a bug with the initialization of the planet data, where the random number assigned to each planet could go out of logical bounds
- Save games are saved with the correct extension now (e.g. mickey.s01 instead of mickey.s 1)
- Some save game messages which were not shown are shown now
- Disabled two problematic objects (the scale in Mickey's house and the rock in Jupiter) so they are not shown for now, as our current picture showing algorithm crashes when trying to display them

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

Modified: scummvm/trunk/engines/agi/preagi_mickey.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.cpp	2007-09-21 18:50:53 UTC (rev 29006)
+++ scummvm/trunk/engines/agi/preagi_mickey.cpp	2007-09-21 19:12:53 UTC (rev 29007)
@@ -216,8 +216,8 @@
 
 	readExe(ofs, buffer, sizeof(buffer));
 	printStr((char *)buffer);
-	//_vm->_gfx->doUpdate();
-	//_vm->_system->updateScreen();	// TODO: this should go in the game's main loop
+	_vm->_gfx->doUpdate();
+	_vm->_system->updateScreen();	// TODO: this should go in the game's main loop
 }
 
 void Mickey::printExeMsg(int ofs) {
@@ -693,6 +693,14 @@
 	if (iObj == IDI_MSA_OBJECT_CRYSTAL)
 		_vm->_picture->setPictureFlags(kPicFStep);
 
+	// HACK: attempting to draw the scale in Mickey's house causes a crash, so we don't draw it
+	if (iObj == IDI_MSA_OBJECT_SCALE)
+		return;
+
+	// HACK: attempting to draw the rock in Jupiter causes a crash, so we don't draw it
+	if (iObj == IDI_MSA_OBJECT_ROCK_1 || iObj == IDI_MSA_OBJECT_ROCK_2 || iObj == IDI_MSA_OBJECT_ROCK_3)
+		return;
+	
 	_vm->_picture->setOffset(x0, y0);
 	_vm->_picture->decodePicture(buffer, size, false, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);
 	_vm->_picture->setOffset(0, 0);
@@ -958,7 +966,7 @@
 			return false;
 
 		// load game
-		sprintf(szFile, "%s.s%2d", _vm->getTargetName().c_str(), sel);
+		sprintf(szFile, "%s.s%02d", _vm->getTargetName().c_str(), sel);
 		if (!(infile = _vm->getSaveFileMan()->openForLoading(szFile))) {
 			printExeStr(IDO_MSA_CHECK_DISK_DRIVE);
 			if (_vm->getSelection(kSelAnyKey) == 0)
@@ -1004,7 +1012,7 @@
 			return;
 
 		// save game
-		sprintf(szFile, "%s.s%2d", _vm->getTargetName().c_str(), sel);
+		sprintf(szFile, "%s.s%02d", _vm->getTargetName().c_str(), sel);
 		if (!(outfile = _vm->getSaveFileMan()->openForSaving(szFile))) {
 			printExeStr(IDO_MSA_CHECK_DISK_DRIVE);
 			if (_vm->getSelection(kSelAnyKey) == 0)
@@ -1166,10 +1174,11 @@
 
 void Mickey::flipSwitch() {
 	if (game.fHasXtal || game.nXtals) {
-		if (!game.fStoryShown) {
+		if (!game.fStoryShown)
 			printStory();
+
+		if (!game.fPlanetsInitialized)
 			randomize();
-		}
 
 		// activate screen animation
 		game.fAnimXL30 = true;
@@ -1260,7 +1269,7 @@
 		} else {
 			done = false;
 			while (!done) {
-				iPlanet = _vm->rnd(IDI_MSA_MAX_PLANET);
+				iPlanet = _vm->rnd(IDI_MSA_MAX_PLANET - 2);	// Earth (planet 0) is excluded
 				done = true;
 				for (int j = 0; j < IDI_MSA_MAX_PLANET; j++) {
 					if (game.iPlanetXtal[j] == iPlanet) {
@@ -1273,14 +1282,11 @@
 
 		game.iPlanetXtal[i] = iPlanet;
 
-		done = false;
-		while (!done) {
-			iHint = _vm->rnd(5);
-			done = true;
-		}
-
+		iHint = _vm->rnd(5) - 1;	// clues are 0-4
 		game.iClue[i] = IDO_MSA_NEXT_PIECE[iPlanet][iHint];
 	}
+
+	game.fPlanetsInitialized = true;
 }
 
 void Mickey::flashScreen() {

Modified: scummvm/trunk/engines/agi/preagi_mickey.h
===================================================================
--- scummvm/trunk/engines/agi/preagi_mickey.h	2007-09-21 18:50:53 UTC (rev 29006)
+++ scummvm/trunk/engines/agi/preagi_mickey.h	2007-09-21 19:12:53 UTC (rev 29007)
@@ -708,6 +708,7 @@
 	bool fShipDoorOpen;
 	bool fFlying;
 	bool fStoryShown;
+	bool fPlanetsInitialized;
 	bool fTempleDoorOpen;
 
 	bool fItem[IDI_MSA_MAX_ITEM];


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