void D_DoomLoop (void) { if (demorecording) G_BeginRecording (); TryRunTics(); I_InitGraphics (); R_ExecuteSetViewSize(); D_StartGameLoop(); if (testcontrols) { wipegamestate = gamestate; } while (1) { // frame syncronous IO operations I_StartFrame (); // process one or more tics if (singletics) { I_StartTic (); D_ProcessEvents (); G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]); if (advancedemo) D_DoAdvanceDemo (); M_Ticker (); G_Ticker (); gametic++; maketic++; } else { TryRunTics (); // will run at least one tic } S_UpdateSounds (players[consoleplayer].mo);// move positional sounds // Update display, next frame, with current state. if (screenvisible) D_Display (); } }
// // D_DoomLoop // void D_DoomLoop (void) { if (bfgedition && (demorecording || (gameaction == ga_playdemo) || netgame)) { printf(" WARNING: You are playing using one of the Doom Classic\n" " IWAD files shipped with the Doom 3: BFG Edition. These are\n" " known to be incompatible with the regular IWAD files and\n" " may cause demos and network games to get out of sync.\n"); } if (demorecording) G_BeginRecording (); main_loop_started = true; TryRunTics(); I_SetWindowTitle(gamedescription); I_GraphicsCheckCommandLine(); I_SetGrabMouseCallback(D_GrabMouseCallback); I_InitGraphics(); V_EnableLoadingDisk(SCREENWIDTH - LOADING_DISK_W, SCREENHEIGHT - LOADING_DISK_H); V_RestoreBuffer(); R_ExecuteSetViewSize(); D_StartGameLoop(); if (testcontrols) { wipegamestate = gamestate; } while (1) { // frame syncronous IO operations I_StartFrame (); TryRunTics (); // will run at least one tic S_UpdateSounds (players[consoleplayer].mo);// move positional sounds // Update display, next frame, with current state. if (screenvisible) D_Display (); } }
static void D_DoomLoop (void) { basetic = gametic; I_SubmitSound(); while (!doomexit) { // process one or more tics if (singletics) { I_StartTic (); G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]); if (advancedemo) D_DoAdvanceDemo (); M_Ticker (); G_Ticker (); gametic++; maketic++; } else TryRunTics (); // will run at least one tic // killough 3/16/98: change consoleplayer to displayplayer if (players[displayplayer].mo) // cph 2002/08/10 S_UpdateSounds(players[displayplayer].mo);// move positional sounds // Update display, next frame, with current state. D_Display(); // Give the system some time rb->yield(); } }
// // D_DoomLoop // void D_DoomLoop (void) { while (1) { try { TryRunTics (); // will run at least one tic if (!connected) CL_RequestConnectInfo(); // [RH] Use the consoleplayer's camera to update sounds S_UpdateSounds (listenplayer().camera); // move positional sounds S_UpdateMusic(); // play another chunk of music // Update display, next frame, with current state. D_Display (); } catch (CRecoverableError &error) { Printf_Bold ("\n%s\n", error.GetMsg().c_str()); CL_QuitNetGame (); G_ClearSnapshots (); DThinker::DestroyAllThinkers(); players.clear(); gameaction = ga_fullconsole; } } }
void H2_GameLoop(void) { if (M_CheckParm("-debugfile")) { char filename[20]; M_snprintf(filename, sizeof(filename), "debug%i.txt", consoleplayer); debugfile = fopen(filename, "w"); } I_SetWindowTitle(gamedescription); I_GraphicsCheckCommandLine(); I_SetGrabMouseCallback(D_GrabMouseCallback); I_InitGraphics(); while (1) { // Frame syncronous IO operations I_StartFrame(); // Process one or more tics // Will run at least one tic TryRunTics(); // Move positional sounds S_UpdateSounds(players[displayplayer].mo); DrawAndBlit(); } }
void D_DoomLoop (void) { if (demorecording) G_BeginRecording (); if (M_CheckParm ("-debugfile")) { char filename[20]; sprintf (filename,"debug%i.txt",consoleplayer); printf ("debug output to: %s\n",filename); debugfile = fopen (filename,"w"); } I_InitGraphics (); for (;;) { // frame syncronous IO operations I_StartFrame (); // process one or more tics if (singletics) { I_StartTic (); D_ProcessEvents (); G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]); if (advancedemo) D_DoAdvanceDemo (); M_Ticker (); G_Ticker (); gametic++; maketic++; } else { TryRunTics (); // will run at least one tic } S_UpdateSounds (players[consoleplayer].mo);// move positional sounds // Update display, next frame, with current state. D_Display (); #ifndef OS2 #ifndef SNDSERV // Sound mixing for the buffer is snychronous. I_UpdateSound(); #endif // Synchronous sound output is explicitly called. #ifndef SNDINTR // Update sound output. I_SubmitSound(); #endif #endif } }
FrameType D_DoomFrame(int& elapsedTicks) { // process one or more tics TryRunTics(elapsedTicks); // will run at least one tic S_UpdateSounds(players[consoleplayer].mo);// move positional sounds // Update display, next frame, with current state. return D_Display(); }
// // D_DoomLoop // // haleyjd 08/23/10: [STRIFE] Verified unmodified. // void D_DoomLoop (void) { if (demorecording) G_BeginRecording (); main_loop_started = true; TryRunTics(); if (!showintro) { I_SetWindowTitle(gamedescription); I_InitGraphics(); } I_EnableLoadingDisk(); I_SetGrabMouseCallback(D_GrabMouseCallback); V_RestoreBuffer(); R_ExecuteSetViewSize(); D_StartGameLoop(); if (testcontrols) { wipegamestate = gamestate; } while (1) { // frame syncronous IO operations I_StartFrame (); // process one or more tics TryRunTics (); // will run at least one tic S_UpdateSounds (players[consoleplayer].mo);// move positional sounds // Update display, next frame, with current state. if (screenvisible) D_Display (); } }
// // D_DoomLoop // void D_DoomLoop(void) { TryRunTics(); I_InitGraphics(); R_ExecuteSetViewSize(); D_StartGameLoop(); while (1) { TryRunTics(); // will run at least one tic S_UpdateSounds(players[consoleplayer].mo); // move positional sounds // Update display, next frame, with current state. if (screenvisible) D_Display(); } }
static void D_DoomLoop(void) { for (;;) { WasRenderedInTryRunTics = false; // frame syncronous IO operations I_StartFrame (); if (ffmap == gamemap) ffmap = 0; // process one or more tics if (singletics) { I_StartTic (); G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]); if (advancedemo) D_DoAdvanceDemo (); M_Ticker (); G_Ticker (); P_Checksum(gametic); gametic++; maketic++; } else TryRunTics (); // will run at least one tic // killough 3/16/98: change consoleplayer to displayplayer if (players[displayplayer].mo) // cph 2002/08/10 S_UpdateSounds(players[displayplayer].mo);// move positional sounds if (V_GetMode() == VID_MODEGL ? !movement_smooth || !WasRenderedInTryRunTics : !movement_smooth || !WasRenderedInTryRunTics || gamestate != wipegamestate ) { // Update display, next frame, with current state. D_Display(); } // CPhipps - auto screenshot if (auto_shot_fname && !--auto_shot_count) { auto_shot_count = auto_shot_time; M_DoScreenShot(auto_shot_fname); } } }
// MIKE 11/08 main game loop, called every frame by Flash void D_DoomLoop (void) { // frame syncronous IO operations I_StartFrame (); if(!wipe) { // process one or more tics if (singletics) { I_StartTic (); D_ProcessEvents (); G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]); if (advancedemo) D_DoAdvanceDemo (); M_Ticker (); G_Ticker (); gametic++; maketic++; } else { TryRunTics (); // will run at least one tic } S_UpdateSounds (players[consoleplayer].mo);// move positional sounds // Update display, next frame, with current state. //D_Display (); } // MIKE #ifndef SNDSERV // Sound mixing for the buffer is snychronous. I_UpdateSound(); #endif // Synchronous sound output is explicitly called. #ifndef SNDINTR // Update sound output. // I_SubmitSound(); #endif gameTime++; return AS3_Null(); }
void D_DoomLoop (void) { if (demorecording) G_BeginRecording (); if (M_CheckParm ("-debugfile")) { char filename[20]; sprintf (filename,"debug%i.txt",consoleplayer); printf ("debug output to: %s\n",filename); debugfile = fopen (filename,"w"); } I_InitGraphics (); while (1) { // frame syncronous IO operations I_StartFrame (); // process one or more tics if (singletics) { I_StartTic (); D_ProcessEvents (); G_BuildTiccmd (&netcmds[consoleplayer][maketic%BACKUPTICS]); if (advancedemo) D_DoAdvanceDemo (); M_Ticker (); G_Ticker (); gametic++; maketic++; } else { TryRunTics (); // will run at least one tic } S_UpdateSounds (players[consoleplayer].mo);// move positional sounds // Update display, next frame, with current state. D_Display (); } }
void D_DoomLoop(void) { //Doom loop WasRenderedInTryRunTics = FALSE; if (ffmap == gamemap) ffmap = 0; TryRunTics (); // will run at least one tic // killough 3/16/98: change consoleplayer to displayplayer if (players[displayplayer].mo) // cph 2002/08/10 S_UpdateSounds(players[displayplayer].mo);// move positional sounds if (!movement_smooth || !WasRenderedInTryRunTics || gamestate != wipegamestate) { // Update display, next frame, with current state. D_Display(); return; } }
void D_SRB2Loop(void) { tic_t oldentertics = 0, entertic = 0, realtics = 0, rendertimeout = INFTICS; if (dedicated) server = true; if (M_CheckParm("-voodoo")) // 256x256 Texture Limiter COM_BufAddText("gr_voodoocompatibility on\n"); // Pushing of + parameters is now done back in D_SRB2Main, not here. CONS_Printf("I_StartupKeyboard()...\n"); I_StartupKeyboard(); #ifdef _WINDOWS CONS_Printf("I_StartupMouse()...\n"); I_DoStartupMouse(); #endif oldentertics = I_GetTime(); // end of loading screen: CONS_Printf() will no more call FinishUpdate() con_startup = false; // make sure to do a d_display to init mode _before_ load a level SCR_SetMode(); // change video mode SCR_Recalc(); // Check and print which version is executed. // Use this as the border between setup and the main game loop being entered. CONS_Printf( "===========================================================================\n" " We hope you enjoy this game as\n" " much as we did making it!\n" " ...wait. =P\n" "===========================================================================\n"); // hack to start on a nice clear console screen. COM_ImmedExecute("cls;version"); if (rendermode == render_soft) V_DrawScaledPatch(0, 0, 0, (patch_t *)W_CacheLumpNum(W_GetNumForName("CONSBACK"), PU_CACHE)); I_FinishUpdate(); // page flip or blit buffer for (;;) { if (lastwipetic) { oldentertics = lastwipetic; lastwipetic = 0; } // get real tics entertic = I_GetTime(); realtics = entertic - oldentertics; oldentertics = entertic; #ifdef DEBUGFILE if (!realtics) if (debugload) debugload--; #endif if (!realtics && !singletics) { I_Sleep(); continue; } #ifdef HW3SOUND HW3S_BeginFrameUpdate(); #endif // don't skip more than 10 frames at a time // (fadein / fadeout cause massive frame skip!) if (realtics > 8) realtics = 1; // process tics (but maybe not if realtic == 0) TryRunTics(realtics); if (lastdraw || singletics || gametic > rendergametic) { rendergametic = gametic; rendertimeout = entertic+TICRATE/17; // Update display, next frame, with current state. D_Display(); supdate = false; if (moviemode) M_SaveFrame(); if (takescreenshot) // Only take screenshots after drawing. M_DoScreenShot(); } else if (rendertimeout < entertic) // in case the server hang or netsplit { // Lagless camera! Yay! if (gamestate == GS_LEVEL && netgame) { if (splitscreen && camera2.chase) P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false); if (camera.chase) P_MoveChaseCamera(&players[displayplayer], &camera, false); } D_Display(); if (moviemode) M_SaveFrame(); if (takescreenshot) // Only take screenshots after drawing. M_DoScreenShot(); } // consoleplayer -> displayplayer (hear sounds from viewpoint) S_UpdateSounds(); // move positional sounds // check for media change, loop music.. I_UpdateCD(); #ifdef HW3SOUND HW3S_EndFrameUpdate(); #endif } }
void D_SRB2Loop(void) { tic_t oldentertics = 0, entertic = 0, realtics = 0, rendertimeout = INFTICS; if (demorecording) G_BeginRecording(); // user settings if (dedicated) COM_BufAddText(va("exec \"%s"PATHSEP"adedserv.cfg\"\n", srb2home)); else COM_BufAddText(va("exec \"%s"PATHSEP"autoexec.cfg\" -noerror\n", srb2home)); if (dedicated) server = true; if (M_CheckParm("-voodoo")) // 256x256 Texture Limiter COM_BufAddText("gr_voodoocompatibility on\n"); // Pushing of + parameters is now done back in D_SRB2Main, not here. // end of loading screen: CONS_Printf() will no more call FinishUpdate() con_startup = false; CONS_Printf("I_StartupKeyboard...\n"); I_StartupKeyboard(); #ifdef _WINDOWS CONS_Printf("I_StartupMouse...\n"); I_DoStartupMouse(); #endif oldentertics = I_GetTime(); // make sure to do a d_display to init mode _before_ load a level SCR_SetMode(); // change video mode SCR_Recalc(); for (;;) { // get real tics entertic = I_GetTime(); realtics = entertic - oldentertics; oldentertics = entertic; #ifdef DEBUGFILE if (!realtics) if (debugload) debugload--; #endif if (!realtics && !singletics) { I_Sleep(); continue; } #ifdef HW3SOUND HW3S_BeginFrameUpdate(); #endif // process tics (but maybe not if realtic == 0) TryRunTics(realtics); if (lastdraw || singletics || gametic > rendergametic) { rendergametic = gametic; rendertimeout = entertic+TICRATE/17; // Update display, next frame, with current state. D_Display(); supdate = false; if (moviemode) { #ifdef HAVE_PNG M_SaveFrame(); #else COM_BufAddText("screenshot"); #endif } } else if (rendertimeout < entertic) // in case the server hang or netsplit { // Lagless camera! Yay! if (gamestate == GS_LEVEL && netgame) { if (splitscreen && camera2.chase) P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, true); if (camera.chase) P_MoveChaseCamera(&players[displayplayer], &camera, true); } D_Display(); } // consoleplayer -> displayplayer (hear sounds from viewpoint) S_UpdateSounds(); // move positional sounds // check for media change, loop music.. I_UpdateCD(); #ifdef HW3SOUND HW3S_EndFrameUpdate(); #endif } }
bool DoomLib::Tic( idUserCmdMgr * userCmdMgr ) { return TryRunTics( userCmdMgr ); }