| 98 | #define new_loc(i, j) *(gn.new_locations + ((j) * (WIDTH + 1)) + (i)) |
| 99 | |
| 100 | staticfn void |
| 101 | pass_two(schar bg_typ, schar fg_typ) |
| 102 | { |
| 103 | coordxy x, y; |
| 104 | short count, dr; |
| 105 | |
| 106 | for (x = 2; x <= WIDTH; x++) |
| 107 | for (y = 1; y < HEIGHT; y++) { |
| 108 | for (count = 0, dr = 0; dr < 8; dr++) |
| 109 | if (get_map(x + dirs[dr * 2], y + dirs[(dr * 2) + 1], bg_typ) |
| 110 | == fg_typ) |
| 111 | count++; |
| 112 | if (count == 5) |
| 113 | new_loc(x, y) = bg_typ; |
| 114 | else |
| 115 | new_loc(x, y) = get_map(x, y, bg_typ); |
| 116 | } |
| 117 | |
| 118 | for (x = 2; x <= WIDTH; x++) |
| 119 | for (y = 1; y < HEIGHT; y++) |
| 120 | levl[x][y].typ = new_loc(x, y); |
| 121 | } |
| 122 | |
| 123 | staticfn void |
| 124 | pass_three(schar bg_typ, schar fg_typ) |