[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.380,2.381 script_v7he.cpp,2.128,2.129
kirben
kirben at users.sourceforge.net
Tue Mar 1 23:01:37 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14922/scumm
Modified Files:
intern.h script_v7he.cpp
Log Message:
Fix string display in Buzzy games.
Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.380
retrieving revision 2.381
diff -u -d -r2.380 -r2.381
--- intern.h 28 Feb 2005 20:19:56 -0000 2.380
+++ intern.h 2 Mar 2005 07:00:42 -0000 2.381
@@ -661,6 +661,7 @@
virtual void redrawBGAreas();
+ int getStringCharWidth(byte chr);
virtual int setupStringArray(int size);
void appendSubstring(int dst, int src, int len2, int len);
Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.128
retrieving revision 2.129
diff -u -d -r2.128 -r2.129
--- script_v7he.cpp 22 Feb 2005 13:51:59 -0000 2.128
+++ script_v7he.cpp 2 Mar 2005 07:00:42 -0000 2.129
@@ -375,6 +375,24 @@
return _opcodesv70he[i].desc;
}
+int ScummEngine_v70he::getStringCharWidth(byte chr) {
+ int charset = _string[0]._default.charset;
+
+ byte *ptr = getResourceAddress(rtCharset, charset);
+ if (ptr == 0)
+ error("getStringCharWidth::charset %d not found!", charset);
+ ptr += 29;
+
+ int spacing = 0;
+
+ int offs = READ_LE_UINT32(ptr + chr * 4 + 4);
+ if (offs) {
+ spacing = ptr[offs] + (signed char)ptr[offs + 2];
+ }
+
+ return spacing;
+}
+
int ScummEngine_v70he::setupStringArray(int size) {
writeVar(0, 0);
defineArray(0, kStringArray, 0, size + 1);
@@ -752,7 +770,7 @@
chr = readArray(0, 0, pos);
if (chr == 0)
break;
- width += _charset->getCharWidth(chr);
+ width += getStringCharWidth(chr);
pos++;
}
@@ -977,7 +995,7 @@
writeVar(0, array);
while (pos <= len) {
chr = readArray(0, 0, pos);
- width += _charset->getCharWidth(chr);
+ width += getStringCharWidth(chr);
if (width >= max) {
push(pos);
return;
More information about the Scummvm-git-logs
mailing list