MCPcopy Create free account
hub / github.com/ZDoom/Raze / GameTicker

Function GameTicker

source/core/mainloop.cpp:179–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177//==========================================================================
178
179static void GameTicker()
180{
181 handleevents();
182
183 // Todo: Migrate state changes to here instead of doing them ad-hoc
184 while (gameaction != ga_nothing)
185 {
186 auto ga = gameaction;
187 gameaction = ga_nothing;
188 switch (ga)
189 {
190 case ga_autoloadgame:
191 C_FlushDisplay();
192 if (BackupSaveGame.IsNotEmpty() && cl_resumesavegame)
193 {
194 DoLoadGame(BackupSaveGame.GetChars());
195 }
196 else
197 {
198 g_nextmap = currentLevel;
199 FX_StopAllSounds();
200 S_SetReverb(0);
201 NewGame(g_nextmap, -1);
202 BackupSaveGame = "";
203 }
204 break;
205
206 case ga_completed:
207 FX_StopAllSounds();
208 S_SetReverb(0);
209 gi->LevelCompleted(g_nextmap, g_nextskill);
210 break;
211
212 case ga_nextlevel:
213 gi->FreeLevelData();
214 gameaction = ga_level;
215 gi->NextLevel(g_nextmap, g_nextskill);
216 ResetStatusBar();
217 if (!isBlood()) M_Autosave();
218 break;
219
220 case ga_newgame:
221 FX_StopAllSounds();
222 [[fallthrough]];
223 case ga_newgamenostopsound:
224 DeleteScreenJob();
225 S_SetReverb(0);
226 C_FlushDisplay();
227 BackupSaveGame = "";
228 NewGame(g_nextmap, g_nextskill, ga == ga_newgamenostopsound);
229 break;
230
231 case ga_startup:
232 Mus_Stop();
233 FX_StopAllSounds();
234 gi->FreeLevelData();
235 gamestate = GS_STARTUP;
236 break;

Callers 1

TryRunTicsFunction · 0.85

Calls 15

handleeventsFunction · 0.85
C_FlushDisplayFunction · 0.85
DoLoadGameFunction · 0.85
FX_StopAllSoundsFunction · 0.85
S_SetReverbFunction · 0.85
NewGameFunction · 0.85
ResetStatusBarFunction · 0.85
isBloodFunction · 0.85
M_AutosaveFunction · 0.85
DeleteScreenJobFunction · 0.85
M_StartControlPanelFunction · 0.85
M_SetMenuFunction · 0.85

Tested by

no test coverage detected