possible fix for 'bug' #1034715

svn-id: r15861
This commit is contained in:
Gregory Montoir
2004-11-22 22:16:50 +00:00
parent 9bbb5fa0db
commit f66f786558
3 changed files with 35 additions and 39 deletions
+2 -2
View File
@@ -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);
+7 -4
View File
@@ -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);
+26 -33
View File
@@ -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;