MCPcopy Create free account
hub / github.com/DFHack/dfhack / dfhack_penarray_new

Function dfhack_penarray_new

library/LuaApi.cpp:984–995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

982}
983
984static int dfhack_penarray_new(lua_State *L)
985{
986 int bufwidth = luaL_checkint(L, 1);
987 int bufheight = luaL_checkint(L, 2);
988 void *buf = lua_newuserdata(L, sizeof(PenArray) + (sizeof(Pen) * bufwidth * bufheight));
989 new (buf) PenArray(bufwidth, bufheight, buf);
990
991 lua_rawgetp(L, LUA_REGISTRYINDEX, &DFHACK_PENARRAY_TOKEN);
992 lua_setmetatable(L, -2);
993
994 return 1;
995}
996
997static int dfhack_penarray_clear(lua_State *L)
998{

Callers

nothing calls this directly

Calls 3

lua_newuserdataFunction · 0.85
lua_rawgetpFunction · 0.85
lua_setmetatableFunction · 0.85

Tested by

no test coverage detected