diff options
author | Eugene Sandulenko | 2019-10-04 22:32:24 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-10-04 22:32:24 +0200 |
commit | c17800cfc4f09cebcfb90aea07f94c8f107b3e9d (patch) | |
tree | a83d7befbd266cb2270802e37e86d9d7a0816646 /graphics/macgui | |
parent | 15ac5da3a3a080c084bc72e376c68a88797a4f06 (diff) | |
download | scummvm-rg350-c17800cfc4f09cebcfb90aea07f94c8f107b3e9d.tar.gz scummvm-rg350-c17800cfc4f09cebcfb90aea07f94c8f107b3e9d.tar.bz2 scummvm-rg350-c17800cfc4f09cebcfb90aea07f94c8f107b3e9d.zip |
GRAPHICS: MACGUI: Add possibility to setup engine redraw callback
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/macmenu.cpp | 5 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.cpp | 24 | ||||
-rw-r--r-- | graphics/macgui/macwindowmanager.h | 5 |
3 files changed, 27 insertions, 7 deletions
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp index 946161f5ee..d4543e3cfc 100644 --- a/graphics/macgui/macmenu.cpp +++ b/graphics/macgui/macmenu.cpp @@ -854,6 +854,7 @@ bool MacMenu::mouseClick(int x, int y) { _menuActivated = true; _contentIsDirty = true; + _wm->setFullRefresh(true); return true; } @@ -871,6 +872,7 @@ bool MacMenu::mouseClick(int x, int y) { menu->highlight = _activeSubItem; _contentIsDirty = true; + _wm->setFullRefresh(true); } return true; @@ -882,6 +884,7 @@ bool MacMenu::mouseClick(int x, int y) { _activeSubItem = 0; _contentIsDirty = true; + _wm->setFullRefresh(true); _menustack.back()->highlight = 0; @@ -900,6 +903,7 @@ bool MacMenu::mouseClick(int x, int y) { _activeSubItem = menu->highlight = menu->ytoItem(y); _contentIsDirty = true; + _wm->setFullRefresh(true); return true; } @@ -910,6 +914,7 @@ bool MacMenu::mouseClick(int x, int y) { if (_menustack.size()) { _contentIsDirty = true; + _wm->setFullRefresh(true); } return true; diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 65a5da5322..1e8a4bac77 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -160,8 +160,10 @@ MacWindowManager::MacWindowManager() { _menuDelay = 0; _menuTimerActive = false; - _engine = nullptr; + _engineP = nullptr; + _engineR = nullptr; _pauseEngineCallback = nullptr; + _redrawEngineCallback = nullptr; _colorBlack = 0; _colorWhite = 2; @@ -319,8 +321,13 @@ void MacWindowManager::draw() { removeMarked(); - if (_fullRefresh && !(_mode & kWMModeNoDesktop)) - drawDesktop(); + if (_fullRefresh) { + if (!(_mode & kWMModeNoDesktop)) + drawDesktop(); + + if (_redrawEngineCallback != nullptr) + _redrawEngineCallback(_engineR); + } for (Common::List<BaseMacWindow *>::const_iterator it = _windowStack.begin(); it != _windowStack.end(); it++) { BaseMacWindow *w = *it; @@ -525,14 +532,19 @@ void MacWindowManager::passPalette(const byte *pal, uint size) { } void MacWindowManager::pauseEngine(bool pause) { - if (_engine && _pauseEngineCallback) { - _pauseEngineCallback(_engine, pause); + if (_engineP && _pauseEngineCallback) { + _pauseEngineCallback(_engineP, pause); } } void MacWindowManager::setEnginePauseCallback(void *engine, void (*pauseCallback)(void *, bool)) { - _engine = engine; + _engineP = engine; _pauseEngineCallback = pauseCallback; } +void MacWindowManager::setEngineRedrawCallback(void *engine, void (*redrawCallback)(void *)) { + _engineR = engine; + _redrawEngineCallback = redrawCallback; +} + } // End of namespace Graphics diff --git a/graphics/macgui/macwindowmanager.h b/graphics/macgui/macwindowmanager.h index 967a5cde2f..f288a09fd8 100644 --- a/graphics/macgui/macwindowmanager.h +++ b/graphics/macgui/macwindowmanager.h @@ -215,6 +215,7 @@ public: void setMode(uint32 mode); void setEnginePauseCallback(void *engine, void (*pauseCallback)(void *engine, bool pause)); + void setEngineRedrawCallback(void *engine, void (*redrawCallback)(void *engine)); void passPalette(const byte *palette, uint size); @@ -257,8 +258,10 @@ private: MacMenu *_menu; uint32 _menuDelay; - void *_engine; + void *_engineP; + void *_engineR; void (*_pauseEngineCallback)(void *engine, bool pause); + void (*_redrawEngineCallback)(void *engine); bool _cursorIsArrow; }; |