Loading

Paste #piqjbe1pe

  1. diff --git a/CorsixTH/Lua/app.lua b/CorsixTH/Lua/app.lua
  2. index bef9ba5..dedc20f 100644
  3. --- a/CorsixTH/Lua/app.lua
  4. +++ b/CorsixTH/Lua/app.lua
  5. @@ -235,6 +235,7 @@ function App:init()
  6.    -- Load additional Lua before world
  7.    if good_install_folder then
  8.      self.anims = self.gfx:loadAnimations("Data", "V")
  9. +    print(self.anims.Alt32_GreyScale)
  10.      self.animation_manager = AnimationManager(self.anims)
  11.      self.walls = self:loadLuaFolder"walls"
  12.      dofile "entity"
  13. diff --git a/CorsixTH/Src/th_lua_anims.cpp b/CorsixTH/Src/th_lua_anims.cpp
  14. index e38694a..5ceb8d0 100644
  15. --- a/CorsixTH/Src/th_lua_anims.cpp
  16. +++ b/CorsixTH/Src/th_lua_anims.cpp
  17. @@ -658,6 +658,7 @@ void THLuaRegisterAnims(const THLuaRegisterState_t *pState)
  18.      luaT_setfunction(l_anims_set_marker, "setFrameMarker");
  19.      luaT_setfunction(l_anims_set_secondary_marker, "setFrameSecondaryMarker");
  20.      luaT_setfunction(l_anims_draw, "draw", MT_Surface, MT_Layers);
  21. +    luaT_setvalue("Alt32_GreyScale", THDF_Alt32_GreyScale);
  22.      luaT_endclass();
  23.  
  24.      // Weak table at AnimMetatable[1] for light UD -> object lookup
  25. diff --git a/CorsixTH/Src/th_lua_internal.h b/CorsixTH/Src/th_lua_internal.h
  26. index c0794a1..7f09773 100644
  27. --- a/CorsixTH/Src/th_lua_internal.h
  28. +++ b/CorsixTH/Src/th_lua_internal.h
  29. @@ -118,4 +118,8 @@ void luaT_setclosure(const THLuaRegisterState_t *pState, lua_CFunction fn,
  30.      luaT_setclosure(pState, fn, ## __VA_ARGS__, MT_Count); \
  31.      lua_setfield(pState->L, -2, name)
  32.  
  33. +#define luaT_setvalue(name, value) \
  34. +    luaT_push(pState->L, value); \
  35. +    lua_setfield(pState->L, -2, name)
  36. +
  37.  #endif

Comments