diff options
| author | Max Horn | 2006-09-18 21:31:59 +0000 | 
|---|---|---|
| committer | Max Horn | 2006-09-18 21:31:59 +0000 | 
| commit | 3313685bfea0d911a8cfbf46cec2e75fb01690a0 (patch) | |
| tree | 6e5b6b31161fd4a8e20ea8705dc2ae3abf9591be /engines/scumm/cursor.cpp | |
| parent | 13246773955961d761f3e757da0888a0a203703c (diff) | |
| download | scummvm-rg350-3313685bfea0d911a8cfbf46cec2e75fb01690a0.tar.gz scummvm-rg350-3313685bfea0d911a8cfbf46cec2e75fb01690a0.tar.bz2 scummvm-rg350-3313685bfea0d911a8cfbf46cec2e75fb01690a0.zip  | |
Split setBuiltinCursor into a V0-V2 and a V3-V5 part
svn-id: r23935
Diffstat (limited to 'engines/scumm/cursor.cpp')
| -rw-r--r-- | engines/scumm/cursor.cpp | 36 | 
1 files changed, 21 insertions, 15 deletions
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 63967871f0..eae695ad29 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -361,7 +361,7 @@ void ScummEngine_v5::redefineBuiltinCursorHotspot(int index, int x, int y) {  	_cursorHotspots[index * 2 + 1] = y;  } -void ScummEngine_v5::setBuiltinCursor(int idx) { +void ScummEngine_v2::setBuiltinCursor(int idx) {  	int i, j;  	byte color; @@ -389,7 +389,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) {  				*dst++ = palette[((c0 >> (7 - j)) & 1) | (((c1 >> (7 - j)) & 1) << 1) | ((idx == 3) ? 4 : 0)];  		} -	} else if (_game.version <= 2 && _game.platform == Common::kPlatformAmiga) { +	} else if (_game.platform == Common::kPlatformAmiga) {  		_cursor.width = 15;  		_cursor.height = 15;  		_cursor.hotspotX = 7; @@ -418,7 +418,7 @@ void ScummEngine_v5::setBuiltinCursor(int idx) {  			*(hotspot - _cursor.width * (3 + i) + i) = color;  			*(hotspot + _cursor.width * (3 + i) + i) = color;  		} -	} else if (_game.version <= 2) { +	} else {  		_cursor.width = 23;  		_cursor.height = 21;  		_cursor.hotspotX = 11; @@ -463,21 +463,27 @@ void ScummEngine_v5::setBuiltinCursor(int idx) {  		*(hotspot - (_cursor.width * 5) + 1) = color;  		*(hotspot + (_cursor.width * 5) - 1) = color;  		*(hotspot + (_cursor.width * 5) + 1) = color; -	} else { -		const uint16 *src; +	} -		_cursor.hotspotX = _cursorHotspots[2 * _currentCursor]; -		_cursor.hotspotY = _cursorHotspots[2 * _currentCursor + 1]; -		src = _cursorImages[_currentCursor]; +	updateCursor(); +} + +void ScummEngine_v5::setBuiltinCursor(int idx) { +	int i, j; +	byte color = default_cursor_colors[idx]; +	const uint16 *src = _cursorImages[_currentCursor]; + +	memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor)); -		_cursor.width = 16; -		_cursor.height = 16; +	_cursor.hotspotX = _cursorHotspots[2 * _currentCursor]; +	_cursor.hotspotY = _cursorHotspots[2 * _currentCursor + 1]; +	_cursor.width = 16; +	_cursor.height = 16; -		for (i = 0; i < 16; i++) { -			for (j = 0; j < 16; j++) { -				if (src[i] & (1 << j)) -					_grabbedCursor[16 * i + 15 - j] = color; -			} +	for (i = 0; i < 16; i++) { +		for (j = 0; j < 16; j++) { +			if (src[i] & (1 << j)) +				_grabbedCursor[16 * i + 15 - j] = color;  		}  	}  | 
