Make r_maxfps functional in demo playback.

git-svn-id: https://svn.eduke32.com/eduke32@2326 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-02-09 22:44:09 +00:00
parent 968a999356
commit 1ada6d0529

View file

@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "duke3d.h"
#include "demo.h"
//#include "premap.h" // G_UpdateScreenArea()
#include "menus.h"
#include "savegame.h"
@ -554,10 +555,35 @@ nextdemo:
G_DrawBackground();
else
{
static uint32_t nextrender = 0, framewaiting = 0;
uint32_t tt;
G_HandleLocalKeys();
// j = min(max((totalclock-lockclock)*(65536/TICSPERFRAME),0),65536);
if (framewaiting)
{
framewaiting--;
#if 0
if (ud.statusbarmode == 1 && (ud.statusbarscale == 100 || !getrendermode()))
{
ud.statusbarmode = 0;
G_UpdateScreenArea();
}
#endif
nextpage();
}
tt = getticks();
if (r_maxfps == 0 || tt >= nextrender)
{
if (tt > nextrender+g_frameDelay)
nextrender = tt;
nextrender += g_frameDelay;
j = min(max((totalclock - ototalclock) * (65536 / 4),0),65536);
if (g_demo_paused && g_demo_rewind)
j = 65536-j;
@ -565,6 +591,9 @@ nextdemo:
G_DrawRooms(screenpeek,j);
G_DisplayRest(j);
framewaiting++;
}
if ((g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
{
if (demoplay_showsync && outofsync)
@ -658,7 +687,7 @@ nextdemo:
}
handleevents();
Net_GetPackets();
nextpage();
// nextpage();
if (g_player[myconnectindex].ps->gm == MODE_GAME)
{