diff options
-rw-r--r-- | engines/agi/agi.cpp | 31 | ||||
-rw-r--r-- | engines/agi/agi.h | 8 | ||||
-rw-r--r-- | engines/agi/global.cpp | 5 | ||||
-rw-r--r-- | engines/agi/id.cpp | 2 |
4 files changed, 18 insertions, 28 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 481d3c292c..db7e17d9ca 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -377,8 +377,8 @@ int AgiEngine::agiInit() { 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::agiDeinit() { 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 @@ int AgiEngine::go() { return 0; } -} // End of namespace Agi - - +} // End of namespace Agi diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 1c6352d2b8..4c674e0ba1 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -201,12 +201,12 @@ struct agi_options { #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 diff --git a/engines/agi/global.cpp b/engines/agi/global.cpp index 8a0d999a2e..7c9d0c849c 100644 --- a/engines/agi/global.cpp +++ b/engines/agi/global.cpp @@ -64,10 +64,11 @@ void AgiEngine::decrypt(uint8 *mem, int len) { 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 diff --git a/engines/agi/id.cpp b/engines/agi/id.cpp index 22fced68b0..3a1f9ea449 100644 --- a/engines/agi/id.cpp +++ b/engines/agi/id.cpp @@ -76,7 +76,7 @@ int AgiEngine::setup_v2_game(int ver, uint32 crc) { 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); |