virtual void Execute() { CDeflector* D = 0; for (;;) { // Get task task_CS.Enter (); thProgress = 1.f - float(task_pool.size())/float(g_deflectors.size()); if (task_pool.empty()) { task_CS.Leave (); return; } D = g_deflectors[task_pool.back()]; task_pool.pop_back (); task_CS.Leave (); // Perform operation try { D->Light (&DB,&LightsSelected,H); } catch (...) { clMsg("* ERROR: CLMThread::Execute - light"); } } }
void CRestrictedObject::remove_restrictions (const xr_vector<ALife::_OBJECT_ID> &out_restrictions, const xr_vector<ALife::_OBJECT_ID> &in_restrictions) { if (out_restrictions.empty() && in_restrictions.empty()) return; START_PROFILE("Restricted Object/Remove Restrictions"); string4096 temp_out_restrictions; string4096 temp_in_restrictions; construct_restriction_string<CRestrictionPredicate<false>,false>(temp_out_restrictions,sizeof(temp_out_restrictions),out_restrictions,this->out_restrictions(),CRestrictionPredicate<false>(RestrictionSpace::eRestrictorTypeOut)); construct_restriction_string<CRestrictionPredicate<false>,false>(temp_in_restrictions,sizeof(temp_in_restrictions),in_restrictions,this->in_restrictions(),CRestrictionPredicate<false>(RestrictionSpace::eRestrictorTypeIn)); Level().space_restriction_manager().remove_restrictions (object().ID(),temp_out_restrictions,temp_in_restrictions); actual (false); STOP_PROFILE; }
void OGF::adjacent_select (xr_vector<u32>& dest, xr_vector<bool>& vmark, xr_vector<bool>& fmark) { // 0. Search for the group for (u32 fit=0; fit<faces.size(); fit++) { OGF_Face& F = faces [fit]; if (fmark[fit]) continue; // already registered // new face - if empty - just put it in, else check connectivity if (dest.empty()) { fmark[fit] = true ; dest.push_back (F.v[0]); vmark[F.v[0]]=true; dest.push_back (F.v[1]); vmark[F.v[1]]=true; dest.push_back (F.v[2]); vmark[F.v[2]]=true; } else { // check connectivity BOOL bConnected = FALSE; for (u32 vid=0; vid<3; vid++) { u32 id = F.v [vid]; // search in already registered verts for (u32 sid=0; sid<dest.size(); sid++) { if (id==dest[sid]) { bConnected = TRUE; // this face shares at least one vertex with already selected faces break; } } if (bConnected) break; } if (bConnected) { // add this face's vertices fmark[fit] = true ; if (!vmark[F.v[0]]) { dest.push_back (F.v[0]); vmark[F.v[0]]=true; } if (!vmark[F.v[1]]) { dest.push_back (F.v[1]); vmark[F.v[1]]=true; } if (!vmark[F.v[2]]) { dest.push_back (F.v[2]); vmark[F.v[2]]=true; } } } } }