void G_RunGame(void) { int next = 0; if(!demorecording && !demoplayback) { G_ReloadDefaults(); G_InitNew(startskill, startmap); } while(gameaction != ga_title) { if(gameaction == ga_loadgame) { G_DoLoadGame(); } else { G_DoLoadLevel(); if(gameaction == ga_title) { break; } } next = D_MiniLoop(P_Start, P_Stop, P_Drawer, P_Ticker); if(next == ga_loadlevel) { continue; // restart level from scratch } if(next == ga_warplevel || next == ga_warpquick) { continue; // skip intermission } if(next == ga_title) { return; // exit game and return to title screen } if(next == ga_completed) { next = D_MiniLoop(WI_Start, WI_Stop, WI_Drawer, WI_Ticker); } if(next == ga_victory) { next = D_MiniLoop(IN_Start, IN_Stop, IN_Drawer, IN_Ticker); if(next == ga_finale) { D_MiniLoop(F_Start, F_Stop, F_Drawer, F_Ticker); } } gamemap = nextmap; } }
static void D_DoomLoop(void) { int exit; if(netgame) gameaction = ga_newgame; exit = gameaction; while(1) { exit = D_MiniLoop(Title_Start, Title_Stop, Title_Drawer, Title_Ticker); if(exit == ga_newgame || exit == ga_loadgame) G_RunGame(); else { //D_MiniLoop(Credits_Start, NULL, Credits_Drawer, Credits_Ticker); if(gameaction == ga_title) continue; G_RunTitleMap(); continue; } } }
static void D_SplashScreen(void) { int skip = 0; if(gameaction || netgame) return; skip = D_MiniLoop(Splash_Start, Splash_Stop, Splash_Drawer, Splash_Ticker); if(skip != ga_title) { G_RunTitleMap(); gameaction = ga_title; } }
void G_RunTitleMap(void) { // villsa 12092013 - abort if map doesn't exist in mapfino if(P_GetMapInfo(33) == NULL) { return; } demobuffer = Z_Calloc(0x16000, PU_STATIC, NULL); demo_p = demobuffer; demobuffer[0x16000-1] = DEMOMARKER; G_InitNew(sk_medium, 33); precache = true; usergame = false; demoplayback = true; iwadDemo = true; rngseed = 0; G_DoLoadLevel(); D_MiniLoop(P_Start, P_Stop, P_Drawer, P_Ticker); }