[Scummvm-cvs-logs] CVS: scummvm/scumm script_v8.cpp,2.168,2.169 debugger.cpp,1.52,1.53

Max Horn fingolfin at users.sourceforge.net
Tue May 27 08:34:10 CEST 2003


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

Modified Files:
	script_v8.cpp debugger.cpp 
Log Message:
fixed o8_getStringWidth (should fix bug #741625)

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.168
retrieving revision 2.169
diff -u -d -r2.168 -r2.169
--- script_v8.cpp	26 May 2003 22:37:18 -0000	2.168
+++ script_v8.cpp	27 May 2003 15:33:37 -0000	2.169
@@ -1696,17 +1696,27 @@
 
 void Scumm_v8::o8_getStringWidth() {
 	int charset = pop();
-	int len = resStrLen(_scriptPointer);
 	int oldID = _charset->getCurID(); 
 	int width;
+	const byte *msg = _scriptPointer;
 	
+	// Skip to the next instruction
+	_scriptPointer += resStrLen(_scriptPointer) + 1;
+
+	if (msg[0] == '/') {
+		translateText(msg, _transText);
+		msg = _transText;
+	} 
+
+
 	// Temporary set the specified charset id
-	_charset->setCurID(charset);
-	width = _charset->getStringWidth(0, _scriptPointer);
+	_charset->setCurID(_string[charset].charset);
+	// Determine the strings width
+	width = _charset->getStringWidth(0, msg);
+	// Revert to old font
 	_charset->setCurID(oldID);
-	
+
 	push(width);
-	_scriptPointer += len + 1;
 }
 
 void Scumm_v8::o8_drawObject() {

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- debugger.cpp	26 May 2003 20:49:18 -0000	1.52
+++ debugger.cpp	27 May 2003 15:33:38 -0000	1.53
@@ -524,7 +524,7 @@
 			
 bool ScummDebugger::Cmd_PrintScript(int argc, const char **argv) {
 	int i;
-	ScriptSlot *ss = &_s->vm.slot[0];
+	ScriptSlot *ss = _s->vm.slot;
 	Debug_Printf("+--------------------------------------+\n");
 	Debug_Printf("|# | num | offset|sta|typ|fr|rec|fc|cut|\n");
 	Debug_Printf("+--+-----+-------+---+---+--+--+---+---+\n");





More information about the Scummvm-git-logs mailing list