summaryrefslogtreecommitdiff
path: root/src/d_loop.c
AgeCommit message (Collapse)Author
2015-05-31Fix bug with frames being rendered twice.Simon Howard
This actually (I believe) fixes three separate issues that are all aspects of the same bug: * Alexandre-Xavier reported that when running at full framerate, the single -devparm dot would flash (#374); * Linguica reported on Doomworld that Chocolate Doom appeared to be rendering each tic twice (see: http://www.doomworld.com/vb/post/1340374 ). * Harha reported performance problems when running in a VM, which may be related (http://www.doomworld.com/vb/post/1374315 ). Chocolate Doom long ago (41cdd5785305a) changed the main loop code so that it does not freeze in network games when tics stop being received; the idea is that it should always be possible to activate the menu to quit. Vanilla Doom allows this too, but only after 20 tics of waiting in TryRunTics() for network data to be received; the menu can be used but is deathly slow. So the loop was changed to wait for only 1 tic instead. However, there was an error in the logic for the check. In a single player game, when time has advanced to the point of being ready to execute another tic, NetUpdate() will build the new ticcmd_t; TryRunTics() was returning immediately; according to the timer, at the exact same time as tic generation, we had also been spinning in the loop for a whole tic and it was time to render a new frame. The end result was that each tic transition would trigger two frames to be rendered: the previous frame, and the new frame. Clearly this is not what is intended. To fix the problem: * Refactor the blocking loop in TryRunTics() so that we only bail out of the function after checking that the loop's exit condition has not just been satisfied (also to eliminate an unnecessary call to I_Sleep() between ticcmd_t generation and execution). * Increase the delay before we bail out to 5 tics rather than just 1. This is still much less than the 20 used in Vanilla Doom but is low enough to keep the menu responsive. A higher bar should ensure that this bug can't reoccur, even in multiplayer where the clocks can be adjusted for sync. This fixes #374. Thanks to everyone involved in reporting the different aspects of it.
2014-10-08Disable -oldsync startup message.Simon Howard
A message is printed if you are playing a game using the old sync code, which could put you at a disadvantage compared to other players. Disable this message for now as we're defaulting to old sync for the time being.
2014-10-08Use old network sync code by default.Simon Howard
The new netgame client sync code has the potential to be much better than the original sync code. However, it currently has a buggy controller and needs revisiting and overhauling (#358). For the time being, switch back to the old sync code by default and allow the new code to be enabled using the -newsync parameter (replacing the -oldsync parameter).
2014-05-05Clean up file headers.Simon Howard
This change rewrites and simplifies the copyright headers at the top of all source files: * Remove "Emacs style mode select" line; this line was included in the headers for the originally released source files and appears to be to set the file type for old versions of Emacs. I'm not sure entirely why it was required but I don't think it is any more. * Remove "You should have received a copy of..." text from copyright header. This refers to the old 59 Temple Place address where the FSF headquarters used to be located and is no longer correct. Rather than change to the new address, just remove the paragraph as it is superfluous anyway. This fixes #311. * Remove ---- separator lines so that the file headers are barer and more simplified.
2014-03-24Fix various Clang compiler warnings.Simon Howard
2013-09-04Fix Hexen -class parameter when starting a single player game from theSimon Howard
command line (thanks Alexandre Xavier). Subversion-branch: /branches/v2-branch Subversion-revision: 2634
2013-04-06Don't hog the CPU when waiting for the game to start.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2587
2013-04-05Use two-stage startup for Hexen, and add netgame startup callback forSimon Howard
the spinal loading screen. Subversion-branch: /branches/v2-branch Subversion-revision: 2585
2013-04-05Split Doom netgame startup into two stages.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2583
2013-04-05Split D_InitNetGame() into two separate functions for startup.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2582
2013-04-02Split game start sequence into two-stage process. This is the firstSimon Howard
stage in refactoring the way that network startup works. Subversion-branch: /branches/v2-branch Subversion-revision: 2580
2011-10-19Change MAXPLAYERS to NET_MAXPLAYERS and add back individual MAXPLAYERSSimon Howard
defines for each game. Refactor "waiting screen" data code. Subversion-branch: /branches/v2-branch Subversion-revision: 2441
2011-10-17Fix tic diffs to handle Strife fields correctly.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2436
2011-10-13Minor fixes to main loop code.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2419
2011-10-13Split out common main loop code into separate file, d_loop.c.Simon Howard
Subversion-branch: /branches/v2-branch Subversion-revision: 2413