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

Function StartLevel

Descent3/gamesequence.cpp:1470–1633  ·  view source on GitHub ↗

Starts the level, which has already been loaded

Source from the content-addressed store, hash-verified

1468
1469// Starts the level, which has already been loaded
1470void StartLevel() {
1471 extern void RestoreCameraRearviews(); // gameloop.cpp
1472
1473 // Init time
1474 Gametime = 0.0f;
1475
1476 // Make sure all sounds have stopped
1477 Sound_system.StopAllSounds();
1478
1479 // Get the data for this level
1480 PageInAllData();
1481
1482 // TEMP HACK
1483 if (rend_SupportsBumpmapping())
1484 Detail_settings.Bumpmapping_enabled = 1;
1485 else
1486 Detail_settings.Bumpmapping_enabled = 0;
1487
1488 // Initialize a bunch of stuff for this level
1489 MakeBOA();
1490 ComputeAABB(true);
1491
1492 // Clear/reset objects & events
1493 ClearAllEvents();
1494 ClearRoomChanges();
1495 ResetMarkers();
1496 ResetScorches();
1497 ResetWaypoint();
1498 ResetLightGlows();
1499 DoorwayDeactivateAll();
1500 ClearViewerObjects();
1501 DeleteAmbientObjects();
1502
1503 // AI, scripting, & Soar
1504 AIInitAll();
1505
1506 // Set up the player object
1507 ResetPlayerObject(Player_num);
1508
1509 DSSoarInit();
1510
1511 InitMatcensForLevel();
1512
1513 // What is this?
1514 a_life.InitForLevel();
1515
1516 // Start sound & music
1517 StartLevelSounds();
1518 Sound_system.PauseSounds(); // HACK!! pause sounds started up to now.
1519 D3MusicStart(Current_level->score);
1520
1521 // Get the list of waypoints from the waypoint objects
1522 MakeAtuoWaypointList();
1523
1524// Test stuff
1525#ifdef _DEBUG
1526 InitTestSystems();
1527#endif

Callers 2

LoadAndStartCurrentLevelFunction · 0.85
StartGameFromEditorFunction · 0.85

Calls 15

PageInAllDataFunction · 0.85
MakeBOAFunction · 0.85
ComputeAABBFunction · 0.85
ClearAllEventsFunction · 0.85
ClearRoomChangesFunction · 0.85
ResetMarkersFunction · 0.85
ResetScorchesFunction · 0.85
ResetWaypointFunction · 0.85
ResetLightGlowsFunction · 0.85
DoorwayDeactivateAllFunction · 0.85
ClearViewerObjectsFunction · 0.85
DeleteAmbientObjectsFunction · 0.85

Tested by

no test coverage detected