aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
Diffstat (limited to 'queen')
-rw-r--r--queen/display.cpp4
-rw-r--r--queen/sound.h11
-rw-r--r--queen/talk.cpp59
3 files changed, 35 insertions, 39 deletions
diff --git a/queen/display.cpp b/queen/display.cpp
index e0cddac165..04b923105f 100644
--- a/queen/display.cpp
+++ b/queen/display.cpp
@@ -648,7 +648,7 @@ void Display::update(bool dynalum, int16 dynaX, int16 dynaY) {
void Display::setupPanel() {
uint32 size;
- const uint8 *pcxBuf = _vm->resource()->loadFile("panel.pcx", 0, &size);
+ uint8 *pcxBuf = _vm->resource()->loadFile("panel.pcx", 0, &size);
uint8 *dst = _panelBuf + PANEL_W * 10;
readPCX(dst, PANEL_W, pcxBuf + 128, PANEL_W, PANEL_H - 10);
const uint8 *pal = pcxBuf + size - 768 + 144 * 3;
@@ -663,7 +663,7 @@ void Display::setupNewRoom(const char *name, uint16 room) {
uint32 size;
char filename[20];
sprintf(filename, "%s.PCX", name);
- const uint8 *pcxBuf = _vm->resource()->loadFile(filename, 0, &size);
+ uint8 *pcxBuf = _vm->resource()->loadFile(filename, 0, &size);
_bdWidth = READ_LE_UINT16(pcxBuf + 12);
_bdHeight = READ_LE_UINT16(pcxBuf + 14);
readPCX(_backdropBuf, BACKDROP_W, pcxBuf + 128, _bdWidth, _bdHeight);
diff --git a/queen/sound.h b/queen/sound.h
index 2526aff770..57b49d7a43 100644
--- a/queen/sound.h
+++ b/queen/sound.h
@@ -62,18 +62,21 @@ public:
void stopSpeech() { _mixer->stopHandle(_speechHandle); }
void stopSfx() { _mixer->stopHandle(_sfxHandle); }
- bool sfxOn() const { return _sfxToggle; }
+ bool sfxOn() const { return _sfxToggle; }
void sfxToggle(bool val) { _sfxToggle = val; }
- void toggleSfx() { _sfxToggle ^= true; }
+ void toggleSfx() { _sfxToggle ^= true; }
bool speechOn() const { return _speechToggle; }
void speechToggle(bool val) { _speechToggle = val; }
- void toggleSpeech() { _speechToggle ^= true; }
+ void toggleSpeech() { _speechToggle ^= true; }
bool musicOn() const { return _musicToggle; }
void musicToggle(bool val) { _musicToggle = val; }
- void toggleMusic() { _musicToggle ^= true; }
+ void toggleMusic() { _musicToggle ^= true; }
+ bool isSpeechActive() const { return _speechHandle.isActive(); }
+ bool isSfxActive() const { return _sfxHandle.isActive(); }
+
int16 lastOverride() const { return _lastOverride; }
void saveState(byte *&ptr);
diff --git a/queen/talk.cpp b/queen/talk.cpp
index 41387d808a..0b8e852667 100644
--- a/queen/talk.cpp
+++ b/queen/talk.cpp
@@ -613,7 +613,7 @@ int Talk::countSpaces(const char *segment) {
void Talk::headStringAnimation(const SpeechParameters *parameters, int bobNum, int bankNum) {
// talk.c lines 1612-1635
BobSlot *bob2 = _vm->graphics()->bob(2);
-
+
if (parameters->animation[0] == 'E') {
int offset = 1;
@@ -702,11 +702,8 @@ void Talk::defaultAnimation(
// Why on earth would someone name a variable qzx?
short qzx = 0;
- int spaces = countSpaces(segment);
-
- int i;
- for (i = 0; i < (spaces + 1) /* || sfxflag == 0*/; i++) {
-
+ int len = countSpaces(segment);
+ while (1) {
if (parameters != NULL) {
int bf;
@@ -743,7 +740,7 @@ void Talk::defaultAnimation(
if (_vm->input()->talkQuit())
break;
-
+
if (_vm->logic()->joeWalk() == JWM_SPEAK) {
_vm->update();
} else {
@@ -759,6 +756,19 @@ void Talk::defaultAnimation(
_vm->sound()->stopSpeech();
break;
}
+
+ if (_vm->sound()->speechOn()) {
+ // sfx is finished, stop the speak animation
+ if (!_vm->sound()->isSpeechActive()) {
+ break;
+ }
+ } else {
+ // no sfx, stop the animation when speak segment 'length' is 0
+ --len;
+ if (len <= 0) {
+ break;
+ }
+ }
}
}
@@ -840,33 +850,16 @@ void Talk::speakSegment(
if (_talkHead) {
// talk.c lines 1491-1533
- if (isJoe) {
- switch (_vm->logic()->currentRoom()) {
- case FAYE_HEAD:
- case AZURA_HEAD:
- textX = 15;
- break;
-
- default:
- textX = 150;
- break;
- }
- textY = 30;
- } else {
- // XXX spaces = (spaces * 5) / 2;
- switch (_vm->logic()->currentRoom()) {
- case FAYE_HEAD:
- case AZURA_HEAD:
- textX = 15;
- textY = 60;
- break;
-
- default: // Frank
- textX = 150;
- textY = 60;
- break;
- }
+ switch (_vm->logic()->currentRoom()) {
+ case FAYE_HEAD:
+ case AZURA_HEAD:
+ textX = 15;
+ break;
+ default: // FRANK_HEAD
+ textX = 150;
+ break;
}
+ textY = isJoe ? 30 : 60;
} else {
textX = bob->x;
textY = bob->y;