From ceca6a82f1f64c3a9e950628e1930f5f18aceb23 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Fri, 6 Jul 2007 12:53:58 +0000 Subject: Added Amiga-style mouse cursor. Used with Amiga-render mode. svn-id: r27938 --- engines/agi/graphics.cpp | 43 +++++++++++++++++++++++++++++++++++++++---- engines/agi/graphics.h | 2 +- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index 2e32fc49ed..aa9b1a315c 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -746,9 +746,44 @@ static const byte sciMouseCursorPalette[] = { 0xFF, 0xFF, 0xFF, 0x00 // White }; -void GfxMgr::setCursor() { - CursorMan.replaceCursorPalette(sciMouseCursorPalette, 1, ARRAYSIZE(sciMouseCursorPalette) / 4); - CursorMan.replaceCursor(sciMouseCursor, 11, 16, 1, 1, 0); +/** + * An Amiga-style arrow cursor (8x11). + * 0 = Transparent. + * 1 = Black (#000000 in 24-bit RGB). + * 2 = Red (#DE2021 in 24-bit RGB). + * 3 = Light red (#FFCFAD in 24-bit RGB). + */ +static const byte amigaMouseCursor[] = { + 2,3,1,0,0,0,0,0, + 2,2,3,1,0,0,0,0, + 2,2,2,3,1,0,0,0, + 2,2,2,2,3,1,0,0, + 2,2,2,2,2,3,1,0, + 2,2,2,2,2,2,3,1, + 2,0,2,2,3,1,0,0, + 0,0,0,2,3,1,0,0, + 0,0,0,2,2,3,1,0, + 0,0,0,0,2,3,1,0, + 0,0,0,0,2,2,3,1 +}; + +/** + * RGBA-palette for the Amiga-style arrow cursor. + */ +static const byte amigaMouseCursorPalette[] = { + 0x00, 0x00, 0x00, 0x00, // Black + 0xDE, 0x20, 0x21, 0x00, // Red + 0xFF, 0xCF, 0xAD, 0x00 // Light red +}; + +void GfxMgr::setCursor(bool amigaStyleCursor) { + if (!amigaStyleCursor) { + CursorMan.replaceCursorPalette(sciMouseCursorPalette, 1, ARRAYSIZE(sciMouseCursorPalette) / 4); + CursorMan.replaceCursor(sciMouseCursor, 11, 16, 1, 1, 0); + } else { // amigaStyleCursor + CursorMan.replaceCursorPalette(amigaMouseCursorPalette, 1, ARRAYSIZE(amigaMouseCursorPalette) / 4); + CursorMan.replaceCursor(amigaMouseCursor, 8, 11, 1, 1, 0); + } } /** @@ -767,7 +802,7 @@ int GfxMgr::initVideo() { gfxSetPalette(); - setCursor(); + setCursor(_vm->_renderMode == Common::kRenderAmiga); return errOK; } diff --git a/engines/agi/graphics.h b/engines/agi/graphics.h index e5ab976b42..b1f9c0e1d7 100644 --- a/engines/agi/graphics.h +++ b/engines/agi/graphics.h @@ -87,7 +87,7 @@ public: void putPixel(int, int, int); void putBlock(int x1, int y1, int x2, int y2); void gfxSetPalette(); - void setCursor(); + void setCursor(bool amigaStyleCursor = false); int keypress(); int getKey(); -- cgit v1.2.3