MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ExecuteMapChange

Method ExecuteMapChange

neo/framework/Session.cpp:1547–1762  ·  view source on GitHub ↗

=============== 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 =============== */

Source from the content-addressed store, hash-verified

1545===============
1546*/
1547void 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 }

Callers

nothing calls this directly

Calls 15

Sys_GrabMouseCursorFunction · 0.85
Sys_MillisecondsFunction · 0.85
Sys_GenerateEventsFunction · 0.85
Sys_ClearEventsFunction · 0.85
SetMuteMethod · 0.80
ClearAllSoundEmittersMethod · 0.80
IsPausedMethod · 0.80
UnPauseMethod · 0.80
ResetReadCountMethod · 0.80
InitFromMapMethod · 0.80
InitForNewMapMethod · 0.80
CloseFileMethod · 0.80

Tested by

no test coverage detected