[Scummvm-cvs-logs] CVS: scummvm/scumm script_v8.cpp,2.64,2.65

Max Horn fingolfin at users.sourceforge.net
Fri Dec 27 07:39:02 CET 2002


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

Modified Files:
	script_v8.cpp 
Log Message:
almost all scripts that use o8_getStringWidth pass 1 as first parameter, but a few pass 3. So I assume this is a charset id

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.64
retrieving revision 2.65
diff -u -d -r2.64 -r2.65
--- script_v8.cpp	27 Dec 2002 15:34:26 -0000	2.64
+++ script_v8.cpp	27 Dec 2002 15:38:04 -0000	2.65
@@ -1517,9 +1517,16 @@
 
 void Scumm_v8::o8_getStringWidth()
 {
-	int a = pop();	// What is this? The first param for getStringWidth()? Or a charset id?
+	int charset = pop();
 	int len = resStrLen((char*)_scriptPointer);
-	int width = _charset->getStringWidth(0, _scriptPointer);
+	int oldID = _charset->getCurID(); 
+	int width;
+	
+	// Temporary set the specified charset id
+	_charset->setCurID(charset);
+	width = _charset->getStringWidth(0, _scriptPointer);
+	_charset->setCurID(oldID);
+	
 	push(width);
 	_scriptPointer += len + 1;
 }





More information about the Scummvm-git-logs mailing list