diff options
author | Nipun Garg | 2019-07-13 23:26:31 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:19 +0200 |
commit | 2f893eeadd0b1a0129c88132afc5f49dacd55c13 (patch) | |
tree | c23840d94874672809836b3b1e5ab7f9003e2603 | |
parent | e1fbaaea2b34e75918eaafad335bf50f39aa41c8 (diff) | |
download | scummvm-rg350-2f893eeadd0b1a0129c88132afc5f49dacd55c13.tar.gz scummvm-rg350-2f893eeadd0b1a0129c88132afc5f49dacd55c13.tar.bz2 scummvm-rg350-2f893eeadd0b1a0129c88132afc5f49dacd55c13.zip |
HDB: Add cineRemoveEntity()
-rw-r--r-- | engines/hdb/ai-cinematic.cpp | 13 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 | ||||
-rw-r--r-- | engines/hdb/lua-script.cpp | 8 |
3 files changed, 21 insertions, 1 deletions
diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp index 5eafd47f05..e2ed00bfb1 100644 --- a/engines/hdb/ai-cinematic.cpp +++ b/engines/hdb/ai-cinematic.cpp @@ -428,6 +428,12 @@ void AI::processCines() { break; } break; + case C_REMOVEENTITY: + e = locateEntity(_cine[i]->string); + if (e) + removeEntity(e); + complete = true; + break; case C_CLEAR_FG: g_hdb->_map->setMapFGTileIndex((int)_cine[i]->x, (int)_cine[i]->y, -1); g_hdb->_map->removeFGTileAnimation((int)_cine[i]->x, (int)_cine[i]->y); @@ -687,6 +693,13 @@ void AI::cineSpawnEntity(AIType t, AIDir d, int x, int y, const char *func_init, _cine.push_back(cmd); } +void AI::cineRemoveEntity(const char *entName) { + CineCommand *cmd = new CineCommand; + cmd->string = entName; + cmd->cmdType = C_REMOVEENTITY; + _cine.push_back(cmd); +} + void AI::cineDialog(const char *title, const char *string, int seconds) { CineCommand *cmd = new CineCommand; cmd->title = title; diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 9c5acfce36..c63dfdded1 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -986,6 +986,7 @@ public: void cineMoveEntity(const char *entName, int x, int y, int level, int speed); void cineSpawnEntity(AIType t, AIDir d, int x, int y, const char *func_init, const char *func_action, const char *func_use, AIDir d2, int level, int value1, int value2); + void cineRemoveEntity(const char *entName); void cineAnimEntity(const char *entName, AIState state, int loop); void cineSetAnimFrame(const char *entName, AIState state, int frame); void cineEntityFace(const char *luaName, double dir); diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 626272eb07..01a3c7feb1 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -395,7 +395,13 @@ static int cineSetEntity(lua_State *L) { } static int cineRemoveEntity(lua_State *L) { - warning("STUB: CINE REMOVE ENTITY"); + const char *entName = lua_tostring(L, 1); + + g_hdb->_lua->checkParameters("cineRemoveEntity", 1); + + lua_pop(L, 1); + + g_hdb->_ai->cineRemoveEntity(entName); return 0; } |