diff options
author | Nipun Garg | 2019-07-13 23:32:55 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:19 +0200 |
commit | e0f49e8aee8aa22c196969c27a99774f2e85f805 (patch) | |
tree | 9c0d7b98e316c840e430e2977c321cdb0c5b8bc9 /engines/hdb | |
parent | 2f893eeadd0b1a0129c88132afc5f49dacd55c13 (diff) | |
download | scummvm-rg350-e0f49e8aee8aa22c196969c27a99774f2e85f805.tar.gz scummvm-rg350-e0f49e8aee8aa22c196969c27a99774f2e85f805.tar.bz2 scummvm-rg350-e0f49e8aee8aa22c196969c27a99774f2e85f805.zip |
HDB: Add cineFunction()
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/ai-cinematic.cpp | 11 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 | ||||
-rw-r--r-- | engines/hdb/lua-script.cpp | 9 |
3 files changed, 20 insertions, 1 deletions
diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp index e2ed00bfb1..f0ff15adf8 100644 --- a/engines/hdb/ai-cinematic.cpp +++ b/engines/hdb/ai-cinematic.cpp @@ -449,6 +449,10 @@ void AI::processCines() { g_hdb->_map->addFGTileAnimation((int)_cine[i]->x, (int)_cine[i]->y); complete = true; break; + case C_FUNCTION: + g_hdb->_lua->callFunction(_cine[i]->title, 0); + complete = true; + break; default: warning("STUB: AI::PROCESSCINES incomplete for %d", _cine[i]->cmdType); break; @@ -872,4 +876,11 @@ void AI::cineSetForeground(int x, int y, int index) { _cine.push_back(cmd); } +void AI::cineFunction(const char *func) { + CineCommand *cmd = new CineCommand; + cmd->title = func; + cmd->cmdType = C_FUNCTION; + _cine.push_back(cmd); +} + } // End of Namespace diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index c63dfdded1..3d20a1ed74 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -1005,6 +1005,7 @@ public: void cineClearForeground(int x, int y); void cineSetBackground(int x, int y, int index); void cineSetForeground(int x, int y, int index); + void cineFunction(const char *func); // Waypoint & Movement Functions void lookAtXY(int x, int y); diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 01a3c7feb1..06eb67b2e4 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -602,7 +602,14 @@ static int cineSetBackground(lua_State *L) { } static int cineFunction(lua_State *L) { - warning("STUB: CINE FUNCTION"); + const char *func = lua_tostring(L, 1); + + g_hdb->_lua->checkParameters("cineFunction", 1); + + lua_pop(L, 1); + + g_hdb->_ai->cineFunction(func); + return 0; } |