| 1094 | } |
| 1095 | |
| 1096 | void 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 | |
| 1138 | void zGameStats_Init() |
| 1139 | { |
no test coverage detected