| 1391 | */ |
| 1392 | extern qboolean Sys_LowPhysicalMemory(); |
| 1393 | void CL_InitCGame( void ) { |
| 1394 | const char *info; |
| 1395 | const char *mapname; |
| 1396 | //int t1, t2; |
| 1397 | |
| 1398 | //t1 = Sys_Milliseconds(); |
| 1399 | |
| 1400 | // put away the console |
| 1401 | Con_Close(); |
| 1402 | |
| 1403 | // find the current mapname |
| 1404 | info = cl.gameState.stringData + cl.gameState.stringOffsets[ CS_SERVERINFO ]; |
| 1405 | mapname = Info_ValueForKey( info, "mapname" ); |
| 1406 | Com_sprintf( cl.mapname, sizeof( cl.mapname ), "maps/%s.bsp", mapname ); |
| 1407 | |
| 1408 | cls.state = CA_LOADING; |
| 1409 | |
| 1410 | // init for this gamestate |
| 1411 | VM_Call( CG_INIT, clc.serverCommandSequence ); |
| 1412 | |
| 1413 | // reset any CVAR_CHEAT cvars registered by cgame |
| 1414 | if ( !cl_connectedToCheatServer ) |
| 1415 | Cvar_SetCheatState(); |
| 1416 | |
| 1417 | // we will send a usercmd this frame, which |
| 1418 | // will cause the server to send us the first snapshot |
| 1419 | cls.state = CA_PRIMED; |
| 1420 | |
| 1421 | //t2 = Sys_Milliseconds(); |
| 1422 | |
| 1423 | //Com_Printf( "CL_InitCGame: %5.2f seconds\n", (t2-t1)/1000.0 ); |
| 1424 | // have the renderer touch all its images, so they are present |
| 1425 | // on the card even if the driver does deferred loading |
| 1426 | re.EndRegistration(); |
| 1427 | |
| 1428 | // make sure everything is paged in |
| 1429 | // if (!Sys_LowPhysicalMemory()) |
| 1430 | { |
| 1431 | Com_TouchMemory(); |
| 1432 | } |
| 1433 | |
| 1434 | // clear anything that got printed |
| 1435 | Con_ClearNotify (); |
| 1436 | } |
| 1437 | |
| 1438 | |
| 1439 | /* |
no test coverage detected