aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/tucker/graphics.cpp1
-rw-r--r--engines/tucker/locations.cpp1
-rw-r--r--engines/tucker/resource.cpp1
-rw-r--r--engines/tucker/sequences.cpp29
-rw-r--r--engines/tucker/tucker.cpp13
-rw-r--r--engines/tucker/tucker.h6
6 files changed, 23 insertions, 28 deletions
diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp
index ad4d35df48..52018d25e6 100644
--- a/engines/tucker/graphics.cpp
+++ b/engines/tucker/graphics.cpp
@@ -189,6 +189,7 @@ void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 c
}
void Graphics::setCharset(CharsetType type) {
+ _charsetType = type;
switch (type) {
case kCharsetTypeDefault:
_charset.charW = 10;
diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp
index 6e10649631..a8191e39e4 100644
--- a/engines/tucker/locations.cpp
+++ b/engines/tucker/locations.cpp
@@ -2284,7 +2284,6 @@ void TuckerEngine::updateSprite_locationNum50(int i) {
_updateSpriteFlag1 = 1;
state = i + 1;
}
- state = i + 1; // FIXME: bug ?
_spritesTable[i].state = state;
}
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index 43fe9cabd3..8bc6e2c8e3 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -547,6 +547,7 @@ void TuckerEngine::loadObj() {
sprintf(filename, "pt%dtext.c", _partNum);
free(_ptTextBuf);
_ptTextBuf = loadFile(filename, 0);
+ _characterSpeechDataPtr = _ptTextBuf;
loadData();
loadPanObj();
}
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp
index d115b1a8d1..86962d7a31 100644
--- a/engines/tucker/sequences.cpp
+++ b/engines/tucker/sequences.cpp
@@ -57,12 +57,8 @@ void TuckerEngine::handleCreditsSequence() {
_flagsTable[236] = 74;
uint8 *imgBuf = (uint8 *)malloc(16 * 64000);
loadSprC02_01();
+ clearSprites();
_spritesCount = _creditsSequenceSpriteCounts[num];
- for (int i = 0; i < _spritesCount; ++i) {
- memset(&_spritesTable[i], 0, sizeof(Sprite));
- _spritesTable[i].state = -1;
- _spritesTable[i].stateIndex = -1;
- }
loadFile("credits.txt", _ptTextBuf);
loadImage("loc74.pcx", _quadBackgroundGfxBuf, 1);
startSpeechSound(9001, 120);
@@ -84,7 +80,7 @@ void TuckerEngine::handleCreditsSequence() {
Graphics::copyRect(_locationBackgroundGfxBuf, 640, _quadBackgroundGfxBuf, 320, 320, 200);
} else {
Graphics::copyRect(_locationBackgroundGfxBuf, 640, imgBuf + imgNum * 64000, 320, 320, 200);
- static const int yPosTable[] = { 48, 60, 80, 92, 140, 116 };
+ static const int yPosTable[] = { 48, 60, 80, 92, 104, 116 };
for (int i = 0; i < 6; ++i) {
drawCreditsString(5, yPosTable[i], counter2 * 6 + i);
}
@@ -96,10 +92,10 @@ void TuckerEngine::handleCreditsSequence() {
}
if (counter1 > 116) {
counter1 = 0;
- }
- ++counter2;
- if (counter2 > 17) {
- counter2 = 0;
+ ++counter2;
+ if (counter2 > 17) {
+ counter2 = 0;
+ }
}
}
_fullRedraw = true;
@@ -117,17 +113,12 @@ void TuckerEngine::handleCreditsSequence() {
counter4 = _timerCounter2 / 3;
if (counter4 == _creditsSequenceTimecounts[num]) {
_fadePaletteCounter = 0;
- _spritesCount = _creditsSequenceSpriteCounts[num];
- for (int i = 0; i < _spritesCount; ++i) {
- memset(&_spritesTable[i], 0, sizeof(Sprite));
- _spritesTable[i].state = -1;
- _spritesTable[i].stateIndex = -1;
- }
+ clearSprites();
++num;
char filename[40];
if (num == 6) {
for (int i = 0; i < 16; ++i) {
- sprintf(filename, "cogs%04d.pcx", i);
+ sprintf(filename, "cogs%04d.pcx", i + 1);
loadImage(filename, imgBuf + i * 64000, 2);
}
} else {
@@ -215,9 +206,7 @@ void TuckerEngine::handleNewPartSequence() {
}
loadImage(filename, _quadBackgroundGfxBuf, 1);
_spritesCount = 1;
- memset(&_spritesTable[0], 0, sizeof(Sprite));
- _spritesTable[0].state = -1;
- _spritesTable[0].stateIndex = -1;
+ clearSprites();
int currentLocation = _locationNum;
_locationNum = 98;
unloadSprA02_01();
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index 704cbf4dda..5cfa99def7 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -207,9 +207,6 @@ void TuckerEngine::restart() {
_speechVolume = kMaxSoundVolume;
memset(_miscSoundFxNum, 0, sizeof(_miscSoundFxNum));
memset(_speechHistoryTable, 0, sizeof(_speechHistoryTable));
- for (int i = 0; i < kMaxCharacters; ++i) {
- _charSpeechSoundVolumeTable[i] = kMaxSoundVolume;
- }
_charSpeechSoundCounter = 0;
memset(_miscSoundFxDelayCounter, 0, sizeof(_miscSoundFxDelayCounter));
_characterSoundFxDelayCounter = 0;
@@ -2368,6 +2365,14 @@ void TuckerEngine::handleMap() {
}
}
+void TuckerEngine::clearSprites() {
+ memset(_spritesTable, 0, sizeof(_spritesTable));
+ for (int i = 0; i < kMaxCharacters; ++i) {
+ _spritesTable[i].state = -1;
+ _spritesTable[i].stateIndex = -1;
+ }
+}
+
void TuckerEngine::updateSprites() {
const int count = (_locationNum == 9) ? 3 : _spritesCount;
for (int i = 0; i < count; ++i) {
@@ -3164,7 +3169,7 @@ int TuckerEngine::executeTableInstruction() {
case kCode_c0s:
_speechSoundNum = readTableInstructionParam(3) - 1;
rememberSpeechSound();
- startSpeechSound(_partNum * 3000 + _ptTextOffset + _speechSoundNum - 3000, _charSpeechSoundVolumeTable[index]);
+ startSpeechSound(_partNum * 3000 + _ptTextOffset + _speechSoundNum - 3000, kMaxSoundVolume);
_charSpeechSoundCounter = kDefaultCharSpeechSoundCounter;
_actionTextColor = 181 + index;
if (_tableInstructionFlag == 0) {
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index a30e09f9de..80374a0d5c 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -335,6 +335,7 @@ protected:
void addObjectToInventory(int num);
void removeObjectFromInventory(int num);
void handleMap();
+ void clearSprites();
void updateSprites();
void updateSprite(int i);
void drawStringInteger(int num, int x, int y, int digits);
@@ -705,12 +706,11 @@ protected:
int _currentFxIndex;
int _speechSoundNum;
int _speechVolume;
- Audio::SoundHandle _sfxHandles[6];
- Audio::SoundHandle _musicHandles[2];
+ Audio::SoundHandle _sfxHandles[kLocationSoundsTableSize];
+ Audio::SoundHandle _musicHandles[kLocationMusicsTableSize];
Audio::SoundHandle _speechHandle;
int _miscSoundFxNum[2];
int _speechHistoryTable[kSpeechHistoryTableSize];
- int _charSpeechSoundVolumeTable[kMaxCharacters];
int _charSpeechSoundCounter;
int _miscSoundFxDelayCounter[2];
int _characterSoundFxDelayCounter;