From 3313685bfea0d911a8cfbf46cec2e75fb01690a0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 18 Sep 2006 21:31:59 +0000 Subject: Split setBuiltinCursor into a V0-V2 and a V3-V5 part svn-id: r23935 --- engines/scumm/cursor.cpp | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'engines/scumm/cursor.cpp') 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; } } -- cgit v1.2.3