diff options
| author | Max Horn | 2003-04-27 18:49:27 +0000 | 
|---|---|---|
| committer | Max Horn | 2003-04-27 18:49:27 +0000 | 
| commit | 30ac620bd3d26304f109bdb7190cc8c120716df4 (patch) | |
| tree | 876e1b3c015c1ca6ab2312b997c11165cac89381 | |
| parent | 732d457aac9eefcdc1adb4b3b5ee5a6a2e7ea4a1 (diff) | |
| download | scummvm-rg350-30ac620bd3d26304f109bdb7190cc8c120716df4.tar.gz scummvm-rg350-30ac620bd3d26304f109bdb7190cc8c120716df4.tar.bz2 scummvm-rg350-30ac620bd3d26304f109bdb7190cc8c120716df4.zip | |
drop shadow cleanup
svn-id: r7163
| -rw-r--r-- | scumm/charset.cpp | 19 | ||||
| -rw-r--r-- | scumm/charset.h | 9 | ||||
| -rw-r--r-- | scumm/script_v5.cpp | 4 | ||||
| -rw-r--r-- | scumm/script_v8.cpp | 2 | ||||
| -rw-r--r-- | scumm/string.cpp | 14 | 
5 files changed, 28 insertions, 20 deletions
| diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 7273704847..beb6429738 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -173,6 +173,15 @@ void CharsetRenderer::addLinebreaks(int a, byte *str, int pos, int maxwidth) {  	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 @@ void CharsetRendererOld256::printChar(int chr) {  	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 @@ void CharsetRendererOld256::printChar(int chr) {  			}  			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 @@ void CharsetRendererOld256::printChar(int chr) {  	if (_left > _strRight) {  		_strRight = _left; -		if (drop_shadow) +		if (_dropShadow)  			_strRight++;  	} diff --git a/scumm/charset.h b/scumm/charset.h index e61d46bcef..baa4480649 100644 --- a/scumm/charset.h +++ b/scumm/charset.h @@ -37,8 +37,11 @@ public:  	int _right;  	int _nbChars; +protected:  	byte _color; +	bool _dropShadow; +public:  	bool _center;  	bool _hasMask;  	bool _ignoreCharsetMask; @@ -53,7 +56,7 @@ protected:  	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 @@ public:  	int getCurID() { return _curId; }  	virtual int getFontHeight() = 0; +	 +	virtual void setColor(byte color) { _color = color; }  };  class CharsetRendererCommon : public CharsetRenderer { @@ -101,6 +106,8 @@ public:  	CharsetRendererOld256(Scumm *vm) : CharsetRendererCommon(vm) {}  	void printChar(int chr); +	 +	void setColor(byte color);  };  class CharsetRendererNut : public CharsetRenderer { diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 67a283d33e..859b5c73aa 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -451,8 +451,6 @@ void Scumm_v5::o5_actorSet() {  			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 @@ void Scumm_v5::decodeParseString() {  			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); diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 43a787642a..2e8c2e37ea 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -587,7 +587,7 @@ void Scumm::drawBlastTexts() {  		_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; diff --git a/scumm/string.cpp b/scumm/string.cpp index adfd538cfc..671b64833d 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -143,7 +143,7 @@ void Scumm::CHARSET_1() {  	_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 @@ void Scumm::CHARSET_1() {  			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 @@ void Scumm::drawDescString(byte *msg) {  	_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 @@ void Scumm::drawString(int a) {  	_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 @@ void Scumm::drawString(int a) {  				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 { | 
