diff options
author | Nipun Garg | 2019-06-18 04:52:29 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:47 +0200 |
commit | 6910430770b967f10cb9fe5038bbca898e673b25 (patch) | |
tree | f526439e9a775e1ed4c8442031f9a27319bf63a6 /engines/hdb | |
parent | 0ce230ba7fb2b356886440c8159bec43db66d2a6 (diff) | |
download | scummvm-rg350-6910430770b967f10cb9fe5038bbca898e673b25.tar.gz scummvm-rg350-6910430770b967f10cb9fe5038bbca898e673b25.tar.bz2 scummvm-rg350-6910430770b967f10cb9fe5038bbca898e673b25.zip |
HDB: Add processCines to execute the CineCommands
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/ai.cpp | 52 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 |
2 files changed, 53 insertions, 0 deletions
diff --git a/engines/hdb/ai.cpp b/engines/hdb/ai.cpp index 2246a51a1b..3b79150333 100644 --- a/engines/hdb/ai.cpp +++ b/engines/hdb/ai.cpp @@ -32,6 +32,58 @@ AI::~AI() { delete _cine; } +void AI::processCines() { + + bool complete, bailOut; + + if (!_cineActive) { + return; + } + + bailOut = complete = false; + + // TODO: Make sure Dialogs are timing out + + // TODO: Make sure Cine Pics are drawing + + // TODO: Check for Game Pause + + for (Common::Array<CineCommand *>::iterator it = _cine->begin(); it != _cine->end(); it++) { + switch ((*it)->cmdType) { + case C_SETCAMERA: + _cameraX = (*it)->x; + _cameraY = (*it)->y; + warning("STUB: Map::CenterMAPXY required"); + _cameraLock = true; + complete = true; + break; + case C_RESETCAMERA: + int px, py; + _cameraLock = false; + warning("STUB: AI::GetPlayerXY required"); + warning("STUB: MAP::CenterMapXY required"); + complete = true; + break; + case C_MOVECAMERA: + _cameraLock = true; + if (!((*it)->start)) { + (*it)->xv = (((double) (*it)->x) - _cameraX) / (double) (*it)->speed; + (*it)->yv = (((double) (*it)->y) - _cameraY) / (double) (*it)->speed; + (*it)->start = 1; + } + _cameraX += (*it)->xv; + _cameraY += (*it)->yv; + if (abs(_cameraX - (*it)->x) <= 1 && abs(_cameraY - (*it)->y) <= 1) { + _cameraX = (*it)->x; + _cameraY = (*it)->y; + complete = true; + } + warning("STUB: MAP::CenterMapXY required"); + break; + } + } +} + void AI::cineStart(bool abortable, char *abortFunc) { _cineAbortable = abortable; _cineAborted = false; diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 0c4b80f670..570a4044e5 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -86,6 +86,7 @@ public: ~AI(); // Cinematic Functions + void processCines(); void cineStart(bool abortable, char *abortFunc); void cineSetCamera(int x, int y); void cineResetCamera(); |