diff options
author | Nipun Garg | 2019-06-28 20:55:12 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:03 +0200 |
commit | 40b23d122d699b9f3bf683ac76bd850af4bf024e (patch) | |
tree | 0c2a20852baa60b3e255dc31f79339719dbe16d3 /engines/hdb | |
parent | 105abf54295f44ff346f6b1d33bafa873b1d5417 (diff) | |
download | scummvm-rg350-40b23d122d699b9f3bf683ac76bd850af4bf024e.tar.gz scummvm-rg350-40b23d122d699b9f3bf683ac76bd850af4bf024e.tar.bz2 scummvm-rg350-40b23d122d699b9f3bf683ac76bd850af4bf024e.zip |
HDB: Add Pointer functions
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/draw-manager.cpp | 22 | ||||
-rw-r--r-- | engines/hdb/draw-manager.h | 8 |
2 files changed, 30 insertions, 0 deletions
diff --git a/engines/hdb/draw-manager.cpp b/engines/hdb/draw-manager.cpp index 57585ca7d0..1b53a5e5d6 100644 --- a/engines/hdb/draw-manager.cpp +++ b/engines/hdb/draw-manager.cpp @@ -146,6 +146,28 @@ void DrawMan::updateVideo() { debug(9, "STUB: DrawMan::updateVideo incomplete"); } +void DrawMan::drawPointer() { + static int anim = 0; + static uint32 animTime = 0; + + if (animTime < g_system->getMillis()) { + animTime = g_system->getMillis() + 50; + anim = (anim + 1) & 7; + } + + // If pointer is not displayable and we are in game, exit + if (!_pointerDisplayable && g_hdb->getGameState() == GAME_PLAY) + return; + + // If we are in game and the cursor should be displayed, draw it + if (_showCursor || g_hdb->getGameState() != GAME_PLAY) + _mousePointer[anim]->drawMasked(g_hdb->_input->getMouseX() - 16, g_hdb->_input->getMouseY() - 16); +} + +void DrawMan::setPointerState(int value) { + _pointerDisplayable = value; +} + void DrawMan::setFade(bool fadeIn, bool black, int steps) { _fadeInfo.isFadeIn = fadeIn; _fadeInfo.isBlack = black; diff --git a/engines/hdb/draw-manager.h b/engines/hdb/draw-manager.h index 9f05b31c26..1ace112993 100644 --- a/engines/hdb/draw-manager.h +++ b/engines/hdb/draw-manager.h @@ -93,6 +93,14 @@ public: bool init(); void fillScreen(uint32 color); void updateVideo(); + void setPointerState(int value); + void drawPointer(); + void showPointer(bool status) { + _showCursor = status; + } + bool getPointer() { + return _showCursor; + } void setFade(bool fadeIn, bool black, int steps); void updateFade(); |