added detection entry for playable demo and some code differences

svn-id: r36044
This commit is contained in:
Gregory Montoir 2009-01-24 21:03:44 +00:00
parent 454610ff5a
commit e5feb689df
4 changed files with 48 additions and 21 deletions

View File

@ -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 {

View File

@ -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);

View File

@ -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();

View File

@ -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) {