MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / InitPlayers

Function InitPlayers

Descent3/Player.cpp:1183–1208  ·  view source on GitHub ↗

Sets up the players array

Source from the content-addressed store, hash-verified

1181
1182// Sets up the players array
1183void InitPlayers() {
1184 int i;
1185
1186 // find the ships that are allowed by default
1187 Default_ship_permission = 0;
1188 for (i = 0; i < MAX_SHIPS; i++) {
1189 if (Ships[i].used & Ships[i].flags & SF_DEFAULT_ALLOW) {
1190 int flag = 0x01;
1191 flag = flag << i;
1192 Default_ship_permission |= flag;
1193 }
1194 }
1195
1196 for (i = 0; i < MAX_PLAYERS; i++) {
1197 Players[i].startpos_flags = 0;
1198
1199 int index = AllocTexture();
1200
1201 ASSERT(index >= 0);
1202 GameTextures[index].bm_handle = 0;
1203 snprintf(GameTextures[index].name, sizeof(GameTextures[index].name), "Player %d texture", i);
1204 Players[i].custom_texture_handle = index;
1205 }
1206 PlayerResetShipPermissions(-1, true);
1207 Players_typing = 0;
1208}
1209
1210// Look for player objects & set player starts
1211void FindPlayerStarts() {

Callers 1

InitD3Systems2Function · 0.85

Calls 2

AllocTextureFunction · 0.85

Tested by

no test coverage detected