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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jan 7 19:02:54 CET 2007


Revision: 25047
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25047&view=rev
Author:   fingolfin
Date:     2007-01-07 10:02:54 -0800 (Sun, 07 Jan 2007)

Log Message:
-----------
Renamed amiga -> amigaMode and agds -> agdsMode; also some minor cleanup

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

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2007-01-07 13:00:54 UTC (rev 25046)
+++ scummvm/trunk/engines/agi/agi.cpp	2007-01-07 18:02:54 UTC (rev 25047)
@@ -377,8 +377,8 @@
 		break;
 	}
 
-	game.game_flags |= opt.amiga ? ID_AMIGA : 0;
-	game.game_flags |= opt.agds ? ID_AGDS : 0;
+	game.game_flags |= opt.amigaMode ? ID_AMIGA : 0;
+	game.game_flags |= opt.agdsMode ? ID_AGDS : 0;
 
 	if (game.game_flags & ID_AMIGA)
 		report("Amiga padded game detected.\n");
@@ -441,28 +441,19 @@
 int AgiEngine::agiDetectGame() {
 	int ec = err_OK;
 
-	assert(this->_gameDescription != NULL);
+	assert(_gameDescription != NULL);
 
-	if( (this->_gameDescription->features & AGI_AMIGA) == AGI_AMIGA)
-		opt.amiga = true;
+	opt.amigaMode = ((_gameDescription->features & AGI_AMIGA) == AGI_AMIGA);
+	opt.agdsMode = ((_gameDescription->features & AGI_AGDS) == AGI_AGDS);
+	opt.agimouse = ((_gameDescription->features & AGI_MOUSE) == AGI_MOUSE);
 
-	if( (this->_gameDescription->features & AGI_AGDS) == AGI_AGDS)
-		opt.agds = true;
 
-	if( (this->_gameDescription->features & AGI_MOUSE) == AGI_MOUSE)
-		opt.agimouse = true;
-
-
-	if(this->_gameDescription->version <= 0x2999)
-	{
+	if(_gameDescription->version <= 0x2999) {
 		loader = new AgiLoader_v2(this);
-		ec = loader->detect_game();
-	}
-	else
-	{
+	} else {
 		loader = new AgiLoader_v3(this);
-		ec = loader->detect_game();
 	}
+	ec = loader->detect_game();
 
 	return ec;
 }
@@ -680,6 +671,4 @@
 	return 0;
 }
 
-}                             // End of namespace Agi
-
-
+} // End of namespace Agi

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2007-01-07 13:00:54 UTC (rev 25046)
+++ scummvm/trunk/engines/agi/agi.h	2007-01-07 18:02:54 UTC (rev 25047)
@@ -201,12 +201,12 @@
 #define GAMERUN_CRC	5
 	int gamerun;		/**< game run mode*/
 	int emuversion;		/**< AGI version to emulate */
-	int agds;			/**< enable AGDS mode */
-	int amiga;			/**< enable Amiga mode */
-	int nosound;		/**< disable sound */
+	bool agdsMode;		/**< enable AGDS mode */
+	bool amigaMode;		/**< enable Amiga mode */
+	bool nosound;		/**< disable sound */
 	Common::RenderMode renderMode;
 	int soundemu;		/**< sound emulation mode */
-	int agimouse;		/**< AGI Mouse 1.0 emulation */
+	bool agimouse;		/**< AGI Mouse 1.0 emulation */
 };
 
 #define report printf

Modified: scummvm/trunk/engines/agi/global.cpp
===================================================================
--- scummvm/trunk/engines/agi/global.cpp	2007-01-07 13:00:54 UTC (rev 25046)
+++ scummvm/trunk/engines/agi/global.cpp	2007-01-07 18:02:54 UTC (rev 25047)
@@ -64,10 +64,11 @@
 	const uint8 *key;
 	int i;
 
-	key = opt.agds ? (const uint8 *)CRYPT_KEY_AGDS : (const uint8 *)CRYPT_KEY_SIERRA;
+	key = opt.agdsMode ? (const uint8 *)CRYPT_KEY_AGDS
+	                   : (const uint8 *)CRYPT_KEY_SIERRA;
 
 	for (i = 0; i < len; i++)
 		*(mem + i) ^= *(key + (i % 11));
 }
 
-}                             // End of namespace Agi
+} // End of namespace Agi

Modified: scummvm/trunk/engines/agi/id.cpp
===================================================================
--- scummvm/trunk/engines/agi/id.cpp	2007-01-07 13:00:54 UTC (rev 25046)
+++ scummvm/trunk/engines/agi/id.cpp	2007-01-07 18:02:54 UTC (rev 25047)
@@ -76,7 +76,7 @@
 	if (opt.emuversion)
 		agiSetRelease(opt.emuversion);
 
-	if (opt.agds)
+	if (opt.agdsMode)
 		agiSetRelease(0x2440);	/* ALL AGDS games built for 2.440 */
 
 	report("Seting up for version 0x%04X\n", ver);


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