diff options
author | Arnaud Boutonné | 2010-09-27 21:50:11 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2010-09-27 21:50:11 +0000 |
commit | d46f4a2fc0316e32a300752f5260e463118626e4 (patch) | |
tree | 1b84658a510826796545b49782728dca76338774 /engines/hugo | |
parent | 3db60d9e441cbf48701d0a0565ac87f6c69b1d15 (diff) | |
download | scummvm-rg350-d46f4a2fc0316e32a300752f5260e463118626e4.tar.gz scummvm-rg350-d46f4a2fc0316e32a300752f5260e463118626e4.tar.bz2 scummvm-rg350-d46f4a2fc0316e32a300752f5260e463118626e4.zip |
HUGO: Move strlwr to Utils
svn-id: r52921
Diffstat (limited to 'engines/hugo')
-rw-r--r-- | engines/hugo/parser.cpp | 19 | ||||
-rw-r--r-- | engines/hugo/parser.h | 1 | ||||
-rw-r--r-- | engines/hugo/schedule.cpp | 2 | ||||
-rw-r--r-- | engines/hugo/util.cpp | 13 | ||||
-rw-r--r-- | engines/hugo/util.h | 7 |
5 files changed, 21 insertions, 21 deletions
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index c4833c295b..54f6a7f159 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -199,10 +199,9 @@ void Parser::charHandler() { // Perform an immediate command. Takes parameters a la sprintf // Assumes final string will not overrun line[] length void Parser::command(const char *format, ...) { - va_list marker; - debugC(1, kDebugParser, "Command(%s, ...)", format); + va_list marker; va_start(marker, format); vsprintf(_line, format, marker); va_end(marker); @@ -210,20 +209,6 @@ void Parser::command(const char *format, ...) { lineHandler(); } -char *Parser::strlwr(char *buffer) { - char *result = buffer; - - debugC(1, kDebugParser, "strlwr(%s)", buffer); - - while (*buffer != '\0') { - if (isupper(*buffer)) - *buffer = tolower(*buffer); - buffer++; - } - - return result; -} - // Parse the user's line of text input. Generate events as necessary void Parser::lineHandler() { char *noun, *verb; // ptrs to noun and verb strings @@ -243,7 +228,7 @@ void Parser::lineHandler() { return; } - strlwr(_line); // Convert to lower case + Utils::strlwr(_line); // Convert to lower case // God Mode cheat commands: // goto <screen> Takes hero to named screen diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h index 902d01c620..4717ef7c16 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -69,7 +69,6 @@ private: char *findNoun(char *line); char *findVerb(char *line); - char *strlwr(char *buffer); void dropObject(object_t *obj); void showDosInventory(); diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 3d20cbd7ad..2354208ac3 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -230,7 +230,7 @@ event_t *Scheduler::doAction(event_t *curEvent) { for (found = false, dx = 0; !found && (action->a3.responsePtr[dx] != -1); dx++) { tmpStr = _vm.file().Fetch_string(action->a3.responsePtr[dx]); - if (strstr(_vm.parser().strlwr(response) , tmpStr)) + if (strstr(Utils::strlwr(response) , tmpStr)) found = true; } diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index 8c63bedc04..42ae9131d3 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -175,4 +175,17 @@ void Utils::gameOverMsg(void) { warning("STUB: Gameover_msg(): %s", HugoEngine::get()._textUtil[kGameOver]); } +char *Utils::strlwr(char *buffer) { + char *result = buffer; + + while (*buffer != '\0') { + if (isupper(*buffer)) + *buffer = tolower(*buffer); + buffer++; + } + + return result; +} + + } // End of namespace Hugo diff --git a/engines/hugo/util.h b/engines/hugo/util.h index f944baa324..91d42c296f 100644 --- a/engines/hugo/util.h +++ b/engines/hugo/util.h @@ -51,11 +51,14 @@ enum seqTextUtil { namespace Utils { int firstBit(byte data); int lastBit(byte data); + +void gameOverMsg(); void reverseByte(byte *data); -void Warn(bool technote, const char *format, ...) GCC_PRINTF(2, 3); void Error(int code, const char *format, ...) GCC_PRINTF(2, 3); -void gameOverMsg(); +void Warn(bool technote, const char *format, ...) GCC_PRINTF(2, 3); + char *Box(box_t, const char *, ...) GCC_PRINTF(2, 3); +char *strlwr(char *buffer); } } // End of namespace Hugo |