aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorGregory Montoir2003-11-26 21:46:29 +0000
committerGregory Montoir2003-11-26 21:46:29 +0000
commit28ac3d653dfdf80b44b1085641480678e1f5b388 (patch)
treed504d5f5126970d6170c4df0308d4ecdd62c37f1 /queen
parent584760fc707eafde1119fecf4b12fe105dad3cf8 (diff)
downloadscummvm-rg350-28ac3d653dfdf80b44b1085641480678e1f5b388.tar.gz
scummvm-rg350-28ac3d653dfdf80b44b1085641480678e1f5b388.tar.bz2
scummvm-rg350-28ac3d653dfdf80b44b1085641480678e1f5b388.zip
add a wrapper for Talk::speak in Logic that clears current command
svn-id: r11379
Diffstat (limited to 'queen')
-rw-r--r--queen/command.cpp12
-rw-r--r--queen/cutaway.cpp6
-rw-r--r--queen/logic.cpp12
-rw-r--r--queen/logic.h1
4 files changed, 17 insertions, 14 deletions
diff --git a/queen/command.cpp b/queen/command.cpp
index 0b7942822e..b446da3aee 100644
--- a/queen/command.cpp
+++ b/queen/command.cpp
@@ -843,11 +843,10 @@ bool Command::executeIfCutaway(const char *description) {
if (strlen(description) > 4 &&
scumm_stricmp(description + strlen(description) - 4, ".cut") == 0) {
+ _graphics->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+
char nextCutaway[20];
memset(nextCutaway, 0, sizeof(nextCutaway));
-
- clear(true); // clear as Talk::speak() can be called in a Cutaway
-
_logic->playCutaway(description, nextCutaway);
while (nextCutaway[0] != '\0') {
_logic->playCutaway(nextCutaway, nextCutaway);
@@ -863,12 +862,11 @@ bool Command::executeIfDialog(const char *description) {
if (strlen(description) > 4 &&
scumm_stricmp(description + strlen(description) - 4, ".dog") == 0) {
+ _graphics->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
+
char cutaway[20];
memset(cutaway, 0, sizeof(cutaway));
-
- int person = _selCmd.noun;
- clear(true);
- _logic->dialogue(description, person, cutaway);
+ _logic->dialogue(description, _selCmd.noun, cutaway);
while (cutaway[0] != '\0') {
char currentCutaway[20];
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp
index 15d0a831c1..fc9aafc9cf 100644
--- a/queen/cutaway.cpp
+++ b/queen/cutaway.cpp
@@ -1180,10 +1180,8 @@ void Cutaway::handlePersonRecord(
}
char voiceFilePrefix[MAX_STRING_SIZE];
- findCdCut(_basename, index, voiceFilePrefix);
-
- Talk::speak(sentence, (object.objectNumber == OBJECT_JOE) ? NULL : &p, voiceFilePrefix,
- _graphics, _input, _logic, _resource, _sound);
+ findCdCut(_basename, index, voiceFilePrefix);
+ _logic->makePersonSpeak(sentence, (object.objectNumber == OBJECT_JOE) ? NULL : &p, voiceFilePrefix);
}
}
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 24d181f747..8bad76f41e 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -1851,6 +1851,13 @@ void Logic::joeUseUnderwear() {
}
+void Logic::makePersonSpeak(const char *sentence, Person *person, const char *voiceFilePrefix) {
+
+ _cmd->clear(false);
+ Talk::speak(sentence, person, voiceFilePrefix, _graphics, _input, this, _resource, _sound);
+}
+
+
void Logic::dialogue(const char *dlgFile, int personInRoom, char *cutaway) {
char cutawayFile[20];
@@ -1881,10 +1888,9 @@ void Logic::joeSpeak(uint16 descNum, bool objectType) {
if (objectType) {
descNum += JOE_RESPONSE_MAX;
}
- _cmd->clear(false);
char descFilePrefix[10];
sprintf(descFilePrefix, "JOE%04i", descNum);
- Talk::speak(text, NULL, descFilePrefix, _graphics, _input, this, _resource, _sound);
+ makePersonSpeak(text, NULL, descFilePrefix);
}
@@ -2552,7 +2558,7 @@ void Logic::sceneStop() {
void Logic::useJournal() {
if (_resource->isDemo()) {
- Talk::speak("This is a demo, so I can't load or save games*14", NULL, "", _graphics, _input, this, _resource, _sound);
+ makePersonSpeak("This is a demo, so I can't load or save games*14", NULL, "");
}
else {
diff --git a/queen/logic.h b/queen/logic.h
index 713186e5b5..8424a30444 100644
--- a/queen/logic.h
+++ b/queen/logic.h
@@ -254,6 +254,7 @@ public:
void joeSpeak(uint16 descNum, bool objectType = false);
+ void makePersonSpeak(const char *sentence, Person *person, const char *voiceFilePrefix);
void dialogue(const char *dlgFile, int personInRoom, char *cutaway);
void playCutaway(const char *cutFile, char *next = NULL);