| 982 | } |
| 983 | |
| 984 | static 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 | |
| 997 | static int dfhack_penarray_clear(lua_State *L) |
| 998 | { |
nothing calls this directly
no test coverage detected