static void SetMapSections() { bool set; int num = 0; do { set = false; for(int i=0; i<numsubsectors; i++) { if (subsectors[i].mapsection == 0) { num++; DoSetMapSection(&subsectors[i], num); set = true; break; } } } while (set); num = MergeMapSections(num); currentmapsection.Resize(1 + num/8); #ifdef DEBUG Printf("%d map sections found\n", num); #endif }
static void DoSetMapSection(subsector_t *sub, int num) { sub->mapsection = num; for(DWORD i=0;i<sub->numlines;i++) { seg_t * seg = sub->firstline + i; if (seg->PartnerSeg) { subsector_t * sub2 = seg->PartnerSeg->Subsector; if (sub2->mapsection != num) { assert(sub2->mapsection == 0); DoSetMapSection(sub2, num); } } } }