#1647 - bitmap set/get added to the Lua interpreter

This commit is contained in:
bsongis
2014-09-15 18:50:11 +02:00
parent 829567a2c1
commit 93d2837dee
+5
View File
@@ -556,6 +556,7 @@ static int luaModelGetInfo(lua_State *L)
{
lua_newtable(L);
lua_pushtablezstring(L, "name", g_model.header.name);
lua_pushtablenzstring(L, "bitmap", g_model.header.bitmap);
lua_pushtableinteger(L, "id", g_model.header.modelId);
return 1;
}
@@ -571,6 +572,10 @@ static int luaModelSetInfo(lua_State *L)
str2zchar(g_model.header.name, name, sizeof(g_model.header.name));
memcpy(modelHeaders[g_eeGeneral.currModel].name, g_model.header.name, sizeof(g_model.header.name));
}
else if (!strcmp(key, "bitmap")) {
const char * name = luaL_checkstring(L, -1);
strncpy(g_model.header.bitmap, name, sizeof(g_model.header.bitmap));
}
else if (!strcmp(key, "id")) {
g_model.header.modelId = luaL_checkinteger(L, -1);
modelHeaders[g_eeGeneral.currModel].modelId = g_model.header.modelId;