From b3b5ef0b562060975e5a8e71eb4b1b7e538347fe Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Mon, 24 Jun 2019 02:11:11 +0530 Subject: HDB: Add cineAbort() and cineCleanUp() --- engines/hdb/ai-cinematic.cpp | 30 ++++++++++++++++++++++++++++++ engines/hdb/ai.h | 2 ++ 2 files changed, 32 insertions(+) (limited to 'engines') diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp index 053ba3c492..c7a484169f 100644 --- a/engines/hdb/ai-cinematic.cpp +++ b/engines/hdb/ai-cinematic.cpp @@ -288,6 +288,36 @@ void AI::processCines() { } } +void AI::cineCleanup() { + cineFreeGfx(); + _cineActive = false; + // If aborted and abort function specified, call it + if (_cineAborted && _cineAbortFunc) + g_hdb->_lua->callFunction(_cineAbortFunc, 0); + + _cameraLock = false; + _playerLock = false; + g_hdb->_window->setInfobarDark(0); + warning("STUB: DrawMan:: Set Pointer State"); + + int px, py; + getPlayerXY(&px, &py); + g_hdb->_map->centerMapXY(px + 16, py + 16); +} + +void AI::cineAbort() { + for (Common::Array::iterator it = _cine.begin(); it != _cine.end(); it++) { + if ((*it)->cmdType == C_STARTMAP || (*it)->cmdType == C_STOPCINE) + _cine[0] = *it; + if (it != _cine.begin()) + _cine.erase(it); + } + warning("STUB: Window: closeAll() required"); + if (_player) + stopEntity(_player); + _cineAborted = true; +} + void AI::cineAddToBlitList(const char *id, Picture *pic, int x, int y, bool masked) { _cineBlitList[_numCineBlitList] = new CineBlit; _cineBlitList[_numCineBlitList]->id = id; diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 072199d319..17e4241c61 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -725,6 +725,8 @@ public: return _cineActive; } void processCines(); + void cineCleanup(); + void cineAbort(); void cineAddToBlitList(const char *id, Picture *pic, int x, int y, bool masked); Picture *cineFindInBlitList(const char *name); void cineRemoveFromBlitList(const char *name); -- cgit v1.2.3