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

Function light_region

src/sp_lev.c:2838–2862  ·  view source on GitHub ↗

* set lighting in a region that will not become a room. */

Source from the content-addressed store, hash-verified

2836 * set lighting in a region that will not become a room.
2837 */
2838staticfn void
2839light_region(region *tmpregion)
2840{
2841 boolean litstate = tmpregion->rlit ? 1 : 0;
2842 int hiy = tmpregion->y2;
2843 int x, y;
2844 struct rm *lev;
2845 int lowy = tmpregion->y1;
2846 int lowx = tmpregion->x1, hix = tmpregion->x2;
2847
2848 if (litstate) {
2849 /* adjust region size for walls, but only if lighted */
2850 lowx = max(lowx - 1, 1);
2851 hix = min(hix + 1, COLNO - 1);
2852 lowy = max(lowy - 1, 0);
2853 hiy = min(hiy + 1, ROWNO - 1);
2854 }
2855 for (x = lowx; x <= hix; x++) {
2856 lev = &levl[x][lowy];
2857 for (y = lowy; y <= hiy; y++) {
2858 lev->lit = IS_LAVA(lev->typ) ? 1 : litstate;
2859 lev++;
2860 }
2861 }
2862}
2863
2864void
2865wallify_map(coordxy x1, coordxy y1, coordxy x2, coordxy y2)

Callers 1

lspo_regionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected