add a wrapper for Talk::speak in Logic that clears current command

svn-id: r11379
This commit is contained in:
Gregory Montoir
2003-11-26 21:46:29 +00:00
parent 584760fc70
commit 28ac3d653d
4 changed files with 17 additions and 14 deletions
+5 -7
View File
@@ -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];
+2 -4
View File
@@ -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);
}
}
+9 -3
View File
@@ -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 {
+1
View File
@@ -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);