MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xUpdateCull_Update

Function xUpdateCull_Update

src/SB/Core/x/xUpdateCull.cpp:264–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void xUpdateCull_Update(xUpdateCullMgr* m, U32 percent_update)
265{
266 S32 numiters = m->mgrCount * percent_update / 100;
267 if (numiters <= 0)
268 {
269 numiters = 1;
270 }
271
272 while (numiters > 0)
273 {
274 U32 i;
275 xUpdateCullEnt* cent = &m->mgrList[m->mgrCurr];
276 U32 result = cent->cb(m->ent[cent->index], cent->cbdata);
277 if (cent->groupIndex == -1)
278 {
279 if (result == 1)
280 {
281 xUpdateCull_MakeActive(m, cent);
282 }
283 else
284 {
285 xUpdateCull_MakeInactive(m, cent);
286 }
287 m->mgrCurr++;
288 numiters--;
289 }
290 else
291 {
292 xUpdateCullGroup* grp = &m->grpList[cent->groupIndex];
293 if (result == 1)
294 {
295 if (!grp->active)
296 {
297 grp->active = 1;
298 for (i = grp->startIndex; i <= grp->endIndex; i++)
299 {
300 xUpdateCull_MakeActive(m, &m->mgrList[i]);
301 }
302 }
303 numiters -= grp->endIndex + 1 - m->mgrCurr;
304 m->mgrCurr = grp->endIndex + 1;
305 }
306 else
307 {
308 if (m->mgrCurr == grp->endIndex && grp->active)
309 {
310 grp->active = 0;
311 for (i = grp->startIndex; i <= grp->endIndex; i++)
312 {
313 cent = &m->mgrList[i];
314 for (xUpdateCullEnt* curr = cent->nextInGroup; curr && curr != cent;
315 curr = curr->nextInGroup)
316 {
317 if (m->grpList[curr->groupIndex].active)
318 {
319 goto loc_80101E10;
320 }
321 }

Callers 4

zSceneResetFunction · 0.50
zSceneUpdateFunction · 0.50
zGameSetupFunction · 0.50
zMenuSetupFunction · 0.50

Calls 2

xUpdateCull_MakeActiveFunction · 0.85
xUpdateCull_MakeInactiveFunction · 0.85

Tested by

no test coverage detected