Skip to content

Commit

Permalink
Fixed: Randomly stalled main loop callback execution
Browse files Browse the repository at this point in the history
The waitingForDraw variable was not robust enough for all situations.
Sometimes it causing updates to stop completely (e.g., after switching
from busy mode).
  • Loading branch information
skyjake committed Apr 7, 2012
1 parent e5ea214 commit 2db8fcb
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions doomsday/engine/portable/src/dd_loop.c
Expand Up @@ -85,8 +85,6 @@ static int timeDeltasIndex = 0;

static float realFrameTimePos = 0;

static boolean waitingForDraw = false;

static void startFrame(void);
static void endFrame(void);
static void runTics(void);
Expand Down Expand Up @@ -118,7 +116,7 @@ int DD_GameLoop(void)

void DD_GameLoopCallback(void)
{
if(!novideo && waitingForDraw) return; // Only after the frame has been drawn, please.
if(novideo) return; // Only after the frame has been drawn, please.

if(Sys_IsShuttingDown())
return; // Shouldn't run this while shutting down.
Expand All @@ -137,9 +135,6 @@ void DD_GameLoopCallback(void)
// Request update of window contents.
Window_Draw(Window_Main());

// Don't run this callback until the drawing has occurred.
waitingForDraw = true;

if(!novideo)
{
GL_ProcessDeferredTasks(FRAME_DEFERRED_UPLOAD_TIMEOUT);
Expand All @@ -155,9 +150,6 @@ void DD_GameLoopDrawer(void)

assert(!Con_IsBusy()); // Busy mode has its own drawer.

// We will now be drawing the contents of the window.
waitingForDraw = false;

LIBDENG_ASSERT_IN_MAIN_THREAD();

// Frame syncronous I/O operations.
Expand Down

0 comments on commit 2db8fcb

Please sign in to comment.