From 24da0a245c11d7ff6ac1d331610d6879e12beb71 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Mon, 12 Aug 2019 12:57:35 +0530 Subject: HDB: Add PPC cursor --- engines/hdb/gfx.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index e44b96e835..869790b316 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -24,6 +24,9 @@ #include "common/sinetables.h" #include "common/random.h" #include "common/memstream.h" +#include "graphics/cursor.h" +#include "graphics/wincursor.h" +#include "graphics/cursorman.h" #include "hdb/hdb.h" #include "hdb/ai.h" @@ -87,6 +90,14 @@ bool Gfx::init() { // Set the default cursor pos & char clipping setCursor(0, 0); + if (g_hdb->isPPC()) { + Graphics::Cursor *cursor = Graphics::makeDefaultWinCursor(); + + CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), cursor->getKeyColor()); + CursorMan.replaceCursorPalette(cursor->getPalette(), cursor->getPaletteStartIndex(), cursor->getPaletteCount()); + delete cursor; + } + _eLeft = 0; _eRight = g_hdb->_screenWidth; _eTop = 0; @@ -289,11 +300,12 @@ void Gfx::drawPointer() { return; // If we are in game and the cursor should be displayed, draw it - if (g_hdb->isPPC()) { - debug(9, "STUB: Draw Pointer in PPC"); - } else { - if (_showCursor || g_hdb->getGameState() != GAME_PLAY) + if (_showCursor || g_hdb->getGameState() != GAME_PLAY) { + if (g_hdb->isPPC()) { + CursorMan.showMouse(true); + } else { _mousePointer[anim]->drawMasked(g_hdb->_input->getMouseX() - 16, g_hdb->_input->getMouseY() - 16); + } } } -- cgit v1.2.3