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

Function zGameSetupPlayer

src/SB/Game/zGame.cpp:1096–1136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094}
1095
1096void zGameSetupPlayer()
1097{
1098 xEntAsset* asset = (xEntAsset*)xSTFindAssetByType('PLYR', xSTAssetCountByType('PLYR') - 1, 0);
1099 U32 size;
1100 xMarkerAsset* m;
1101
1102 asset->baseType = eBaseTypePlayer;
1103
1104 if (sPortalling != 0)
1105 {
1106 if (sPlayerStartAngle > -1e8f)
1107 {
1108 asset->ang.x = (PI * sPlayerStartAngle) / 180.0f;
1109 }
1110 sPortalling = 0;
1111 }
1112
1113 asset->ang.y = 0.0f;
1114 asset->ang.z = 0.0f;
1115 gGameWhereAmI = eGameWhere_SetupPlayerInit;
1116 zEntPlayer_Init(&globals.player.ent, asset);
1117
1118 if (sPlayerMarkerStartID != 0)
1119 {
1120 m = (xMarkerAsset *)xSTFindAsset(sPlayerMarkerStartID, &size);
1121 if (m != NULL)
1122 {
1123 xVec3Copy((xVec3 *)&globals.player.ent.frame->mat.pos, &m->pos);
1124 xVec3Copy((xVec3 *)&globals.player.ent.frame->oldmat.pos, &m->pos);
1125 xVec3Copy((xVec3 *)&globals.player.ent.model->Mat->pos, &m->pos);
1126 xCameraSetTargetMatrix(&globals.camera, xEntGetFrame(&globals.player.ent));
1127 }
1128 sPlayerMarkerStartID = 0;
1129 }
1130
1131 gGameWhereAmI = eGameWhere_SetupPlayerCamera;
1132 zCameraReset(&globals.camera);
1133 zEntPlayer_StoreCheckPoint(&globals.player.ent.frame->mat.pos, globals.player.ent.frame->rot.angle, globals.camera.id);
1134 gGameWhereAmI = eGameWhere_SetupPlayerEnd;
1135
1136}
1137
1138void zGameStats_Init()
1139{

Callers 2

zGameSetupFunction · 0.70
zMenuSetupFunction · 0.70

Calls 9

xVec3CopyFunction · 0.85
xCameraSetTargetMatrixFunction · 0.85
xEntGetFrameFunction · 0.85
zCameraResetFunction · 0.85
zEntPlayer_InitFunction · 0.70
xSTFindAssetByTypeFunction · 0.50
xSTAssetCountByTypeFunction · 0.50
xSTFindAssetFunction · 0.50

Tested by

no test coverage detected