[Scummvm-cvs-logs] CVS: scummvm/common util.cpp,1.6,1.7 util.h,1.9,1.10

Max Horn fingolfin at users.sourceforge.net
Fri Dec 27 17:58:02 CET 2002


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv15559/common

Modified Files:
	util.cpp util.h 
Log Message:
get rid of getStringLen and use the more powerful resStrLen instead; moved resStrLen from common/ to scumm/, where it belongs; enhanced resStrLen to suport V8; fixed translateText to support embeded vars (in strings I mean) - it may still not be fully correct but at least is better now; rewrote o6_arrayOps to parallel the V8 version - needs testing

Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- util.cpp	1 Dec 2002 14:57:49 -0000	1.6
+++ util.cpp	28 Dec 2002 01:57:17 -0000	1.7
@@ -133,31 +133,6 @@
 	printf("|\n");
 }
 
-//
-// Given a pointer to a Scumm resource, this function returns the length
-// of the (string) data in that resource. To do so it understands certain
-// special chars starting with FF. The reason for this function is that
-// sometimes resource data will contain 0 bytes, thus we can't just use strlen.
-//
-int resStrLen(const char *src)
-{
-	int num = 0;
-	byte chr;
-	while ((chr = *src++) != 0) {
-		num++;
-		if (chr == 255) {
-			chr = *src++;
-			num++;
-
-			if (chr != 1 && chr != 2 && chr != 3 && chr != 8) {
-				src += 2;
-				num += 2;
-			}
-		}
-	}
-	return num;
-}
-
 RandomSource::RandomSource(uint32 seed)
 {
 	_randSeed = seed;

Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- util.h	13 Dec 2002 16:15:53 -0000	1.9
+++ util.h	28 Dec 2002 01:57:17 -0000	1.10
@@ -47,10 +47,6 @@
  */
 void hexdump(const byte * data, int len);
 
-// Resource string length
-int resStrLen(const char *src);
-
-
 class RandomSource {
 private:
 	uint32 _randSeed;





More information about the Scummvm-git-logs mailing list