diff options
author | Oliver Kiehl | 2003-04-07 20:44:52 +0000 |
---|---|---|
committer | Oliver Kiehl | 2003-04-07 20:44:52 +0000 |
commit | 17f53e4c1c73b193345bad68255dbe7e0a2e5ce8 (patch) | |
tree | b696c63bdfbc0fa6ff48a92dc61ddc2b808ef8cb /sky/sky.cpp | |
parent | 6fc83fa9057a8f4cbb537662433c5b6039c99b67 (diff) | |
download | scummvm-rg350-17f53e4c1c73b193345bad68255dbe7e0a2e5ce8.tar.gz scummvm-rg350-17f53e4c1c73b193345bad68255dbe7e0a2e5ce8.tar.bz2 scummvm-rg350-17f53e4c1c73b193345bad68255dbe7e0a2e5ce8.zip |
restructure
svn-id: r6934
Diffstat (limited to 'sky/sky.cpp')
-rw-r--r-- | sky/sky.cpp | 67 |
1 files changed, 62 insertions, 5 deletions
diff --git a/sky/sky.cpp b/sky/sky.cpp index 3c12425995..a7eabc49fc 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -83,7 +83,7 @@ void SkyState::go() { _dump_file = stdout; initialise(); - if (!_isDemo || _isCDVersion) + if (!isDemo(_gameVersion) || isCDVersion(_gameVersion)) intro(); while (1) { @@ -99,8 +99,9 @@ void SkyState::initialise(void) { _sound = new SkySound(_mixer); - initialiseDisk(); - setupVersionSpecifics(_gameVersion); //_gameVersion is initialised in initialiseDisk(); + _skyDisk = new SkyDisk(_gameDataPath); + _gameVersion = _skyDisk->determineGameVersion(); + initialiseScreen(); initVirgin(); //initMouse(); @@ -108,7 +109,7 @@ void SkyState::initialise(void) { //initScript(); initialiseGrids(); //initialiseRouter(); - initialiseText(); + _skyText = getSkyText(); } void SkyState::initItemList() { @@ -123,7 +124,7 @@ void SkyState::initItemList() { _itemList[119] = (void*)data_0; // Compacts - Section 0 _itemList[120] = (void*)data_1; // Compacts - Section 1 - if (_isDemo) { + if (isDemo(_gameVersion)) { _itemList[121] = _itemList[122] = _itemList[123] = _itemList[124] = _itemList[125] = (void*)data_0; } else { _itemList[121] = (void*)data_2; // Compacts - Section 2 @@ -188,3 +189,59 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp } while (cur < start + amount); } +SkyText *SkyState::getSkyText() { + + switch (_gameVersion) { + case 267: + //floppy demo + return new SkyText_v00267(_skyDisk, _gameVersion); + case 288: + //floppy - old version + return new SkyText_v00288(_skyDisk, _gameVersion); + //case 331: + //floppy - new version + //return new SkyText_v00331(_skyDisk, _gameVersion); + case 365: + //cd demo, uses a slightly modified version of v00368 + case 368: + //cd version + return new SkyText_v00368(_skyDisk, _gameVersion); + default: + error("Unknown game version!"); + } +} + +bool SkyState::isDemo(uint32 version) { + switch (version) { + case 267: + return true; + case 288: + return false; + case 331: + return false; + case 365: + return true; + case 368: + return false; + default: + error("Unknown game version!"); + } +} + +bool SkyState::isCDVersion(uint32 version) { + switch (version) { + case 267: + return false; + case 288: + return false; + case 331: + return false; + case 365: + return true; + case 368: + return true; + default: + error("Unknown game version!"); + } +} + |