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 | |
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
-rw-r--r-- | engines/scumm/cursor.cpp | 36 | ||||
-rw-r--r-- | engines/scumm/intern.h | 4 |
2 files changed, 24 insertions, 16 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; } } diff --git a/engines/scumm/intern.h b/engines/scumm/intern.h index 347729ea60..716c1a9691 100644 --- a/engines/scumm/intern.h +++ b/engines/scumm/intern.h @@ -85,7 +85,7 @@ protected: virtual void animateCursor(); - void setBuiltinCursor(int index); + virtual void setBuiltinCursor(int index); void redefineBuiltinCursorFromChar(int index, int chr); void redefineBuiltinCursorHotspot(int index, int x, int y); @@ -314,6 +314,8 @@ protected: void initV2MouseOver(); void initNESMouseOver(); + virtual void setBuiltinCursor(int index); + void runObject(int obj, int entry); /* Version 2 script opcodes */ |