diff options
Diffstat (limited to 'engines/agos/cursor.cpp')
-rw-r--r-- | engines/agos/cursor.cpp | 75 |
1 files changed, 74 insertions, 1 deletions
diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp index 3d4c6768a4..01d9dea9aa 100644 --- a/engines/agos/cursor.cpp +++ b/engines/agos/cursor.cpp @@ -31,6 +31,52 @@ namespace AGOS { +static const uint16 _common_cursors[7][32] = { +// Mouse Info +{ 0xC000, 0x8000, 0xE000, 0xC000, 0xF000, 0xE000, 0xF800, 0xF000, + 0xFC00, 0xF800, 0xFE00, 0xFC00, 0xFC00, 0xF000, 0x9800, 0x9000, + 0x0C00, 0x0800, 0x0C00, 0x0800, 0x0600, 0x0400, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, + +// Hand Info +{ 0x01C0, 0x01C0, 0x07F0, 0x0770, 0x07F0, 0x0550, 0x07FC, 0x055C, + 0x07FC, 0x0554, 0x3FFC, 0x3D54, 0x3FFC, 0x2554, 0x3FFE, 0x2402, + 0x1FFC, 0x1204, 0x1FFC, 0x1004, 0x0FF8, 0x0808, 0x07F8, 0x0408, + 0x03F8, 0x03F8, 0x03F8, 0x0208, 0x03F8, 0x03F8, 0x0000, 0x0000 }, + +// Sword Info +{ + 0x0000, 0x0000, 0xC000, 0x4000, 0xF000, 0x7000, 0x7800, 0x3800, + 0x3C00, 0x1C00, 0x1E00, 0x0E00, 0x0F00, 0x0700, 0x0780, 0x0380, + 0x3C6, 0x01C0, 0x01FF, 0x00E6, 0x00FE, 0x007C, 0x007C, 0x0038, + 0x0FC, 0x0078, 0x01FE, 0x00CC, 0x01CF, 0x0086, 0x0086, 0x0000 }, + +// Move Forward +{ 0x0180, 0x0100, 0x03C0, 0x0380, 0x07E0, 0x07C0, 0x0FF0, 0x0FE0, + 0x1FF8, 0x1FF0, 0x03C0, 0x0380, 0x03C0, 0x0380, 0x03C0, 0x0380, + 0x3C0, 0x0380, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, + +// Mouse Right +{ 0x00C0, 0x0080, 0x00E0, 0x00C0, 0x00F0, 0x00E0, 0x1FF8, 0x1FF0, + 0x3FFC, 0x3FF8, 0x3FF8, 0x3FF0, 0x3CF0, 0x38E0, 0x3CE0, 0x38C0, + 0x3CC0, 0x3880, 0x3C00, 0x3800, 0x3C00, 0x3800, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, + +// Mouse Back +{ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x03C0, 0x0380, 0x03C0, 0x0380, 0x03C0, 0x0380, 0x03C0, 0x0380, + 0x1FF8, 0x1FF0, 0x0FF0, 0x0FE0, 0x07E0, 0x07C0, 0x03C0, 0x0380, + 0x0180, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, + +// Move Left +{ 0x0C00, 0x0800, 0x1C00, 0x1800, 0x3C00, 0x3800, 0x7FE0, 0x7FC0, + 0xFFF0, 0xFFE0, 0x7FF0, 0x7FE0, 0x3CF0, 0x38E0, 0x1CF0, 0x18E0, + 0x0CF0, 0x08E0, 0x00F0, 0x00E0, 0x00F0, 0x00E0, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }, + +}; + #ifdef PALMOS_68K static const byte *_simon1_cursor; #else @@ -402,6 +448,10 @@ void AGOSEngine::initMouse() { _maxCursorWidth = 40; _maxCursorHeight = 40; _mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1); + } else if (getGameType() != GType_SIMON1 && getGameType() != GType_SIMON2) { + _maxCursorWidth = 16; + _maxCursorHeight = 16; + _mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1); } } @@ -418,8 +468,31 @@ void AGOSEngine::drawMousePointer() { CursorMan.replaceCursor(_mouseData, _maxCursorWidth, _maxCursorHeight, 37, 48, 0); } else if (getGameType() == GType_SIMON2) { CursorMan.replaceCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7); - } else { + } else if (getGameType() == GType_SIMON1) { CursorMan.replaceCursor(_simon1_cursor, 16, 16, 0, 0); + } else { + const uint16 *src; + int i, j; + + memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight); + + uint cursor = (_mouseCursor == 0) ? _mouseCursor : _mouseCursor - 1; + src = _common_cursors[cursor]; + + for (i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) { + if (src[0] & (1 << (15 - (j % 16)))) { + if (src[1] & (1 << (15 - (j % 16)))) { + _mouseData[16 * i + j] = 65; + } else { + _mouseData[16 * i + j] = 0; + } + } + } + src += 2; + } + + CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF); } } |