[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.18,2.19 charset.h,2.10,2.11 script_v5.cpp,1.47,1.48 script_v8.cpp,2.149,2.150 string.cpp,1.104,1.105

Max Horn fingolfin at users.sourceforge.net
Sun Apr 27 11:58:17 CEST 2003


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

Modified Files:
	charset.cpp charset.h script_v5.cpp script_v8.cpp string.cpp 
Log Message:
drop shadow cleanup

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.18
retrieving revision 2.19
diff -u -d -r2.18 -r2.19
--- charset.cpp	27 Apr 2003 18:30:34 -0000	2.18
+++ charset.cpp	27 Apr 2003 18:49:25 -0000	2.19
@@ -173,6 +173,15 @@
 	setCurID(oldID);
 }
 
+void CharsetRendererOld256::setColor(byte color)
+{
+	_color = color;
+	if (_vm->_features & GF_16COLOR) {
+		_dropShadow = ((_color & 0xF0) != 0);
+		_color &= 0x0f;
+	} else
+		_dropShadow = false;
+}
 
 void CharsetRendererOld256::printChar(int chr) {
 	// Indy3 / Zak256
@@ -181,13 +190,9 @@
 	unsigned int buffer = 0, mask = 0, x = 0, y = 0;
 	unsigned char color;
 
-	// FIXME: When playing with the original interpreter, Much of the
-	// text in Loom is drawn with a drop-shadow. But is it all of it, or
-	// just some? It's hard to tell with a black background.
-	bool drop_shadow = (_vm->_gameId == GID_LOOM);
 	int w, h;
 
-	if (!drop_shadow) {
+	if (!_dropShadow) {
 		w = h = 8;
 	} else {
 		w = h = 9;
@@ -221,7 +226,7 @@
 			}
 			color = ((buffer & mask) != 0);
 			if (color) {
-				if (drop_shadow)
+				if (_dropShadow)
 					*(dest_ptr + (y + 1) * _vm->_realWidth + x + 1) = 0;
 				*(dest_ptr + y * _vm->_realWidth + x) = _color;
 			}
@@ -236,7 +241,7 @@
 
 	if (_left > _strRight) {
 		_strRight = _left;
-		if (drop_shadow)
+		if (_dropShadow)
 			_strRight++;
 	}
 

Index: charset.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -d -r2.10 -r2.11
--- charset.h	7 Apr 2003 14:38:25 -0000	2.10
+++ charset.h	27 Apr 2003 18:49:26 -0000	2.11
@@ -37,8 +37,11 @@
 	int _right;
 	int _nbChars;
 
+protected:
 	byte _color;
+	bool _dropShadow;
 
+public:
 	bool _center;
 	bool _hasMask;
 	bool _ignoreCharsetMask;
@@ -53,7 +56,7 @@
 	virtual int getCharWidth(byte chr) = 0;
 
 public:
-	CharsetRenderer(Scumm *vm) : _vm(vm) {}
+	CharsetRenderer(Scumm *vm) : _vm(vm) { _dropShadow = false; }
 	virtual ~CharsetRenderer() {}
 
 	virtual void printChar(int chr) = 0;
@@ -65,6 +68,8 @@
 	int getCurID() { return _curId; }
 	
 	virtual int getFontHeight() = 0;
+	
+	virtual void setColor(byte color) { _color = color; }
 };
 
 class CharsetRendererCommon : public CharsetRenderer {
@@ -101,6 +106,8 @@
 	CharsetRendererOld256(Scumm *vm) : CharsetRendererCommon(vm) {}
 	
 	void printChar(int chr);
+	
+	void setColor(byte color);
 };
 
 class CharsetRendererNut : public CharsetRenderer {

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- script_v5.cpp	27 Apr 2003 18:30:35 -0000	1.47
+++ script_v5.cpp	27 Apr 2003 18:49:26 -0000	1.48
@@ -451,8 +451,6 @@
 			break;
 		case 12:										/* talk color */
 			a->talkColor = getVarOrDirectByte(0x80);
-			if (_features & GF_16COLOR)
-				a->talkColor &= 0x0f;	// FIXME
 			break;
 		case 13:										/* name */
 			loadPtrToResource(rtActorName, a->number, NULL);
@@ -2405,8 +2403,6 @@
 			break;
 		case 1:										/* color */
 			_string[textSlot].color = getVarOrDirectByte(0x80);
-			if (_features & GF_16COLOR)
-				_string[textSlot].color &= 0x0f;	// FIXME
 			break;
 		case 2:										/* clipping */
 			_string[textSlot].right = getVarOrDirectWord(0x80);

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.149
retrieving revision 2.150
diff -u -d -r2.149 -r2.150
--- script_v8.cpp	26 Apr 2003 13:28:33 -0000	2.149
+++ script_v8.cpp	27 Apr 2003 18:49:26 -0000	2.150
@@ -587,7 +587,7 @@
 		_charset->_startLeft = _charset->_left = _blastTextQueue[i].xpos;
 		_charset->_right = _realWidth - 1;
 		_charset->_center = _blastTextQueue[i].center;
-		_charset->_color = _blastTextQueue[i].color;
+		_charset->setColor(_blastTextQueue[i].color);
 		_charset->_disableOffsX = _charset->_firstChar = true;
 		_charset->setCurID(_blastTextQueue[i].charset);
 		_charset->_nextLeft = _blastTextQueue[i].xpos;

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- string.cpp	27 Apr 2003 18:30:32 -0000	1.104
+++ string.cpp	27 Apr 2003 18:49:27 -0000	1.105
@@ -143,7 +143,7 @@
 
 	_charset->_center = _string[0].center;
 	_charset->_right = _string[0].right;
-	_charset->_color = _charsetColor;
+	_charset->setColor(_charsetColor);
 
 	if (!(_features & GF_AFTER_V3))	// FIXME
 		for (i = 0; i < 4; i++)
@@ -301,9 +301,9 @@
 			color = *buffer++;
 			color |= *buffer++ << 8;
 			if (color == 0xFF)
-				_charset->_color = _charsetColor;
+				_charset->setColor(_charsetColor);
 			else
-				_charset->_color = color;
+				_charset->setColor(color);
 			break;
 		case 13:
 			buffer += 2;
@@ -356,7 +356,7 @@
 	_charset->_startLeft = _charset->_left = _string[0].xpos;
 	_charset->_right = _realWidth - 1;
 	_charset->_center = _string[0].center;
-	_charset->_color = _string[0].color;
+	_charset->setColor(_string[0].color);
 	_charset->_disableOffsX = _charset->_firstChar = true;
 	_charset->setCurID(_string[0].charset);
 	_charset->_nextLeft = _string[0].xpos;
@@ -410,7 +410,7 @@
 	_charset->_startLeft = _charset->_left = _string[a].xpos;
 	_charset->_right = _string[a].right;
 	_charset->_center = _string[a].center;
-	_charset->_color = _string[a].color;
+	_charset->setColor(_string[a].color);
 	_charset->_disableOffsX = _charset->_firstChar = true;
 	_charset->setCurID(_string[a].charset);
 
@@ -479,9 +479,9 @@
 				color = buf[i] + (buf[i + 1] << 8);
 				i += 2;
 				if (color == 0xFF)
-					_charset->_color = _string[a].color;
+					_charset->setColor(_string[a].color);
 				else
-					_charset->_color = color;
+					_charset->setColor(color);
 				break;
 			}
 		} else {





More information about the Scummvm-git-logs mailing list