MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / LoadGameLevel

Function LoadGameLevel

Source/diablo.cpp:2722–3010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2720}
2721
2722void LoadGameLevel(bool firstflag, lvl_entry lvldir)
2723{
2724 _music_id neededTrack = GetLevelMusic(leveltype);
2725 ClearFloatingNumbers();
2726
2727 if (neededTrack != sgnMusicTrack)
2728 music_stop();
2729 if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) {
2730 NewCursor(CURSOR_HAND);
2731 }
2732 SetRndSeed(glSeedTbl[currlevel]);
2733 IncProgress();
2734 MakeLightTable();
2735 SetDungeonMicros();
2736 ClearClxDrawCache();
2737 LoadLvlGFX();
2738 IncProgress();
2739
2740 if (firstflag) {
2741 CloseInventory();
2742 qtextflag = false;
2743 if (!HeadlessMode) {
2744 InitInv();
2745 ClearUniqueItemFlags();
2746 InitQuestText();
2747 InitInfoBoxGfx();
2748 InitHelp();
2749 }
2750 InitStores();
2751 InitAutomapOnce();
2752 }
2753 if (!setlevel) {
2754 SetRndSeed(glSeedTbl[currlevel]);
2755 } else {
2756 // Maps are not randomly generated, but the monsters max hitpoints are.
2757 // So we need to ensure that we have a stable seed when generating quest/set-maps.
2758 // For this purpose we reuse the normal dungeon seeds.
2759 SetRndSeed(glSeedTbl[static_cast<size_t>(setlvlnum)]);
2760 }
2761
2762 if (leveltype == DTYPE_TOWN) {
2763 SetupTownStores();
2764 } else {
2765 FreeStoreMem();
2766 }
2767
2768 if (firstflag || lvldir == ENTRY_LOAD) {
2769 bool isHellfireSaveGame = gbIsHellfireSaveGame;
2770 gbIsHellfireSaveGame = gbIsHellfire;
2771 LoadStash();
2772 gbIsHellfireSaveGame = isHellfireSaveGame;
2773 }
2774
2775 IncProgress();
2776 InitAutomap();
2777
2778 if (leveltype != DTYPE_TOWN && lvldir != ENTRY_LOAD) {
2779 InitLighting();

Callers 2

ShowProgressFunction · 0.85
LoadGameFunction · 0.85

Calls 15

ClearFloatingNumbersFunction · 0.85
NewCursorFunction · 0.85
SetRndSeedFunction · 0.85
IncProgressFunction · 0.85
MakeLightTableFunction · 0.85
SetDungeonMicrosFunction · 0.85
ClearClxDrawCacheFunction · 0.85
LoadLvlGFXFunction · 0.85
CloseInventoryFunction · 0.85
InitInvFunction · 0.85
ClearUniqueItemFlagsFunction · 0.85
InitQuestTextFunction · 0.85

Tested by

no test coverage detected