aboutsummaryrefslogtreecommitdiff
path: root/engines/tucker
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tucker')
-rw-r--r--engines/tucker/detection.cpp4
-rw-r--r--engines/tucker/resource.cpp8
-rw-r--r--engines/tucker/sequences.cpp23
-rw-r--r--engines/tucker/tucker.cpp4
-rw-r--r--engines/tucker/tucker.h1
5 files changed, 31 insertions, 9 deletions
diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp
index 3d7859e4fd..2447e15d6b 100644
--- a/engines/tucker/detection.cpp
+++ b/engines/tucker/detection.cpp
@@ -116,7 +116,7 @@ class TuckerMetaEngine : public AdvancedMetaEngine {
public:
TuckerMetaEngine() : AdvancedMetaEngine(tuckerGameDescriptions, sizeof(ADGameDescription), tuckerGames) {
_md5Bytes = 512;
- _singleid = "tucker";
+ _singleId = "tucker";
}
virtual const char *getName() const {
@@ -182,6 +182,8 @@ public:
saveList.push_back(SaveStateDescriptor(slot, description));
}
}
+ // Sort saves based on slot number.
+ Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
return saveList;
}
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index 9cba7b523d..d7b75e39c1 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -662,9 +662,11 @@ void TuckerEngine::loadData3() {
void TuckerEngine::loadData4() {
loadFile("data4.c", _loadTempBuf);
DataTokenizer t(_loadTempBuf, _fileLoadSize);
- t.findNextToken(kDataTokenDw);
- _gameDebug = t.getNextInteger() != 0;
- _displayGameHints = t.getNextInteger() != 0;
+ if ((_gameFlags & kGameFlagDemo) == 0) {
+ t.findNextToken(kDataTokenDw);
+ _gameDebug = t.getNextInteger() != 0;
+ _displayGameHints = t.getNextInteger() != 0;
+ }
_locationObjectsCount = 0;
if (t.findIndex(_locationNum)) {
while (t.findNextToken(kDataTokenDw)) {
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp
index d9f284e443..0151c55eb1 100644
--- a/engines/tucker/sequences.cpp
+++ b/engines/tucker/sequences.cpp
@@ -54,6 +54,7 @@ void TuckerEngine::handleCreditsSequence() {
int counter2 = 0;
int counter1 = 0;
loadCharset2();
+ showCursor(false);
stopSounds();
_locationNum = 74;
_flagsTable[236] = 74;
@@ -159,12 +160,16 @@ void TuckerEngine::handleCreditsSequence() {
redrawScreen(0);
waitForTimer(2);
} while (_fadePaletteCounter > 0);
+ showCursor(true);
}
void TuckerEngine::handleCongratulationsSequence() {
+ // This method is only called right before the program terminates,
+ // so it doesn't bother restoring the palette
_timerCounter2 = 0;
_fadePaletteCounter = 0;
stopSounds();
+ showCursor(false);
loadImage("congrat.pcx", _loadTempBuf, 1);
Graphics::copyRect(_locationBackgroundGfxBuf, 640, _loadTempBuf, 320, 320, 200);
_fullRedraw = true;
@@ -176,11 +181,13 @@ void TuckerEngine::handleCongratulationsSequence() {
}
waitForTimer(3);
}
+ showCursor(true);
}
void TuckerEngine::handleNewPartSequence() {
char filename[40];
+ showCursor(false);
stopSounds();
if (_flagsTable[219] == 1) {
_flagsTable[219] = 0;
@@ -244,7 +251,7 @@ void TuckerEngine::handleNewPartSequence() {
_inputKeys[kInputKeyEscape] = false;
break;
}
- } while (isSpeechSoundPlaying());
+ } while (isSpeechSoundPlaying() && !_quitGame);
stopSpeechSound();
do {
if (_fadePaletteCounter > 0) {
@@ -257,8 +264,9 @@ void TuckerEngine::handleNewPartSequence() {
drawSprite(0);
redrawScreen(0);
waitForTimer(3);
- } while (_fadePaletteCounter > 0);
+ } while (_fadePaletteCounter > 0 && !_quitGame);
_locationNum = currentLocation;
+ showCursor(true);
}
void TuckerEngine::handleMeanwhileSequence() {
@@ -280,8 +288,9 @@ void TuckerEngine::handleMeanwhileSequence() {
strcpy(filename, "loc80.pcx");
}
loadImage(filename, _quadBackgroundGfxBuf + 89600, 1);
+ showCursor(false);
_fadePaletteCounter = 0;
- for (int i = 0; i < 60; ++i) {
+ for (int i = 0; i < 60 && !_quitGame; ++i) {
if (_fadePaletteCounter < 16) {
fadeOutPalette();
++_fadePaletteCounter;
@@ -290,7 +299,10 @@ void TuckerEngine::handleMeanwhileSequence() {
_fullRedraw = true;
redrawScreen(0);
waitForTimer(3);
- ++i;
+ if (_inputKeys[kInputKeyEscape]) {
+ _inputKeys[kInputKeyEscape] = false;
+ break;
+ }
}
do {
if (_fadePaletteCounter > 0) {
@@ -301,9 +313,10 @@ void TuckerEngine::handleMeanwhileSequence() {
_fullRedraw = true;
redrawScreen(0);
waitForTimer(3);
- } while (_fadePaletteCounter > 0);
+ } while (_fadePaletteCounter > 0 && !_quitGame);
memcpy(_currentPalette, backupPalette, 256 * 3);
_fullRedraw = true;
+ showCursor(true);
}
void TuckerEngine::handleMapSequence() {
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index de555cd7b6..ad455c5ded 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -710,6 +710,10 @@ void TuckerEngine::setCursorType(int type) {
CursorMan.showMouse(_cursorType < 2);
}
+void TuckerEngine::showCursor(bool visible) {
+ CursorMan.showMouse(visible);
+}
+
void TuckerEngine::setupNewLocation() {
debug(2, "setupNewLocation() current %d next %d", _locationNum, _nextLocationNum);
_locationNum = _nextLocationNum;
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index 3bbf6a57f5..2ab94dedbc 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -300,6 +300,7 @@ protected:
void updateCursorPos(int x, int y);
void setCursorNum(int num);
void setCursorType(int type);
+ void showCursor(bool visible);
void setupNewLocation();
void copyLocBitmap(const char *filename, int offset, bool isMask);
void updateMouseState();