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

Function xEntSetup

src/SB/Core/x/xEnt.cpp:541–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539} // namespace
540
541void xEntSetup(xEnt* ent)
542{
543 xSurface* surf;
544 xModelInstance* minst;
545 S32 i;
546 xLinkAsset* la;
547 xEnt* dent;
548
549 xBaseSetup(ent);
550
551 ent->baseFlags |= 0x20;
552
553 if (ent->asset->surfaceID)
554 {
555 surf = (xSurface*)xSceneResolvID(g_xSceneCur, ent->asset->surfaceID);
556
557 if (surf)
558 {
559 surf->type = XSURFACE_TYPE_1;
560 surf->ent = ent;
561
562 minst = ent->model;
563
564 while (minst)
565 {
566 minst->Surf = surf;
567 minst = minst->Next;
568 }
569 }
570 }
571
572 for (i = 0; i < ent->linkCount; i++)
573 {
574 la = &ent->link[i];
575
576 if (la->dstEvent == eEventDrivenby)
577 {
578 dent = (xEnt*)xSceneResolvID(g_xSceneCur, la->dstAssetID);
579
580 if (dent)
581 {
582 ent->driver = dent;
583 ent->driveMode = (S32)la->param[0];
584
585 dent->driving_count++;
586 }
587 }
588 }
589
590 ent->model->RedMultiplier = ent->asset->redMult;
591 ent->model->GreenMultiplier = ent->asset->greenMult;
592 ent->model->BlueMultiplier = ent->asset->blueMult;
593 ent->model->Alpha = ent->asset->seeThru;
594
595 xEntAddHittableFlag(ent);
596 xEntAddShadowRecFlag(ent);
597
598 zCollGeom_EntSetup(ent);

Callers 2

xEntBoulder_SetupFunction · 0.70
zEntSetupFunction · 0.50

Calls 9

xBaseSetupFunction · 0.85
xSceneResolvIDFunction · 0.85
xEntAddShadowRecFlagFunction · 0.85
iBoxForModelFunction · 0.85
setup_stacked_entityFunction · 0.85
xEntAddHittableFlagFunction · 0.70
resetFunction · 0.70
zCollGeom_EntSetupFunction · 0.50
iBoxForModelLocalFunction · 0.50

Tested by

no test coverage detected