Return wall mode for a horizontal or vertical wall. */
| 3184 | |
| 3185 | /* Return wall mode for a horizontal or vertical wall. */ |
| 3186 | staticfn int |
| 3187 | set_wall(coordxy x, coordxy y, int horiz) |
| 3188 | { |
| 3189 | int wmode, is_1, is_2; |
| 3190 | |
| 3191 | if (horiz) { |
| 3192 | is_1 = check_pos(x, y - 1, WM_W_TOP); |
| 3193 | is_2 = check_pos(x, y + 1, WM_W_BOTTOM); |
| 3194 | } else { |
| 3195 | is_1 = check_pos(x - 1, y, WM_W_LEFT); |
| 3196 | is_2 = check_pos(x + 1, y, WM_W_RIGHT); |
| 3197 | } |
| 3198 | if (more_than_one(x, y, is_1, is_2, 0)) { |
| 3199 | wmode = 0; |
| 3200 | } else { |
| 3201 | wmode = is_1 + is_2; |
| 3202 | } |
| 3203 | return wmode; |
| 3204 | } |
| 3205 | |
| 3206 | /* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */ |
| 3207 | staticfn int |
no test coverage detected