[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.h,1.63,1.64 string.cpp,1.47,1.48

Max Horn fingolfin at users.sourceforge.net
Tue Nov 26 04:43:05 CET 2002


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

Modified Files:
	scumm.h string.cpp 
Log Message:
cleanup

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- scumm.h	10 Nov 2002 17:19:43 -0000	1.63
+++ scumm.h	26 Nov 2002 12:42:40 -0000	1.64
@@ -199,10 +199,9 @@
 	int _xpos2, _ypos2;
 	
 	int _bufPos;
-	byte _unk12, _disableOffsX;
-	byte *_ptr;	// FIXME: This field is *NOT* used - remove next time save game format changes
-	byte _unk2, _bpp;
-	byte _invNumBits;
+	bool _firstChar;
+	bool _disableOffsX;
+	byte _bpp;
 	uint32 _charOffs;
 	byte *_charPtr;
 	int _width, _height;

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- string.cpp	20 Nov 2002 13:58:23 -0000	1.47
+++ string.cpp	26 Nov 2002 12:42:40 -0000	1.48
@@ -322,7 +322,7 @@
 			charset._xpos2 = 0;
 	}
 
-	charset._disableOffsX = charset._unk12 = !_keepText;
+	charset._disableOffsX = charset._firstChar = !_keepText;
 
 	do {
 		c = *buffer++;
@@ -348,7 +348,7 @@
 					charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[30 - 12];
 				else
 					charset._ypos2 += getResourceAddress(rtCharset, charset._curId)[30];
-				charset._disableOffsX = 1;
+				charset._disableOffsX = true;
 				continue;
 			}
 		}
@@ -481,7 +481,7 @@
 	charset._right = _realWidth - 1;
 	charset._xpos2 = _string[0].xpos;
 	charset._ypos2 = _string[0].ypos;
-	charset._disableOffsX = charset._unk12 = 1;
+	charset._disableOffsX = charset._firstChar = true;
 	charset._curId = 3;
 	charset._center = false;
 	charset._color = 15;
@@ -539,7 +539,7 @@
 	if (charset._xpos2 < 0)
 		charset._xpos2 = 0;
 
-	charset._disableOffsX = charset._unk12 = 1;
+	charset._disableOffsX = charset._firstChar = true;
 	_bkColor = 0;
 	_talkDelay = 1;
 
@@ -585,8 +585,7 @@
 	charset._right = _string[a].right;
 	charset._color = _string[a].color;
 	_bkColor = 0;
-	charset._unk12 = 1;
-	charset._disableOffsX = 1;
+	charset._disableOffsX = charset._firstChar = true;
 
 	if (!(_features & GF_OLD256)) {
 		charsetptr = getResourceAddress(rtCharset, charset._curId);
@@ -654,7 +653,7 @@
 			case 1:
 			case 8:
 				if (charset._center) {
-					charset._left = charset._left2 - charset.getStringWidth(a, buf, i);
+					charset._left = charset._left2 - charset.getStringWidth(a, buf, i);	// FIXME - shouldn't this be getStringWidth() / 2 ?!?
 				} else {
 					charset._left = charset._left2;
 				}
@@ -900,18 +899,16 @@
 	if (chr == '@')
 		return;
 
-	byte *ptr = _vm->getResourceAddress(rtCharset, _curId) + 29;
-	if (_vm->_features & GF_SMALL_HEADER)
-		ptr -= 12;
+	byte *ptr = _vm->getResourceAddress(rtCharset, _curId);
 
-	if (_unk12) {
+	if (_firstChar) {
 		_strLeft = _left;
 		_strTop = _top;
 		_strRight = _left;
 		_strBottom = _top;
-		_unk12 = 0;
+		_firstChar = false;
 	}
-	char_ptr = _vm->getResourceAddress(rtCharset, _curId) + 224 + (chr + 1) * 8;
+	char_ptr = ptr + 224 + (chr + 1) * 8;
 	dest_ptr = vs->screenPtr + vs->xstart + (_top - vs->topline) * _vm->_realWidth + _left;
 	_vm->updateDirtyRect(vs->number, _left, _left + 8, _top - vs->topline, _top - vs->topline + 8, 0);
 
@@ -928,7 +925,7 @@
 	}
 
 	// FIXME
-	_left += getSpacing(chr, ptr);
+	_left += getSpacing(chr, ptr + 29 - 12);
 
 	if (_left > _strRight)
 		_strRight = _left;
@@ -956,8 +953,7 @@
 	if (_vm->_features & GF_SMALL_HEADER)
 		ptr -= 12;
 
-	_bpp = _unk2 = *ptr;
-	_invNumBits = 8 - _bpp;
+	_bpp = *ptr;
 	_colorMap[1] = _color;
 
 	_charOffs = READ_LE_UINT32(ptr + chr * 4 + 4);
@@ -971,7 +967,7 @@
 
 	_width = _charPtr[0];
 	_height = _charPtr[1];
-	if (_unk12) {
+	if (_firstChar) {
 		_strLeft = 0;
 		_strTop = 0;
 		_strRight = 0;
@@ -1003,14 +999,14 @@
 		return;
 	}
 
-	_disableOffsX = 0;
+	_disableOffsX = true;
 
-	if (_unk12) {
+	if (_firstChar) {
 		_strLeft = _left;
 		_strTop = _top;
 		_strRight = _left;
 		_strBottom = _top;
-		_unk12 = 0;
+		_firstChar = false;
 	}
 
 	if (_left < _strLeft)
@@ -1083,7 +1079,7 @@
 		maskpos = 0;
 
 		for (x = 0; x < _width; x++) {
-			color = (bits >> _invNumBits) & 0xFF;
+			color = (bits >> (8 - _bpp)) & 0xFF;
 			if (color) {
 				if (usemask) {
 					mask[maskpos] |= maskmask;





More information about the Scummvm-git-logs mailing list