diff options
author | Nipun Garg | 2019-06-24 02:13:07 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:58 +0200 |
commit | e896fa8470bd1d35c7b3e1b29dd810c4afe1b641 (patch) | |
tree | 86af16c9410a0ad3bf903a52b790569e17e0bf0f /engines | |
parent | d5778951b54c97406d31521ced24d506a1e363d4 (diff) | |
download | scummvm-rg350-e896fa8470bd1d35c7b3e1b29dd810c4afe1b641.tar.gz scummvm-rg350-e896fa8470bd1d35c7b3e1b29dd810c4afe1b641.tar.bz2 scummvm-rg350-e896fa8470bd1d35c7b3e1b29dd810c4afe1b641.zip |
HDB: Process cineMoveMaskedPic()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/ai-cinematic.cpp | 19 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp index cc66e08707..8251abc9be 100644 --- a/engines/hdb/ai-cinematic.cpp +++ b/engines/hdb/ai-cinematic.cpp @@ -220,6 +220,25 @@ void AI::processCines() { complete = true; } break; + case C_MOVEMASKEDPIC: + if (!_cine[i]->start) { + Picture *pic = cineFindInBlitList(_cine[i]->id); + if (!pic) { + pic = g_hdb->_drawMan->loadPic(_cine[i]->string); + cineAddToFreeList(pic); + } else + cineRemoveFromBlitList(_cine[i]->id); + _cine[i]->pic = pic; + _cine[i]->start = 1; + } + + cineRemoveFromBlitList(_cine[i]->id); + _cine[i]->x += _cine[i]->xv; + _cine[i]->y += _cine[i]->yv; + cineAddToBlitList(_cine[i]->id, _cine[i]->pic, (int)_cine[i]->x, (int)_cine[i]->y, true); + if (abs((int)(_cine[i]->x - _cine[i]->x2)) <= 1 && abs((int)(_cine[i]->y - _cine[i]->y2)) <= 1) + complete = true; + break; case C_USEENTITY: for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) { if ((*it)->entityName && Common::matchString((*it)->entityName, _cine[i]->string)) { diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 2e0a705c50..1f6a7bce6e 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -595,6 +595,7 @@ struct CineCommand { char string[32]; char *id; AIEntity *e; + Picture *pic; CineCommand() : cmdType(C_NO_COMMAND), x(0.0), y(0.0), x2(0.0), y2(0.0), xv(0.0), yv(0.0), start(0), end(0), delay(0), speed(0), title(""), string(""), id(NULL), e(NULL), pic(NULL) {} |