| 2804 | } |
| 2805 | |
| 2806 | staticfn struct mkroom * |
| 2807 | build_room(room *r, struct mkroom *mkr) |
| 2808 | { |
| 2809 | boolean okroom; |
| 2810 | struct mkroom *aroom; |
| 2811 | xint16 rtype = (!r->chance || rn2(100) < r->chance) ? r->rtype : OROOM; |
| 2812 | |
| 2813 | if (mkr) { |
| 2814 | aroom = &gs.subrooms[gn.nsubroom]; |
| 2815 | okroom = create_subroom(mkr, r->x, r->y, r->w, r->h, rtype, r->rlit); |
| 2816 | } else { |
| 2817 | aroom = &svr.rooms[svn.nroom]; |
| 2818 | okroom = create_room(r->x, r->y, r->w, r->h, r->xalign, r->yalign, |
| 2819 | rtype, r->rlit); |
| 2820 | } |
| 2821 | |
| 2822 | if (okroom) { |
| 2823 | #ifdef SPECIALIZATION |
| 2824 | topologize(aroom, FALSE); /* set roomno */ |
| 2825 | #else |
| 2826 | topologize(aroom); /* set roomno */ |
| 2827 | #endif |
| 2828 | aroom->needfill = r->needfill; |
| 2829 | aroom->needjoining = r->joined; |
| 2830 | return aroom; |
| 2831 | } |
| 2832 | return (struct mkroom *) 0; |
| 2833 | } |
| 2834 | |
| 2835 | /* |
| 2836 | * set lighting in a region that will not become a room. |
no test coverage detected