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

Function design_load_shape

plugins/design.cpp:205–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205static int design_load_shape(lua_State *L) {
206 if (lua_istable(L, -1)) {
207 lua_pushnil(L);
208 while (lua_next(L, -2) != 0) {
209 int x = lua_tointeger(L, -2);
210
211 if (lua_istable(L, -1)) {
212 lua_pushnil(L);
213 while (lua_next(L, -2) != 0) {
214 int y = lua_tointeger(L, -2);
215 bool value = lua_toboolean(L, -1);
216
217 if (value) {
218 arr[x][y] = DrawingPoint();
219 }
220 lua_pop(L, 1);
221 }
222 }
223 lua_pop(L, 1);
224 }
225 }
226
227 return 0;
228}
229
230static int design_clear_shape(lua_State *L) {
231 arr.clear();

Callers 1

design_draw_shapeFunction · 0.85

Calls 4

lua_pushnilFunction · 0.85
lua_nextFunction · 0.85
lua_tobooleanFunction · 0.85
DrawingPointClass · 0.85

Tested by

no test coverage detected