diff options
author | Eugene Sandulenko | 2005-03-17 02:55:20 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-03-17 02:55:20 +0000 |
commit | 1abab501239ce856f8b2986dd8126837b19de9b0 (patch) | |
tree | 96f376eb54b5fb6c4ee12aecef6b82b4b8b8e77c | |
parent | d99d4d09f259c1ce6e679c4e5b09eaf0e6014694 (diff) | |
download | scummvm-rg350-1abab501239ce856f8b2986dd8126837b19de9b0.tar.gz scummvm-rg350-1abab501239ce856f8b2986dd8126837b19de9b0.tar.bz2 scummvm-rg350-1abab501239ce856f8b2986dd8126837b19de9b0.zip |
Tile-based NES cursor for MM NES.
svn-id: r17169
-rw-r--r-- | scumm/cursor.cpp | 24 | ||||
-rw-r--r-- | scumm/palette.cpp | 5 |
2 files changed, 27 insertions, 2 deletions
diff --git a/scumm/cursor.cpp b/scumm/cursor.cpp index 3d032098ef..8fce49b22e 100644 --- a/scumm/cursor.cpp +++ b/scumm/cursor.cpp @@ -107,7 +107,8 @@ void ScummEngine_v6::setCursorTransparency(int a) { void ScummEngine::updateCursor() { _system->setMouseCursor(_grabbedCursor, _cursor.width, _cursor.height, - _cursor.hotspotX, _cursor.hotspotY, 255, + _cursor.hotspotX, _cursor.hotspotY, + (_features & GF_NES ? 0x40 : 255), (_heversion == 70 ? 2 : 1)); } @@ -335,7 +336,26 @@ void ScummEngine_v5::setBuiltinCursor(int idx) { else color = default_cursor_colors[idx]; - if (_version <= 2) { + if (_features & GF_NES) { + _cursor.width = 8; + _cursor.height = 8; + _cursor.hotspotX = 0; + _cursor.hotspotY = 0; + + byte *dst = _grabbedCursor; + byte *src = &_NESCostumeGfx[0][0xfa * 16]; + + // Cursor uses colors 0-2, which are differ from room to room + // Instead of remapping, we shift it 0x40 colors up (beyond NES + // palette) and specify those colors in setupNESPalette() + for (i = 0; i < 8; i++) { + byte c0 = src[i]; + byte c1 = src[i + 8]; + for (j = 0; j < 8; j++) + *dst++ = ((c0 >> (7 - j)) & 1) | (((c1 >> (7 - j)) & 1) << 1) + 0x40; + } + + } else if (_version <= 2) { _cursor.width = 23; _cursor.height = 21; _cursor.hotspotX = 11; diff --git a/scumm/palette.cpp b/scumm/palette.cpp index 411b4067a3..28036b3eab 100644 --- a/scumm/palette.cpp +++ b/scumm/palette.cpp @@ -97,6 +97,11 @@ void ScummEngine::setupNESPalette() { setPalColor(0x3D,0x00,0x00,0x00); setPalColor(0x3E,0x00,0x00,0x00); setPalColor(0x3F,0x00,0x00,0x00); + + // We use it for cursor. 0x40 is transparent + setPalColor(0x40, 0x00, 0x00, 0x00); + setPalColor(0x41, 0x00, 0x00, 0x00); + setPalColor(0x42, 0xff, 0xff, 0xff); } void ScummEngine::setupAmigaPalette() { |