MCPcopy Create free account
hub / github.com/diasurgical/devilution / StartGame

Function StartGame

Source/diablo.cpp:85–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85BOOL StartGame(BOOL bNewGame, BOOL bSinglePlayer)
86{
87 BOOL fExitProgram;
88 unsigned int uMsg;
89
90 gbSelectProvider = TRUE;
91
92 do {
93 fExitProgram = FALSE;
94 gbLoadGame = FALSE;
95
96 if (!NetInit(bSinglePlayer, &fExitProgram)) {
97 gbRunGameResult = !fExitProgram;
98 break;
99 }
100
101 gbSelectProvider = FALSE;
102
103 if (bNewGame || !gbValidSaveFile) {
104 InitLevels();
105 InitQuests();
106 InitPortals();
107 InitDungMsgs(myplr);
108 }
109 if (!gbValidSaveFile || !gbLoadGame)
110 uMsg = WM_DIABNEWGAME;
111 else
112 uMsg = WM_DIABLOADGAME;
113
114 run_game_loop(uMsg);
115 NetClose();
116 pfile_create_player_description(0, 0);
117 } while (gbRunGameResult);
118
119 SNetDestroy();
120 return gbRunGameResult;
121}
122
123// Controller support: Actions to run after updating the cursor state.
124// Defined in SourceX/controls/plctrls.cpp.

Callers 1

mainmenu_init_menuFunction · 0.85

Calls 9

NetInitFunction · 0.85
InitLevelsFunction · 0.85
InitQuestsFunction · 0.85
InitPortalsFunction · 0.85
InitDungMsgsFunction · 0.85
run_game_loopFunction · 0.85
NetCloseFunction · 0.85
SNetDestroyFunction · 0.85

Tested by

no test coverage detected