mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
AGI: Refactor away agiDetectGame
This commit is contained in:
parent
2ae4cb8acb
commit
c5995d64e7
@ -437,17 +437,23 @@ void AgiEngine::initialize() {
|
||||
|
||||
_game.name[0] = '\0';
|
||||
|
||||
debugC(2, kDebugLevelMain, "Detect game");
|
||||
if (getVersion() <= 0x2001) {
|
||||
_loader = new AgiLoader_v1(this);
|
||||
} else if (getVersion() <= 0x2999) {
|
||||
_loader = new AgiLoader_v2(this);
|
||||
} else {
|
||||
_loader = new AgiLoader_v3(this);
|
||||
}
|
||||
|
||||
if (agiDetectGame() == errOK) {
|
||||
debugC(2, kDebugLevelMain, "Detect game");
|
||||
int ec = _loader->detectGame();
|
||||
if (ec == errOK) {
|
||||
debugC(2, kDebugLevelMain, "game loaded");
|
||||
} else {
|
||||
warning("Could not open AGI game");
|
||||
}
|
||||
// finally set up actual VM opcodes, because we should now have figured out the right AGI version
|
||||
setupOpCodes(getVersion());
|
||||
|
||||
debugC(2, kDebugLevelMain, "Init sound");
|
||||
}
|
||||
|
||||
bool AgiEngine::promptIsEnabled() {
|
||||
|
@ -873,7 +873,6 @@ public:
|
||||
|
||||
int agiInit();
|
||||
void agiDeinit();
|
||||
int agiDetectGame();
|
||||
int agiLoadResource(int16 resourceType, int16 resourceNr);
|
||||
void agiUnloadResource(int16 resourceType, int16 resourceNr);
|
||||
void agiUnloadResources();
|
||||
|
@ -435,21 +435,4 @@ bool AgiBase::canSaveGameStateCurrently(Common::U32String *msg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int AgiEngine::agiDetectGame() {
|
||||
int ec = errOK;
|
||||
|
||||
assert(_gameDescription != nullptr);
|
||||
|
||||
if (getVersion() <= 0x2001) {
|
||||
_loader = new AgiLoader_v1(this);
|
||||
} else if (getVersion() <= 0x2999) {
|
||||
_loader = new AgiLoader_v2(this);
|
||||
} else {
|
||||
_loader = new AgiLoader_v3(this);
|
||||
}
|
||||
ec = _loader->detectGame();
|
||||
|
||||
return ec;
|
||||
}
|
||||
|
||||
} // End of namespace Agi
|
||||
|
Loading…
Reference in New Issue
Block a user