[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.1,2.2 charset.h,2.1,2.2 string.cpp,1.62,1.63

Max Horn fingolfin at users.sourceforge.net
Wed Dec 25 13:15:03 CET 2002


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

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

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -d -r2.1 -r2.2
--- charset.cpp	25 Dec 2002 21:04:47 -0000	2.1
+++ charset.cpp	25 Dec 2002 21:14:26 -0000	2.2
@@ -225,6 +225,7 @@
 void CharsetRenderer::printChar(int chr)
 {
 	int width, height;
+	int offsX, offsY;
 	int d;
 	VirtScreen *vs;
 
@@ -239,14 +240,14 @@
 	_bpp = *_fontPtr;
 	_colorMap[1] = _color;
 
-	_charOffs = READ_LE_UINT32(_fontPtr + chr * 4 + 4);
+	uint32 charOffs = READ_LE_UINT32(_fontPtr + chr * 4 + 4);
 
-	if (!_charOffs)
+	if (!charOffs)
 		return;
 
-	assert(_charOffs < 0x10000);
+	assert(charOffs < 0x10000);
 
-	_charPtr = _fontPtr + _charOffs;
+	_charPtr = _fontPtr + charOffs;
 
 	width = _charPtr[0];
 	height = _charPtr[1];
@@ -258,25 +259,25 @@
 	}
 
 	if (_disableOffsX) {
-		_offsX = 0;
+		offsX = 0;
 	} else {
 		d = _charPtr[2];
 		if (d >= 0x80)
 			d -= 0x100;
-		_offsX = d;
+		offsX = d;
 	}
 
 	d = _charPtr[3];
 	if (d >= 0x80)
 		d -= 0x100;
-	_offsY = d;
+	offsY = d;
 
-	_top += _offsY;
-	_left += _offsX;
+	_top += offsY;
+	_left += offsX;
 
 	if (_left + width > _right + 1 || _left < 0) {
 		_left += width;
-		_top -= _offsY;
+		_top -= offsY;
 		return;
 	}
 
@@ -299,7 +300,7 @@
 	int drawTop = _top - vs->topline;
 	if (drawTop < 0)
 		drawTop = 0;
-	int bottom = drawTop + height + _offsY;
+	int bottom = drawTop + height + offsY;
 
 	_vm->updateDirtyRect(vs->number, _left, _left + width, drawTop, bottom, 0);
 
@@ -334,7 +335,7 @@
 	if (_top + height > _strBottom)
 		_strBottom = _top + height;
 
-	_top -= _offsY;
+	_top -= offsY;
 }
 
 void CharsetRenderer::drawBits(VirtScreen *vs, byte *dst, byte *mask, int drawTop, int width, int height)

Index: charset.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -d -r2.1 -r2.2
--- charset.h	25 Dec 2002 21:04:47 -0000	2.1
+++ charset.h	25 Dec 2002 21:14:26 -0000	2.2
@@ -33,19 +33,19 @@
 
 	int _top;
 	int _left, _startLeft;
-	byte _center;
 	int _right;
+
 	byte _color;
+	byte _colorMap[16];
+
+	bool _center;
 	bool _hasMask;
+	bool _ignoreCharsetMask;
 	bool _blitAlso;
-	
-	int _bufPos;
 	bool _firstChar;
 	bool _disableOffsX;
 
-	bool _ignoreCharsetMask;
-
-	byte _colorMap[16];
+	int _bufPos;
 	byte _buffer[512];	// TODO - would be really nice to get rid of this
 
 protected:
@@ -55,9 +55,7 @@
 	byte *_fontPtr;
 
 	byte _bpp;
-	uint32 _charOffs;
 	byte *_charPtr;
-	int _offsX, _offsY;
 
 	void drawBits(VirtScreen *vs, byte *dst, byte *mask, int drawTop, int width, int height);
 

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- string.cpp	25 Dec 2002 21:04:47 -0000	1.62
+++ string.cpp	25 Dec 2002 21:14:26 -0000	1.63
@@ -242,13 +242,13 @@
 		if (c != 0xFF) {
 			_charset->_left = _charset->_nextLeft;
 			_charset->_top = _charset->_nextTop;
-			if (_features & GF_OLD256)
+			if (_features & GF_OLD256) {
 				_charset->printCharOld(c);
-			else if (!(_features & GF_AFTER_V6)) {
-				if (!(_haveMsg == 0xFE && _noSubtitles))
+			} else if (_features & GF_AFTER_V6) {
+				if (!_noSubtitles || (_haveMsg != 0xFE && _haveMsg != 0xFF))
 					_charset->printChar(c);
 			} else {
-				if (!((_haveMsg == 0xFE || _haveMsg == 0xFF) && _noSubtitles))
+				if (!_noSubtitles || _haveMsg != 0xFE)
 					_charset->printChar(c);
 			}
 





More information about the Scummvm-git-logs mailing list