diff options
author | Gregory Montoir | 2009-01-24 21:03:44 +0000 |
---|---|---|
committer | Gregory Montoir | 2009-01-24 21:03:44 +0000 |
commit | e5feb689dfa8afc3d6af3ae6e66343cfc61b855c (patch) | |
tree | 71a2936bd7ca5526c0652bd4522771ae38e51039 /engines/tucker | |
parent | 454610ff5ac5d7cc4760e63ff2d96c09208148b0 (diff) | |
download | scummvm-rg350-e5feb689dfa8afc3d6af3ae6e66343cfc61b855c.tar.gz scummvm-rg350-e5feb689dfa8afc3d6af3ae6e66343cfc61b855c.tar.bz2 scummvm-rg350-e5feb689dfa8afc3d6af3ae6e66343cfc61b855c.zip |
added detection entry for playable demo and some code differences
svn-id: r36044
Diffstat (limited to 'engines/tucker')
-rw-r--r-- | engines/tucker/detection.cpp | 12 | ||||
-rw-r--r-- | engines/tucker/resource.cpp | 39 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 12 | ||||
-rw-r--r-- | engines/tucker/tucker.h | 6 |
4 files changed, 48 insertions, 21 deletions
diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index f54342a516..57357ff504 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -87,6 +87,14 @@ static const Common::ADGameDescription tuckerGameDescriptions[] = { Common::kPlatformPC, Tucker::kGameFlagEncodedData }, + { + "tucker", + "Demo", + AD_ENTRY1s("infobar.txt", "010b055de42097b140d5bcb6e95a5c7c", 203), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_DEMO | Tucker::kGameFlagDemo, + }, AD_TABLE_END_MARKER }; @@ -103,11 +111,11 @@ static const Common::ADParams detectionParams = { static const Common::ADGameDescription tuckerDemoGameDescription = { "tucker", - "Demo", + "Non-Interactive Demo", AD_ENTRY1(0, 0), Common::EN_ANY, Common::kPlatformPC, - Common::ADGF_DEMO | Tucker::kGameFlagDemo + Common::ADGF_DEMO | Tucker::kGameFlagDemo | Tucker::kGameFlagIntroOnly }; class TuckerMetaEngine : public Common::AdvancedMetaEngine { diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index 178b6fb793..d36024393c 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -342,7 +342,11 @@ void TuckerEngine::loadBudSpr(int startOffset) { char filename[40]; switch (_flagsTable[137]) { case 0: - sprintf(filename, "bud_%d.pcx", frame + 1); + if ((_gameFlags & kGameFlagDemo) != 0) { + sprintf(filename, "budl00_%d.pcx", frame + 1); + } else { + sprintf(filename, "bud_%d.pcx", frame + 1); + } break; case 1: sprintf(filename, "peg_%d.pcx", frame + 1); @@ -411,7 +415,8 @@ void TuckerEngine::loadCTable02(int fl) { } int start = 0; _spriteAnimationsTable[entry].firstFrameIndex = i; - while (start != 999) { + // 9999 is also used as the end marker in the demo version + while (start != 999 && start != 9999) { start = t.getNextInteger(); _spriteAnimationFramesTable[i] = start; ++i; @@ -447,7 +452,7 @@ void TuckerEngine::loadLoc() { copyLocBitmap(filename, 0, false); Graphics::copyRect(_quadBackgroundGfxBuf + 89600, 320, _locationBackgroundGfxBuf, 640, 320, 140); } - if (_locationNum == 1) { + if ((_gameFlags & kGameFlagDemo) == 0 && _locationNum == 1) { _loadLocBufPtr = _quadBackgroundGfxBuf + 89600; loadImage("rochpath.pcx", _loadLocBufPtr, 0); } @@ -477,7 +482,9 @@ void TuckerEngine::loadObj() { return; } debug(2, "loadObj() partNum %d locationNum %d", _partNum, _locationNum); - handleNewPartSequence(); + if ((_gameFlags & kGameFlagDemo) == 0) { + handleNewPartSequence(); + } _currentPartNum = _partNum; char filename[40]; @@ -651,16 +658,20 @@ void TuckerEngine::loadData4() { void TuckerEngine::loadActionFile() { char filename[40]; - switch (_partNum) { - case 1: - strcpy(filename, "action1.c"); - break; - case 2: - strcpy(filename, "action2.c"); - break; - default: - strcpy(filename, "action3.c"); - break; + if ((_gameFlags & kGameFlagDemo) != 0) { + strcpy(filename, "action.c"); + } else { + switch (_partNum) { + case 1: + strcpy(filename, "action1.c"); + break; + case 2: + strcpy(filename, "action2.c"); + break; + default: + strcpy(filename, "action3.c"); + break; + } } loadFile(filename, _loadTempBuf); diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index 84b430f7bd..2d17417b78 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -60,7 +60,7 @@ bool TuckerEngine::hasFeature(EngineFeature f) const { Common::Error TuckerEngine::go() { handleIntroSequence(); - if ((_gameFlags & kGameFlagDemo) == 0 && !shouldQuit()) { + if ((_gameFlags & kGameFlagIntroOnly) == 0 && !shouldQuit()) { mainLoop(); } return Common::kNoError; @@ -130,7 +130,7 @@ void TuckerEngine::restart() { _locationNum = 0; _nextLocationNum = ConfMan.getInt("boot_param"); if (_nextLocationNum == 0) { - _nextLocationNum = kStartupLocation; + _nextLocationNum = (_gameFlags & kGameFlagDemo) == 0 ? kStartupLocationGame : kStartupLocationDemo; } _gamePaused = _gamePaused2 = false; _gameDebug = false; @@ -329,6 +329,10 @@ void TuckerEngine::mainLoop() { openCompressedSoundFile(); loadCharSizeDta(); + if ((_gameFlags & kGameFlagDemo) != 0) { + addObjectToInventory(30); + addObjectToInventory(12); + } loadCharset(); loadPanel(); loadFile("infobar.txt", _infoBarBuf); @@ -1523,7 +1527,9 @@ void TuckerEngine::drawData3() { void TuckerEngine::execData3PreUpdate() { switch (_locationNum) { case 1: - execData3PreUpdate_locationNum1(); + if ((_gameFlags & kGameFlagDemo) == 0) { + execData3PreUpdate_locationNum1(); + } break; case 2: execData3PreUpdate_locationNum2(); diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 0050961827..c9decaa13a 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -175,7 +175,8 @@ enum { kScreenHeight = 200, kScreenPitch = 640, kFadePaletteStep = 5, - kStartupLocation = 1, + kStartupLocationDemo = 9, + kStartupLocationGame = 1, kDefaultCharSpeechSoundCounter = 1, kMaxSoundVolume = 127, kLastSaveSlot = 99 @@ -205,7 +206,8 @@ enum InputKey { enum GameFlag { kGameFlagDemo = 1 << 0, kGameFlagEncodedData = 1 << 1, - kGameFlagNoSubtitles = 1 << 2 + kGameFlagNoSubtitles = 1 << 2, + kGameFlagIntroOnly = 1 << 3 }; inline int scaleMixerVolume(int volume, int max = 100) { |