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

Function zEntPlayer_Init

src/SB/Game/zEntPlayer.cpp:3753–3914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3751zParEmitter* gEmitBFX;
3752
3753void zEntPlayer_Init(xEnt* ent, xEntAsset* asset)
3754{
3755 U8 index;
3756 xModelInstance* m;
3757 F32 bbncvtm;
3758 U32 bufsize;
3759 void* info;
3760 xAnimTable* wettbl;
3761 xAnimTable* drytbl;
3762 xAnimState* wetstate;
3763 xAnimState* drystate;
3764 xAnimFile* wetfile;
3765 xAnimFile* dryfile;
3766 S32 aa;
3767 S32 numa;
3768 xFFXRotMatchState* rms;
3769 U32 trailerHash;
3770 xEnt* hitch;
3771 S32 drybob_anim_count;
3772 F32 drybob_oldTime[64];
3773 F32* drybob_chgTime[64];
3774 void* drybob_oldData[64];
3775 void** drybob_chgData[64];
3776
3777 zEntInit((zEnt*)ent, asset, 'PLYR');
3778 xEntInitShadow(*ent, (xEntShadow&)globals.player.entShadow_embedded);
3779 ent->simpShadow = &globals.player.simpShadow_embedded;
3780 xShadowSimple_CacheInit(ent->simpShadow, ent, 80);
3781
3782 if (ent->linkCount * 8 + 21 != 0)
3783 {
3784 ent->lightKit = (xLightKit*)xSTFindAsset((ent->linkCount << 5) + asset->id, NULL);
3785 if ((ent->lightKit != NULL) && (ent->lightKit->tagID != 'TIKL'))
3786 {
3787 ent->lightKit = NULL;
3788 }
3789 }
3790
3791 globals.player.model_spongebob = ent->model;
3792 memset(&globals.player.sb_models, 0, 56);
3793 index = 0;
3794
3795 for (m = globals.player.model_spongebob; m != NULL; m = m)
3796 {
3797 for (S32 i = 0; i < 2; i++)
3798 {
3799 if (globals.player.sb_model_indices[i] == index)
3800 {
3801 globals.player.sb_models[i] = m;
3802 }
3803 if (globals.player.sb_model_indices[1] == index)
3804 {
3805 globals.player.sb_models[i] = m;
3806 }
3807 if (globals.player.sb_model_indices[1] == index)
3808 {
3809 globals.player.sb_models[i] = m;
3810 }

Callers 1

zGameSetupPlayerFunction · 0.70

Calls 10

xEntInitShadowFunction · 0.85
memsetFunction · 0.85
zEntInitFunction · 0.70
PlayerHackFixBbashMissFunction · 0.70
zParEmitterFindFunction · 0.70
zEntRecurseModelInfoFunction · 0.70
zLasso_InitFunction · 0.70
xShadowSimple_CacheInitFunction · 0.50
xSTFindAssetFunction · 0.50
iModelTagSetupFunction · 0.50

Tested by

no test coverage detected