[Scummvm-cvs-logs] SF.net SVN: scummvm:[52921] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Mon Sep 27 23:50:11 CEST 2010


Revision: 52921
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52921&view=rev
Author:   strangerke
Date:     2010-09-27 21:50:11 +0000 (Mon, 27 Sep 2010)

Log Message:
-----------
HUGO: Move strlwr to Utils

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/parser.cpp
    scummvm/trunk/engines/hugo/parser.h
    scummvm/trunk/engines/hugo/schedule.cpp
    scummvm/trunk/engines/hugo/util.cpp
    scummvm/trunk/engines/hugo/util.h

Modified: scummvm/trunk/engines/hugo/parser.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser.cpp	2010-09-27 20:24:36 UTC (rev 52920)
+++ scummvm/trunk/engines/hugo/parser.cpp	2010-09-27 21:50:11 UTC (rev 52921)
@@ -199,10 +199,9 @@
 // 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 @@
 	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 @@
 		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

Modified: scummvm/trunk/engines/hugo/parser.h
===================================================================
--- scummvm/trunk/engines/hugo/parser.h	2010-09-27 20:24:36 UTC (rev 52920)
+++ scummvm/trunk/engines/hugo/parser.h	2010-09-27 21:50:11 UTC (rev 52921)
@@ -69,7 +69,6 @@
 
 	char *findNoun(char *line);
 	char *findVerb(char *line);
-	char *strlwr(char *buffer);
 
 	void  dropObject(object_t *obj);
 	void  showDosInventory();

Modified: scummvm/trunk/engines/hugo/schedule.cpp
===================================================================
--- scummvm/trunk/engines/hugo/schedule.cpp	2010-09-27 20:24:36 UTC (rev 52920)
+++ scummvm/trunk/engines/hugo/schedule.cpp	2010-09-27 21:50:11 UTC (rev 52921)
@@ -230,7 +230,7 @@
 
 		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;
 		}
 

Modified: scummvm/trunk/engines/hugo/util.cpp
===================================================================
--- scummvm/trunk/engines/hugo/util.cpp	2010-09-27 20:24:36 UTC (rev 52920)
+++ scummvm/trunk/engines/hugo/util.cpp	2010-09-27 21:50:11 UTC (rev 52921)
@@ -175,4 +175,17 @@
 	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

Modified: scummvm/trunk/engines/hugo/util.h
===================================================================
--- scummvm/trunk/engines/hugo/util.h	2010-09-27 20:24:36 UTC (rev 52920)
+++ scummvm/trunk/engines/hugo/util.h	2010-09-27 21:50:11 UTC (rev 52921)
@@ -51,11 +51,14 @@
 namespace Utils {
 int      firstBit(byte data);
 int      lastBit(byte data);
+
+void     gameOverMsg();
 void     reverseByte(byte *data);
+void     Error(int code, const char *format, ...) GCC_PRINTF(2, 3);
 void     Warn(bool technote, const char *format, ...) GCC_PRINTF(2, 3);
-void     Error(int code, const char *format, ...) GCC_PRINTF(2, 3);
-void     gameOverMsg();
+
 char    *Box(box_t, const char *, ...) GCC_PRINTF(2, 3);
+char    *strlwr(char *buffer);
 }
 
 } // End of namespace Hugo


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list