=============== idSessionLocal::ExecuteMapChange Performs the initialization of a game based on mapSpawnData, used for both single player and multiplayer, but not for renderDemos, which don't create a game at all. Exits with mapSpawned = true =============== */
| 1545 | =============== |
| 1546 | */ |
| 1547 | void idSessionLocal::ExecuteMapChange( bool noFadeWipe ) { |
| 1548 | int i; |
| 1549 | bool reloadingSameMap; |
| 1550 | |
| 1551 | // close console and remove any prints from the notify lines |
| 1552 | console->Close(); |
| 1553 | |
| 1554 | if ( IsMultiplayer() ) { |
| 1555 | // make sure the mp GUI isn't up, or when players get back in the |
| 1556 | // map, mpGame's menu and the gui will be out of sync. |
| 1557 | SetGUI( NULL, NULL ); |
| 1558 | } |
| 1559 | |
| 1560 | // mute sound |
| 1561 | soundSystem->SetMute( true ); |
| 1562 | |
| 1563 | // clear all menu sounds |
| 1564 | menuSoundWorld->ClearAllSoundEmitters(); |
| 1565 | |
| 1566 | // unpause the game sound world |
| 1567 | // NOTE: we UnPause again later down. not sure this is needed |
| 1568 | if ( sw->IsPaused() ) { |
| 1569 | sw->UnPause(); |
| 1570 | } |
| 1571 | |
| 1572 | if ( !noFadeWipe ) { |
| 1573 | // capture the current screen and start a wipe |
| 1574 | StartWipe( "wipeMaterial", true ); |
| 1575 | |
| 1576 | // immediately complete the wipe to fade out the level transition |
| 1577 | // run the wipe to completion |
| 1578 | CompleteWipe(); |
| 1579 | } |
| 1580 | |
| 1581 | // extract the map name from serverinfo |
| 1582 | idStr mapString = mapSpawnData.serverInfo.GetString( "si_map" ); |
| 1583 | |
| 1584 | idStr fullMapName = "maps/"; |
| 1585 | fullMapName += mapString; |
| 1586 | fullMapName.StripFileExtension(); |
| 1587 | |
| 1588 | // shut down the existing game if it is running |
| 1589 | UnloadMap(); |
| 1590 | |
| 1591 | // don't do the deferred caching if we are reloading the same map |
| 1592 | if ( fullMapName == currentMapName ) { |
| 1593 | reloadingSameMap = true; |
| 1594 | } else { |
| 1595 | reloadingSameMap = false; |
| 1596 | currentMapName = fullMapName; |
| 1597 | } |
| 1598 | |
| 1599 | // note which media we are going to need to load |
| 1600 | if ( !reloadingSameMap ) { |
| 1601 | declManager->BeginLevelLoad(); |
| 1602 | renderSystem->BeginLevelLoad(); |
| 1603 | soundSystem->BeginLevelLoad(); |
| 1604 | } |
nothing calls this directly
no test coverage detected