From ed45ee5a0503b39f8612faeb762da1238c62588c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 17 Mar 2005 03:20:25 +0000 Subject: NES cursor fixes from Quitetust. No need to use separate palette. svn-id: r17170 --- scumm/cursor.cpp | 8 +++----- scumm/palette.cpp | 5 ----- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/scumm/cursor.cpp b/scumm/cursor.cpp index 8fce49b22e..f283a37e01 100644 --- a/scumm/cursor.cpp +++ b/scumm/cursor.cpp @@ -108,7 +108,7 @@ void ScummEngine_v6::setCursorTransparency(int a) { void ScummEngine::updateCursor() { _system->setMouseCursor(_grabbedCursor, _cursor.width, _cursor.height, _cursor.hotspotX, _cursor.hotspotY, - (_features & GF_NES ? 0x40 : 255), + (_features & GF_NES ? _grabbedCursor[63] : 255), (_heversion == 70 ? 2 : 1)); } @@ -344,15 +344,13 @@ void ScummEngine_v5::setBuiltinCursor(int idx) { byte *dst = _grabbedCursor; byte *src = &_NESCostumeGfx[0][0xfa * 16]; + byte *palette = getResourceAddress(rtCostume, 35) + 2; - // 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; + *dst++ = palette[((c0 >> (7 - j)) & 1) | (((c1 >> (7 - j)) & 1) << 1) | ((idx == 3) ? 4 : 0)]; } } else if (_version <= 2) { diff --git a/scumm/palette.cpp b/scumm/palette.cpp index 28036b3eab..411b4067a3 100644 --- a/scumm/palette.cpp +++ b/scumm/palette.cpp @@ -97,11 +97,6 @@ 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() { -- cgit v1.2.3