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

Function zSceneInitFunc_Player

src/SB/Game/zScene.cpp:519–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519static U32 zSceneInitFunc_Player(zScene* s, zSceneObjectInstanceDesc* desc, U32 base_idx)
520{
521 S32 count;
522 zEnt* entBlock;
523
524 count = s->baseCount[desc->baseType];
525
526 if (count)
527 {
528 entBlock = (zEnt*)xMemAllocSize(count * sizeof(zEnt));
529
530 s->baseList[desc->baseType] = entBlock;
531
532 for (S32 idx = 0; idx < count; idx++)
533 {
534 xBase* b = &globals.player.ent;
535 xEntAsset* asset;
536
537 zSceneSet(b, base_idx);
538
539 if (idx == count - 1)
540 {
541 xSceneAddEnt(s, s->ents[base_idx]);
542 }
543
544 asset = (xEntAsset*)xSTFindAssetByType('PLYR', idx, NULL);
545
546 globals.player.ent.id = asset->id;
547
548 zSceneObjHashtableAdd(asset->id, b);
549
550 base_idx++;
551 }
552 }
553
554 return base_idx;
555}
556
557static U32 zSceneInitFunc_Camera(zScene* s, zSceneObjectInstanceDesc* desc, U32 base_idx)
558{

Callers

nothing calls this directly

Calls 4

zSceneSetFunction · 0.85
xSceneAddEntFunction · 0.85
zSceneObjHashtableAddFunction · 0.70
xSTFindAssetByTypeFunction · 0.50

Tested by

no test coverage detected