[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.139,1.140

Max Horn fingolfin at users.sourceforge.net
Sun Aug 3 11:24:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv24708

Modified Files:
	script_v5.cpp 
Log Message:
o5_getStringWidth was missing getResultPos() (thanks to _Q for pointing this out)

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -d -r1.139 -r1.140
--- script_v5.cpp	31 Jul 2003 18:46:31 -0000	1.139
+++ script_v5.cpp	3 Aug 2003 18:23:54 -0000	1.140
@@ -834,12 +834,15 @@
 
 void Scumm_v5::o5_getStringWidth() {
 	// TODO - not sure if this is correct... needs testing
-	int a = getVarOrDirectByte(0x80);
-	byte *ptr = getResourceAddress(rtString, a);
-	int width = 0;
+	int string, width = 0;
+	byte *ptr;
 	
-	if (ptr)
-		width = _charset->getStringWidth(0, ptr);
+	getResultPos();
+	string = getVarOrDirectByte(0x80);
+	ptr = getResourceAddress(rtString, string);
+	assert(ptr);
+
+	width = _charset->getStringWidth(0, ptr);
 	
 	setResult(width);
 	warning("o5_getStringWidth, result %d", width);





More information about the Scummvm-git-logs mailing list