From 568ec34994873779eecd5f36e7e09e6a7d6c7878 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Sat, 29 Jun 2019 02:05:40 +0530 Subject: HDB: Add drawPause() and checkPause() --- engines/hdb/window.cpp | 12 ++++++++++++ engines/hdb/window.h | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/engines/hdb/window.cpp b/engines/hdb/window.cpp index ba7575c688..5532ccd466 100644 --- a/engines/hdb/window.cpp +++ b/engines/hdb/window.cpp @@ -96,6 +96,18 @@ void Window::setInfobarDark(int value) { _infobarDimmed = value; } +void Window::drawPause() { + if (g_hdb->getPause()) + _gfxPausePlaque->drawMasked(480 / 2 - _gfxPausePlaque->_width / 2, kPauseY); +} + +void Window::checkPause(uint x, uint y) { + if (x >= 480 / 2 - _gfxPausePlaque->_width / 2 && 480 / 2 + _gfxPausePlaque->_width / 2 > x && y >= kPauseY && y < kPauseY + _gfxPausePlaque->_height) { + g_hdb->togglePause(); + warning("STUB: checkPause: Play SND_POP"); + } +} + void Window::openDialog(const char *title, int tileIndex, const char *string, int more, const char *luaMore) { if (_dialogInfo.active) return; diff --git a/engines/hdb/window.h b/engines/hdb/window.h index 27e37420d2..b017c4c8fd 100644 --- a/engines/hdb/window.h +++ b/engines/hdb/window.h @@ -33,7 +33,8 @@ enum { kInvItemSpaceX = 48, kInvItemSpaceY = 40, kInvItemPerLine = 3, - kTextOutCenterX = ((kScreenWidth - kTileWidth * 5) / 2) + kTextOutCenterX = ((kScreenWidth - kTileWidth * 5) / 2), + kPauseY = (kScreenHeight / 2 - 64) }; struct DialogInfo { @@ -77,6 +78,10 @@ public: void restartSystem(); void setInfobarDark(int value); + // Pause Functions + void drawPause(); + void checkPause(uint x, uint y); + // Dialog Functions void openDialog(const char *title, int tileIndex, const char *string, int more, const char *luaMore); -- cgit v1.2.3