diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/lua-script.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/hdb/lua-script.cpp b/engines/hdb/lua-script.cpp index 75f8a41566..db66c235ce 100644 --- a/engines/hdb/lua-script.cpp +++ b/engines/hdb/lua-script.cpp @@ -417,12 +417,32 @@ static int clearForeground(lua_State *L) { } static int setForeground(lua_State *L) { - warning("STUB: SET FOREGROUND"); + double x = lua_tonumber(L, 1); + double y = lua_tonumber(L, 2); + const char *tileName = lua_tostring(L, 3); + + g_hdb->_lua->checkParameters("setForeground", 3); + + lua_pop(L, 3); + int index = g_hdb->_drawMan->getTileIndex(tileName); + g_hdb->_drawMan->getTile(index); + g_hdb->_map->setMapFGTileIndex((int)x, (int)y, index); + g_hdb->_map->addFGTileAnimation((int)x, (int)y); return 0; } static int setBackground(lua_State *L) { - warning("STUB: CLEAR BACKGROUND"); + double x = lua_tonumber(L, 1); + double y = lua_tonumber(L, 2); + const char *tileName = lua_tostring(L, 3); + + g_hdb->_lua->checkParameters("setBackground", 3); + + lua_pop(L, 3); + int index = g_hdb->_drawMan->getTileIndex(tileName); + g_hdb->_drawMan->getTile(index); + g_hdb->_map->setMapBGTileIndex((int)x, (int)y, index); + g_hdb->_map->addBGTileAnimation((int)x, (int)y); return 0; } |