diff options
author | Gregory Montoir | 2004-12-06 20:42:11 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-12-06 20:42:11 +0000 |
commit | 3fb09f9b1c36bba22b3248b37a04eb8a311d4ba0 (patch) | |
tree | b2f7961ab326c21a04512766d0bf5a66d1f18402 /queen/cutaway.cpp | |
parent | 24bc673b8b31bebf5b34d408a02e9d74afb560a0 (diff) | |
download | scummvm-rg350-3fb09f9b1c36bba22b3248b37a04eb8a311d4ba0.tar.gz scummvm-rg350-3fb09f9b1c36bba22b3248b37a04eb8a311d4ba0.tar.bz2 scummvm-rg350-3fb09f9b1c36bba22b3248b37a04eb8a311d4ba0.zip |
Cutaway code also handles some talking stuff... Updated this part too, to fix 'bug' #1034715
svn-id: r15996
Diffstat (limited to 'queen/cutaway.cpp')
-rw-r--r-- | queen/cutaway.cpp | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index fb52ddfd78..e27c3d63b7 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -1165,30 +1165,12 @@ void Cutaway::updateGameState() { } // for() } -static char *right(char *str, int count) { - // This function does _not_ use static data (the implementation in talk.c does!) - int length = strlen(str); - if (count > length) - return str; - else - return str + length - count; -} - void Cutaway::talk(char *nextFilename) { - // Lines 2119-2131 in cutaway.c - - if (0 == scumm_stricmp(right(_talkFile, 4), ".dog")) { + const char *p = strrchr(_talkFile, '.'); + if (p && 0 == scumm_stricmp(p, ".dog")) { nextFilename[0] = '\0'; - - int personInRoom; - - if (_talkTo > 0) - personInRoom = _talkTo - _vm->logic()->roomData(_vm->logic()->currentRoom()); - else { - warning("_talkTo is 0!"); - personInRoom = 0; // XXX is this correct? - } - + assert(_talkTo > 0); + int personInRoom = _talkTo - _vm->logic()->roomData(_vm->logic()->currentRoom()); _vm->logic()->startDialogue(_talkFile, personInRoom, nextFilename); } } @@ -1269,14 +1251,9 @@ void Cutaway::handleText( _vm->display()->clearTexts(0, 150); } - int i; - for (i = 0; i < spaces; i++) { + while (1) { _vm->update(); - if (OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) { - // XXX: see if speaking is finished - } - if (_vm->input()->cutawayQuit()) return; @@ -1284,9 +1261,20 @@ void Cutaway::handleText( _vm->input()->clearKeyVerb(); break; } + + if ((OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) && _vm->sound()->speechOn()) { + if (!_vm->sound()->isSpeechActive()) { + break; + } + } else { + --spaces; + if (spaces <= 0) { + break; + } + } } - _vm->display()->clearTexts(0,198); + _vm->display()->clearTexts(0, 198); _vm->update(); } |