diff --git a/CorsixTH/Lua/app.lua b/CorsixTH/Lua/app.lua index bef9ba5..dedc20f 100644 --- a/CorsixTH/Lua/app.lua +++ b/CorsixTH/Lua/app.lua @@ -235,6 +235,7 @@ function App:init() -- Load additional Lua before world if good_install_folder then self.anims = self.gfx:loadAnimations("Data", "V") + print(self.anims.Alt32_GreyScale) self.animation_manager = AnimationManager(self.anims) self.walls = self:loadLuaFolder"walls" dofile "entity" diff --git a/CorsixTH/Src/th_lua_anims.cpp b/CorsixTH/Src/th_lua_anims.cpp index e38694a..5ceb8d0 100644 --- a/CorsixTH/Src/th_lua_anims.cpp +++ b/CorsixTH/Src/th_lua_anims.cpp @@ -658,6 +658,7 @@ void THLuaRegisterAnims(const THLuaRegisterState_t *pState) luaT_setfunction(l_anims_set_marker, "setFrameMarker"); luaT_setfunction(l_anims_set_secondary_marker, "setFrameSecondaryMarker"); luaT_setfunction(l_anims_draw, "draw", MT_Surface, MT_Layers); + luaT_setvalue("Alt32_GreyScale", THDF_Alt32_GreyScale); luaT_endclass(); // Weak table at AnimMetatable[1] for light UD -> object lookup diff --git a/CorsixTH/Src/th_lua_internal.h b/CorsixTH/Src/th_lua_internal.h index c0794a1..7f09773 100644 --- a/CorsixTH/Src/th_lua_internal.h +++ b/CorsixTH/Src/th_lua_internal.h @@ -118,4 +118,8 @@ void luaT_setclosure(const THLuaRegisterState_t *pState, lua_CFunction fn, luaT_setclosure(pState, fn, ## __VA_ARGS__, MT_Count); \ lua_setfield(pState->L, -2, name) +#define luaT_setvalue(name, value) \ + luaT_push(pState->L, value); \ + lua_setfield(pState->L, -2, name) + #endif