MCPcopy Create free account
hub / github.com/NetHack/NetHack / xy_set_wall_state

Function xy_set_wall_state

src/display.c:3275–3326  ·  view source on GitHub ↗

called for every by set_wall_state() and for specific during vault wall repair */

Source from the content-addressed store, hash-verified

3273/* called for every <x,y> by set_wall_state() and for specific <x,y> during
3274 vault wall repair */
3275void
3276xy_set_wall_state(coordxy x, coordxy y)
3277{
3278 coordxy wmode;
3279 struct rm *lev = &levl[x][y];
3280
3281 switch (lev->typ) {
3282 case SDOOR:
3283 wmode = set_wall(x, y, (coordxy) lev->horizontal);
3284 break;
3285 case VWALL:
3286 wmode = set_wall(x, y, 0);
3287 break;
3288 case HWALL:
3289 wmode = set_wall(x, y, 1);
3290 break;
3291 case TDWALL:
3292 wmode = set_twall(x, y, x, y - 1, x - 1, y + 1, x + 1, y + 1);
3293 break;
3294 case TUWALL:
3295 wmode = set_twall(x, y, x, y + 1, x + 1, y - 1, x - 1, y - 1);
3296 break;
3297 case TLWALL:
3298 wmode = set_twall(x, y, x + 1, y, x - 1, y - 1, x - 1, y + 1);
3299 break;
3300 case TRWALL:
3301 wmode = set_twall(x, y, x - 1, y, x + 1, y + 1, x + 1, y - 1);
3302 break;
3303 case TLCORNER:
3304 wmode = set_corn(x - 1, y - 1, x, y - 1, x - 1, y, x + 1, y + 1);
3305 break;
3306 case TRCORNER:
3307 wmode = set_corn(x, y - 1, x + 1, y - 1, x + 1, y, x - 1, y + 1);
3308 break;
3309 case BLCORNER:
3310 wmode = set_corn(x, y + 1, x - 1, y + 1, x - 1, y, x + 1, y - 1);
3311 break;
3312 case BRCORNER:
3313 wmode = set_corn(x + 1, y, x + 1, y + 1, x, y + 1, x - 1, y - 1);
3314 break;
3315 case CROSSWALL:
3316 wmode = set_crosswall(x, y);
3317 break;
3318
3319 default:
3320 wmode = -1; /* don't set wall info */
3321 break;
3322 }
3323
3324 if (wmode >= 0)
3325 lev->wall_info = (lev->wall_info & ~WM_MASK) | wmode;
3326}
3327
3328/* Called from mklev. Scan the level and set the wall modes. */
3329void

Callers 4

reveal_terrain_getglyphFunction · 0.85
invaultFunction · 0.85
wallify_vaultFunction · 0.85
set_wall_stateFunction · 0.85

Calls 3

set_wallFunction · 0.85
set_cornFunction · 0.85
set_crosswallFunction · 0.85

Tested by

no test coverage detected