aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-21 06:20:52 +0530
committerEugene Sandulenko2019-09-03 17:16:53 +0200
commit13c614bd3a14fed4ba7b3344a347c018468f3c5e (patch)
tree38ca1f19aadb3d8be5612dc9a2c8ce4c1aa2a231
parent198e26e652200b462ac1be7bb3f2f2250c2c2dbd (diff)
downloadscummvm-rg350-13c614bd3a14fed4ba7b3344a347c018468f3c5e.tar.gz
scummvm-rg350-13c614bd3a14fed4ba7b3344a347c018468f3c5e.tar.bz2
scummvm-rg350-13c614bd3a14fed4ba7b3344a347c018468f3c5e.zip
HDB: Unstub setBackground() and setForeground()
-rw-r--r--engines/hdb/lua-script.cpp24
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;
}