TODO: wallify(selection) */ wallify({ x1=NN,y1=NN, x2=NN,y2=NN }); */ wallify(); */
| 5962 | /* wallify({ x1=NN,y1=NN, x2=NN,y2=NN }); */ |
| 5963 | /* wallify(); */ |
| 5964 | int |
| 5965 | lspo_wallify(lua_State *L) |
| 5966 | { |
| 5967 | int dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1; |
| 5968 | |
| 5969 | /* TODO: clamp coord values */ |
| 5970 | /* TODO: maybe allow wallify({x1,y1}, {x2,y2}) */ |
| 5971 | /* TODO: is_table_coord(), is_table_area(), |
| 5972 | get_table_coord(), get_table_area() */ |
| 5973 | |
| 5974 | create_des_coder(); |
| 5975 | |
| 5976 | if (lua_gettop(L) == 1) { |
| 5977 | dx1 = get_table_int(L, "x1"); |
| 5978 | dy1 = get_table_int(L, "y1"); |
| 5979 | dx2 = get_table_int(L, "x2"); |
| 5980 | dy2 = get_table_int(L, "y2"); |
| 5981 | } |
| 5982 | |
| 5983 | wallify_map(dx1 < 0 ? (gx.xstart - 1) : dx1, |
| 5984 | dy1 < 0 ? (gy.ystart - 1) : dy1, |
| 5985 | dx2 < 0 ? (gx.xstart + gx.xsize + 1) : dx2, |
| 5986 | dy2 < 0 ? (gy.ystart + gy.ysize + 1) : dy2); |
| 5987 | |
| 5988 | return 0; |
| 5989 | } |
| 5990 | |
| 5991 | /* reset_level is only needed for testing purposes */ |
| 5992 | int |
nothing calls this directly
no test coverage detected