mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
Fix latency issue introduced by G_FPSLimit() handling of videoNextPage() that was causing frames to be delayed presentation until after the next frame is prepared.
videoNextPage() is now called immediately after preparing the frame for drawing, outside of G_FPSLimit() but on the condition that its return value is true. git-svn-id: https://svn.eduke32.com/eduke32@7730 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
281ee3358b
commit
19c2c690d3
5 changed files with 15 additions and 8 deletions
|
@ -899,6 +899,7 @@ nextdemo_nomenu:
|
|||
if ((g_player[myconnectindex].ps->gm&MODE_MENU) && (g_player[myconnectindex].ps->gm&MODE_EOL))
|
||||
{
|
||||
Demo_FinishProfile();
|
||||
videoNextPage();
|
||||
goto RECHECK;
|
||||
}
|
||||
|
||||
|
@ -957,6 +958,8 @@ nextdemo_nomenu:
|
|||
if (ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
|
||||
rotatesprite_fs((320-50)<<16, 9<<16, 65536L, 0, BETAVERSION, 0, 0, 2+8+16+128);
|
||||
}
|
||||
|
||||
videoNextPage();
|
||||
}
|
||||
|
||||
// NOTE: We must prevent handleevents() and Net_GetPackets() from
|
||||
|
|
|
@ -6138,13 +6138,7 @@ void G_MaybeAllocPlayer(int32_t pnum)
|
|||
int G_FPSLimit(void)
|
||||
{
|
||||
static auto nextPageTicks = (double)timerGetTicksU64();
|
||||
static unsigned frameWaiting = 0;
|
||||
|
||||
if (frameWaiting)
|
||||
{
|
||||
frameWaiting--;
|
||||
videoNextPage();
|
||||
}
|
||||
int frameWaiting = 0;
|
||||
|
||||
auto const frameTicks = (double)timerGetTicksU64();
|
||||
|
||||
|
@ -6154,7 +6148,7 @@ int G_FPSLimit(void)
|
|||
nextPageTicks = frameTicks;
|
||||
|
||||
nextPageTicks += g_frameDelay;
|
||||
frameWaiting++;
|
||||
++frameWaiting;
|
||||
}
|
||||
|
||||
return frameWaiting;
|
||||
|
@ -6819,6 +6813,7 @@ MAIN_LOOP_RESTART:
|
|||
if (videoGetRenderMode() >= REND_POLYMOST)
|
||||
G_DrawBackground();
|
||||
G_DisplayRest(smoothRatio);
|
||||
videoNextPage();
|
||||
|
||||
if (gameUpdate)
|
||||
{
|
||||
|
|
|
@ -1253,6 +1253,7 @@ void Screen_Play(void)
|
|||
if (VM_OnEventWithReturn(EVENT_SCREEN, g_player[screenpeek].ps->i, screenpeek, I_CheckAllInput()))
|
||||
running = false;
|
||||
|
||||
videoNextPage();
|
||||
I_ClearAllInput();
|
||||
} while (running);
|
||||
}
|
||||
|
|
|
@ -4709,6 +4709,7 @@ void Net_WaitForServer(void)
|
|||
{
|
||||
display_betascreen();
|
||||
gametext_center_shade(170, "Waiting for server", 14);
|
||||
videoNextPage();
|
||||
}
|
||||
|
||||
// XXX: this looks like something that should be rate limited...
|
||||
|
|
|
@ -1572,6 +1572,7 @@ void gameDisplay3DRScreen()
|
|||
P_SetGamePalette(g_player[myconnectindex].ps, g_player[myconnectindex].ps->palette, 0);
|
||||
g_restorePalette = 0;
|
||||
}
|
||||
videoNextPage();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1676,6 +1677,9 @@ void gameDisplayTitleScreen(void)
|
|||
P_SetGamePalette(g_player[myconnectindex].ps, g_player[myconnectindex].ps->palette, 0);
|
||||
g_restorePalette = 0;
|
||||
}
|
||||
|
||||
videoNextPage();
|
||||
|
||||
#ifdef LUNATIC
|
||||
if (g_elEventError)
|
||||
break;
|
||||
|
@ -1882,6 +1886,7 @@ static void G_BonusCutscenes(void)
|
|||
rotatesprite_fs(breathe[t+3]<<16, breathe[t+4]<<16, 65536L, 0, breathe[t+2], 0, 0, 2+8+16+64+128+BGSTRETCH);
|
||||
}
|
||||
}
|
||||
videoNextPage();
|
||||
}
|
||||
|
||||
G_HandleAsync();
|
||||
|
@ -2306,6 +2311,7 @@ void G_BonusScreen(int32_t bonusonly)
|
|||
{
|
||||
videoClearScreen(0);
|
||||
G_DisplayMPResultsScreen();
|
||||
videoNextPage();
|
||||
}
|
||||
|
||||
if (I_CheckAllInput())
|
||||
|
@ -2578,6 +2584,7 @@ void G_BonusScreen(int32_t bonusonly)
|
|||
break;
|
||||
|
||||
VM_OnEvent(EVENT_DISPLAYBONUSSCREEN, g_player[screenpeek].ps->i, screenpeek);
|
||||
videoNextPage();
|
||||
}
|
||||
} while (1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue