* set lighting in a region that will not become a room. */
| 2836 | * set lighting in a region that will not become a room. |
| 2837 | */ |
| 2838 | staticfn void |
| 2839 | light_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 | |
| 2864 | void |
| 2865 | wallify_map(coordxy x1, coordxy y1, coordxy x2, coordxy y2) |