diff --git a/gameDetecter.cpp b/gameDetecter.cpp index dc998217fb7..4af61ae82c3 100644 --- a/gameDetecter.cpp +++ b/gameDetecter.cpp @@ -191,6 +191,7 @@ bool GameDetecter::detectGame() { do { if (!scumm_stricmp(_exe_name, gnl->filename)) { _gameId = gnl->id; + _scummVersion = gnl->major; // _majorScummVersion = gnl->major; // _middleScummVersion = gnl->middle; // _minorScummVersion = gnl->minor; diff --git a/gameDetecter.h b/gameDetecter.h index 0441d8e1b7e..613ae4c371a 100644 --- a/gameDetecter.h +++ b/gameDetecter.h @@ -21,4 +21,6 @@ public: uint32 _features; uint16 _soundCardType; + int _scummVersion; + }; diff --git a/scumm.h b/scumm.h index a595c69c234..350e7c335b9 100644 --- a/scumm.h +++ b/scumm.h @@ -1664,17 +1664,28 @@ public: void launch(); }; -class Scumm_v7 : public Scumm -{ -public: -}; - class Scumm_v3 : public Scumm { public: void readIndexFile(); }; +class Scumm_v4 : public Scumm_v3 +{ +}; + +class Scumm_v5 : public Scumm +{ +}; + +class Scumm_v6 : public Scumm +{ +}; + +class Scumm_v7 : public Scumm +{ +}; + struct ScummDebugger { Scumm *_s; byte _command; diff --git a/sdl.cpp b/sdl.cpp index 6ec574b6643..a05d024a896 100644 --- a/sdl.cpp +++ b/sdl.cpp @@ -925,15 +925,28 @@ int main(int argc, char* argv[]) { if(detecter.detectMain(argc, argv)) return(-1); - if( detecter._features & GF_AFTER_V7 ) // not final implementation. This is just a test - scumm = new Scumm_v7; - else - if( detecter._features & GF_OLD256 ) - scumm = new Scumm_v3; - - else - scumm = new Scumm; - + switch(detecter._scummVersion) + { + case 3: + scumm = new Scumm_v3; + break; + case 4: + scumm = new Scumm_v4; + break; + case 5: + scumm = new Scumm_v5; + break; + case 6: + scumm = new Scumm_v6; + break; + case 7: + scumm = new Scumm_v7; + break; + default: // do we really need a default ? + scumm = new Scumm; + break; + } + /* All those stuff should be moved to the constructor.... */ for (i=0;i<17;i++)