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 "duke3d.h"
#include "demo.h" #include "demo.h"
//#include "premap.h" // G_UpdateScreenArea()
#include "menus.h" #include "menus.h"
#include "savegame.h" #include "savegame.h"
@ -554,16 +555,44 @@ nextdemo:
G_DrawBackground(); G_DrawBackground();
else else
{ {
static uint32_t nextrender = 0, framewaiting = 0;
uint32_t tt;
G_HandleLocalKeys(); G_HandleLocalKeys();
// j = min(max((totalclock-lockclock)*(65536/TICSPERFRAME),0),65536); // j = min(max((totalclock-lockclock)*(65536/TICSPERFRAME),0),65536);
j = min(max((totalclock - ototalclock) * (65536 / 4),0),65536); if (framewaiting)
if (g_demo_paused && g_demo_rewind) {
j = 65536-j; framewaiting--;
#if 0
if (ud.statusbarmode == 1 && (ud.statusbarscale == 100 || !getrendermode()))
{
ud.statusbarmode = 0;
G_UpdateScreenArea();
}
#endif
nextpage();
}
G_DrawRooms(screenpeek,j); tt = getticks();
G_DisplayRest(j);
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;
G_DrawRooms(screenpeek,j);
G_DisplayRest(j);
framewaiting++;
}
if ((g_player[myconnectindex].ps->gm&MODE_MENU) == 0) if ((g_player[myconnectindex].ps->gm&MODE_MENU) == 0)
{ {
@ -658,7 +687,7 @@ nextdemo:
} }
handleevents(); handleevents();
Net_GetPackets(); Net_GetPackets();
nextpage(); // nextpage();
if (g_player[myconnectindex].ps->gm == MODE_GAME) if (g_player[myconnectindex].ps->gm == MODE_GAME)
{ {