aboutsummaryrefslogtreecommitdiff
path: root/engines/tucker/resource.cpp
diff options
context:
space:
mode:
authorGregory Montoir2008-11-16 20:51:10 +0000
committerGregory Montoir2008-11-16 20:51:10 +0000
commitb45227cfa0d3f025cae1c14afe21699f881c518e (patch)
treec64bb45bfcb7af7d309812c61f2364e792827ae6 /engines/tucker/resource.cpp
parentc4a7088c5b5732bc4ffb1a0cea91ed633e0a2d54 (diff)
downloadscummvm-rg350-b45227cfa0d3f025cae1c14afe21699f881c518e.tar.gz
scummvm-rg350-b45227cfa0d3f025cae1c14afe21699f881c518e.tar.bz2
scummvm-rg350-b45227cfa0d3f025cae1c14afe21699f881c518e.zip
some fixes to input handling, cleanup
svn-id: r35100
Diffstat (limited to 'engines/tucker/resource.cpp')
-rw-r--r--engines/tucker/resource.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index 495637134e..cd1761c424 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -215,15 +215,8 @@ void TuckerEngine::loadImage(uint8 *dst, int type) {
return;
}
f.seek(128, SEEK_SET);
- int size = 0, count = 0;
+ int size = 0;
while (size < 64000) {
- if (type == 2) {
- ++count;
- if (count > 500) {
- count = 0;
- isSpeechSoundPlaying();
- }
- }
int code = f.readByte();
if (code >= 0xC0) {
const int sz = code - 0xC0;
@@ -587,10 +580,10 @@ void TuckerEngine::loadData4() {
loadFile(_loadTempBuf);
DataTokenizer t(_loadTempBuf, _fileLoadSize);
t.findNextToken(kDataTokenDw);
- _data4FlagDebug = t.getNextInteger();
- _displayGameHints = t.getNextInteger();
+ _gameDebug = t.getNextInteger() != 0;
+ _displayGameHints = t.getNextInteger() != 0;
// forces game hints feature
-// _displayGameHints = 1;
+// _displayGameHints = true;
_locationObjectsCount = 0;
if (t.findIndex(_locationNum)) {
while (t.findNextToken(kDataTokenDw)) {
@@ -728,10 +721,7 @@ void TuckerEngine::loadCharPos() {
}
void TuckerEngine::loadSprA02_01() {
- for (int i = 1; i < kSprA02TableSize; ++i) {
- free(_sprA02Table[i]);
- _sprA02Table[i] = 0;
- }
+ unloadSprA02_01();
const int count = _sprA02LookupTable[_locationNum];
for (int i = 1; i < count + 1; ++i) {
sprintf(_fileToLoad, "sprites/a%02d_%02d.spr", _locationNum, i);
@@ -740,6 +730,13 @@ void TuckerEngine::loadSprA02_01() {
_sprA02Table[0] = _sprA02Table[1];
}
+void TuckerEngine::unloadSprA02_01() {
+ for (int i = 1; i < kSprA02TableSize; ++i) {
+ free(_sprA02Table[i]);
+ _sprA02Table[i] = 0;
+ }
+}
+
void TuckerEngine::loadSprC02_01() {
for (int i = 1; i < kSprC02TableSize; ++i) {
free(_sprC02Table[i]);
@@ -759,6 +756,13 @@ void TuckerEngine::loadSprC02_01() {
}
}
+void TuckerEngine::unloadSprC02_01() {
+ for (int i = 1; i < kSprC02TableSize; ++i) {
+ free(_sprC02Table[i]);
+ _sprC02Table[i] = 0;
+ }
+}
+
void TuckerEngine::loadFx() {
strcpy(_fileToLoad, "fx.c");
loadFile(_loadTempBuf);
@@ -888,6 +892,7 @@ void TuckerEngine::loadSound(Audio::Mixer::SoundType type, int num, int volume,
}
}
if (stream) {
+ _mixer->stopHandle(*handle);
_mixer->playInputStream(type, handle, stream, -1, volume * Audio::Mixer::kMaxChannelVolume / kMaxSoundVolume);
}
}
@@ -951,7 +956,7 @@ void TuckerEngine::loadActionsTable() {
}
}
if (_conversationOptionsCount != 0) {
- if (_mouseButtons != 0 && _nextTableToLoadIndex != -1) {
+ if (_leftMouseButtonPressed && _nextTableToLoadIndex != -1) {
_nextAction = _nextTableToLoadTable[_nextTableToLoadIndex];
_csDataLoaded = false;
_conversationOptionsCount = 0;