From 223d024e307c7df461678c133f92b86cea3be8e5 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Fri, 21 Jun 2019 06:39:48 +0530 Subject: HDB: Unstub cine functions for fore/background --- engines/hdb/lua-script.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index db66c235ce..9691763afa 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -288,17 +288,41 @@ static int cineSpawnEntity(lua_State *L) { } static int cineClearForeground(lua_State *L) { - warning("STUB: CINE CLEAR FOREGROUND"); + double x = lua_tonumber(L, 1); + double y = lua_tonumber(L, 1); + + g_hdb->_lua->checkParameters("cineClearForeground", 2); + + lua_pop(L, 2); + g_hdb->_ai->cineClearForeground((int)x, (int)y); return 0; } static int cineSetForeground(lua_State *L) { - warning("STUB: CINE SET FOREGROUND"); + double x = lua_tonumber(L, 1); + double y = lua_tonumber(L, 1); + const char *tileName = lua_tostring(L, 3); + + g_hdb->_lua->checkParameters("cineSetForeground", 3); + + lua_pop(L, 3); + int index = g_hdb->_drawMan->getTileIndex(tileName); + g_hdb->_drawMan->getTile(index); + g_hdb->_ai->cineSetForeground((int)x, (int)y, index); return 0; } static int cineSetBackground(lua_State *L) { - warning("STUB: CINE SET BACKGROUND"); + double x = lua_tonumber(L, 1); + double y = lua_tonumber(L, 1); + const char *tileName = lua_tostring(L, 3); + + g_hdb->_lua->checkParameters("cineSetBackground", 3); + + lua_pop(L, 3); + int index = g_hdb->_drawMan->getTileIndex(tileName); + g_hdb->_drawMan->getTile(index); + g_hdb->_ai->cineSetBackground((int)x, (int)y, index); return 0; } -- cgit v1.2.3