[Scummvm-cvs-logs] SF.net SVN: scummvm: [25739] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Tue Feb 20 10:52:07 CET 2007


Revision: 25739
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25739&view=rev
Author:   peres001
Date:     2007-02-20 01:52:07 -0800 (Tue, 20 Feb 2007)

Log Message:
-----------
changed parseComment to use Script stream instead of file

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/location.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parser.cpp
    scummvm/trunk/engines/parallaction/zone.cpp

Modified: scummvm/trunk/engines/parallaction/location.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/location.cpp	2007-02-20 09:17:28 UTC (rev 25738)
+++ scummvm/trunk/engines/parallaction/location.cpp	2007-02-20 09:52:07 UTC (rev 25739)
@@ -169,10 +169,10 @@
 			}
 		}
 		if (!scumm_stricmp(_tokens[0], "COMMENT")) {
-			_locationComment = parseComment(file);
+			_locationComment = parseComment(*_locationScript);
 		}
 		if (!scumm_stricmp(_tokens[0], "ENDCOMMENT")) {
-			_locationEndComment = parseComment(file);
+			_locationEndComment = parseComment(*_locationScript);
 		}
 		if (!scumm_stricmp(_tokens[0], "ZONE")) {
 			parseZone(file, &_zones, _tokens[1]);

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-02-20 09:17:28 UTC (rev 25738)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-02-20 09:52:07 UTC (rev 25739)
@@ -241,7 +241,7 @@
 	void changeCursor(int32 index);
 	void changeCharacter(const char *name);
 
-	char   *parseComment(ArchivedFile *file);
+	char   *parseComment(Script &script);
 	char   *parseDialogueString();
 	Dialogue   *parseDialogue(ArchivedFile *file);
 

Modified: scummvm/trunk/engines/parallaction/parser.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser.cpp	2007-02-20 09:17:28 UTC (rev 25738)
+++ scummvm/trunk/engines/parallaction/parser.cpp	2007-02-20 09:52:07 UTC (rev 25739)
@@ -74,38 +74,18 @@
 	error("seek not supported on Script streams");
 }
 
-//	looks for next token in a string
 //
-//	scans 's' until one of the stop-chars in 'brk' is found
-//	builds a token and return the part of the string which hasn't been parsed
-
-char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) {
-
-	while (*s != '\0') {
-
-		if (brk[0] == *s) break;
-		if (brk[1] == *s) break;
-		if (brk[2] == *s) break;
-
-		*tok++ = *s++;
-	}
-
-	*tok = '\0';
-	return s;
-}
-
-//
 //	a comment can appear both at location and Zone levels
 //	comments are displayed into rectangles on the screen
 //
-char *Parallaction::parseComment(ArchivedFile *file) {
+char *Parallaction::parseComment(Script &script) {
 
 	char			_tmp_comment[1000] = "\0";
 	char *v194;
 
 	do {
 		char v190[400];
-		v194 = _locationScript->readLine(v190, 400);
+		v194 = script.readLine(v190, 400);
 
 		v194[strlen(v194)-1] = '\0';
 		if (!scumm_stricmp(v194, "endtext"))
@@ -131,6 +111,26 @@
 
 }
 
+//	looks for next token in a string
+//
+//	scans 's' until one of the stop-chars in 'brk' is found
+//	builds a token and return the part of the string which hasn't been parsed
+
+char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) {
+
+	while (*s != '\0') {
+
+		if (brk[0] == *s) break;
+		if (brk[1] == *s) break;
+		if (brk[2] == *s) break;
+
+		*tok++ = *s++;
+	}
+
+	*tok = '\0';
+	return s;
+}
+
 uint16 fillTokens(char* line) {
 
 	uint16 i = 0;

Modified: scummvm/trunk/engines/parallaction/zone.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/zone.cpp	2007-02-20 09:17:28 UTC (rev 25738)
+++ scummvm/trunk/engines/parallaction/zone.cpp	2007-02-20 09:52:07 UTC (rev 25739)
@@ -256,7 +256,7 @@
 				strcpy(u->examine->_filename, _tokens[1]);
 			}
 			if (!scumm_stricmp(_tokens[0], "desc")) {
-				u->examine->_description = parseComment(file);
+				u->examine->_description = parseComment(*_locationScript);
 			}
 			break;
 


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