| 203 | } |
| 204 | |
| 205 | static 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 | |
| 230 | static int design_clear_shape(lua_State *L) { |
| 231 | arr.clear(); |
no test coverage detected