SHERLOCK: SS: Move fixBadText from ScalpelJournal to ScalpelTalk

This commit is contained in:
Paul Gilbert 2015-10-08 08:22:26 -04:00
parent 3c6cf2b947
commit a1057a3fe5
5 changed files with 16 additions and 15 deletions

View File

@ -24,6 +24,7 @@
#include "sherlock/scalpel/scalpel.h"
#include "sherlock/scalpel/scalpel_fixed_text.h"
#include "sherlock/scalpel/scalpel_journal.h"
#include "sherlock/scalpel/scalpel_talk.h"
#include "sherlock/tattoo/tattoo.h"
#include "sherlock/tattoo/tattoo_fixed_text.h"
#include "sherlock/tattoo/tattoo_journal.h"
@ -526,7 +527,7 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
journalString += people._characters[c]._name;
if (IS_SERRATED_SCALPEL && _vm->getLanguage() == Common::DE_DEU)
Scalpel::ScalpelJournal::skipBadText(replyP);
Scalpel::ScalpelTalk::skipBadText(replyP);
const byte *strP = replyP;
byte v;

View File

@ -650,14 +650,6 @@ void ScalpelJournal::record(int converseNum, int statementNum, bool replyOnly) {
Journal::record(converseNum, statementNum, replyOnly);
}
void ScalpelJournal::skipBadText(const byte *&msgP) {
// WORKAROUND: Skip over bad text in the original game
const char *BAD_PHRASE1 = "Change Speaker to Sherlock Holmes ";
if (!strncmp((const char *)msgP, BAD_PHRASE1, strlen(BAD_PHRASE1)))
msgP += strlen(BAD_PHRASE1);
}
} // End of namespace Scalpel
} // End of namespace Sherlock

View File

@ -70,11 +70,6 @@ public:
*/
void drawInterface();
/**
* Handles skipping over bad text in conversations
*/
static void skipBadText(const byte *&msgP);
/**
* Handle events whilst the journal is being displayed
*/

View File

@ -191,7 +191,7 @@ void ScalpelTalk::talkInterface(const byte *&str) {
UserInterface &ui = *_vm->_ui;
if (_vm->getLanguage() == Common::DE_DEU)
ScalpelJournal::skipBadText(str);
skipBadText(str);
// If the window isn't yet open, draw the window before printing starts
if (!ui._windowOpen && _noTextYet) {
@ -1013,6 +1013,14 @@ void ScalpelTalk::clearSequences() {
_sequenceStack.clear();
}
void ScalpelTalk::skipBadText(const byte *&msgP) {
// WORKAROUND: Skip over bad text in the original game
const char *BAD_PHRASE1 = "Change Speaker to Sherlock Holmes ";
if (!strncmp((const char *)msgP, BAD_PHRASE1, strlen(BAD_PHRASE1)))
msgP += strlen(BAD_PHRASE1);
}
} // End of namespace Scalpel
} // End of namespace Sherlock

View File

@ -131,6 +131,11 @@ public:
*/
bool talk3DOMovieTrigger(int subIndex);
/**
* Handles skipping over bad text in conversations
*/
static void skipBadText(const byte *&msgP);
/**
* Push the details of a passed object onto the saved sequences stack
*/