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

Function LoadLevelProgress

Descent3/Mission.cpp:1318–1587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1316*/
1317bool Progress_screen_loaded = false;
1318void LoadLevelProgress(int step, float percent, const char *chunk) {
1319 static tLargeBitmap level_bmp;
1320 static bool level_bmp_loaded = false;
1321 static int dedicated_last_string_len = -1;
1322 float lvl_percent_loaded = 0;
1323 float pag_percent_loaded = 0;
1324 int i;
1325 static int n_text_msgs = 0;
1326 static char text_msgs[N_LOAD_MSGS][80];
1327 char str[80];
1328 // If we're loading a level, send out a heartbeat
1329 if ((Game_mode & GM_MULTI)) {
1330 MultiSendHeartbeat();
1331 }
1332 if (percent > 1.0f) {
1333 percent = 1.0f;
1334 } else if (percent < 0.0f) {
1335 percent = 0.0f;
1336 }
1337 if ((!Progress_screen_loaded) && (step != LOAD_PROGRESS_START))
1338 return;
1339 switch (step) {
1340 case LOAD_PROGRESS_START: {
1341 lvl_percent_loaded = 0.0f;
1342 pag_percent_loaded = 0.0f;
1343 dedicated_last_string_len = -1;
1344 const char *p = NULL;
1345 if ((!(Game_mode & GM_MULTI)) && (!Current_mission.levels[Current_mission.cur_level - 1].progress)) {
1346 p = "tunnelload.ogf";
1347 } else {
1348 p = Current_mission.levels[Current_mission.cur_level - 1].progress;
1349 }
1350
1351 if (p) {
1352 if (LoadLargeBitmap(IGNORE_TABLE(p), &level_bmp)) {
1353 SetScreenMode(SM_MENU);
1354 level_bmp_loaded = true;
1355 n_text_msgs = 0;
1356 }
1357 }
1358 /*
1359 else
1360 {
1361 ShowProgressScreen (TXT_LOADINGLEVEL);
1362 }
1363 */
1364 Progress_screen_loaded = true;
1365 return;
1366 } break;
1367 case LOAD_PROGRESS_LOADING_LEVEL: {
1368 lvl_percent_loaded = percent;
1369 } break;
1370 case LOAD_PROGRESS_PAGING_DATA: {
1371 lvl_percent_loaded = 1.0f;
1372 pag_percent_loaded = percent;
1373 } break;
1374 case LOAD_PROGRESS_PREPARE:
1375 if (Dedicated_server) {

Callers 8

StartLevelFunction · 0.85
PageInShipFunction · 0.85
PageInAllDataFunction · 0.85
ReadNewLightmapChunkFunction · 0.85
ReadLightmapChunkFunction · 0.85
ReadTerrainChunksFunction · 0.85
LoadLevelFunction · 0.85
LoadMissionLevelFunction · 0.85

Calls 15

MultiSendHeartbeatFunction · 0.85
LoadLargeBitmapFunction · 0.85
SetScreenModeFunction · 0.85
PrintDedicatedMessageFunction · 0.85
FreeLargeBitmapFunction · 0.85
nw_DoNetworkIdleFunction · 0.85
StartFrameFunction · 0.85
grtext_SetFontFunction · 0.85
grfont_GetHeightFunction · 0.85
grtext_SetColorFunction · 0.85
grtext_CenteredPrintfFunction · 0.85
DrawLargeBitmapFunction · 0.85

Tested by

no test coverage detected