- Fixed: The FPS meter cannot use I_MSTime(), because if the game is started

with +vid_fps 1, it can need the time before the timer is ready to start.


SVN r2009 (trunk)
This commit is contained in:
Randy Heit 2009-11-29 02:57:09 +00:00
parent a5c8b33f10
commit 26f14f439b
6 changed files with 28 additions and 2 deletions

View file

@ -1,4 +1,6 @@
November 28, 2009 November 28, 2009
- Fixed: The FPS meter cannot use I_MSTime(), because if the game is started
with +vid_fps 1, it can need the time before the timer is ready to start.
- Initialize TempRenderTexture and the back buffer to black upon creation. - Initialize TempRenderTexture and the back buffer to black upon creation.
- Fixed: Windowed mode always needs to draw to the temporary surface, even - Fixed: Windowed mode always needs to draw to the temporary surface, even
when not gamma correcting, so that D3DFB::GetCurrentScreen() can read from when not gamma correcting, so that D3DFB::GetCurrentScreen() can read from

View file

@ -124,6 +124,12 @@ unsigned int I_MSTime (void)
return time - BaseTime; return time - BaseTime;
} }
// Exactly the same thing, but based does no modification to the time.
unsigned int I_FPSTime()
{
return SDL_GetTicks();
}
// //
// I_GetTime // I_GetTime
// returns time in 1/35th second tics // returns time in 1/35th second tics

View file

@ -126,6 +126,7 @@ bool I_WriteIniFailed ();
// [RH] Returns millisecond-accurate time // [RH] Returns millisecond-accurate time
unsigned int I_MSTime (void); unsigned int I_MSTime (void);
unsigned int I_FPSTime();
// Directory searching routines // Directory searching routines

View file

@ -838,7 +838,7 @@ void DFrameBuffer::DrawRateStuff ()
// Draws frame time and cumulative fps // Draws frame time and cumulative fps
if (vid_fps) if (vid_fps)
{ {
DWORD ms = I_MSTime (); DWORD ms = I_FPSTime();
DWORD howlong = ms - LastMS; DWORD howlong = ms - LastMS;
if (howlong >= 0) if (howlong >= 0)
{ {
@ -876,7 +876,7 @@ void DFrameBuffer::DrawRateStuff ()
// Buffer can be NULL if we're doing hardware accelerated 2D // Buffer can be NULL if we're doing hardware accelerated 2D
if (buffer != NULL) if (buffer != NULL)
{ {
buffer += (GetHeight()-1)*GetPitch(); buffer += (GetHeight()-1) * GetPitch();
for (i = 0; i < tics*2; i += 2) buffer[i] = 0xff; for (i = 0; i < tics*2; i += 2) buffer[i] = 0xff;
for ( ; i < 20*2; i += 2) buffer[i] = 0x00; for ( ; i < 20*2; i += 2) buffer[i] = 0x00;

View file

@ -280,6 +280,22 @@ unsigned int I_MSTime()
return timeGetTime() - basetime; return timeGetTime() - basetime;
} }
//==========================================================================
//
// I_FPSTime
//
// Returns the current system time in milliseconds. This is used by the FPS
// meter of DFrameBuffer::DrawRateStuff(). Since the screen can display
// before the play simulation is ready to begin, this needs to be
// separate from I_MSTime().
//
//==========================================================================
unsigned int I_FPSTime()
{
return timeGetTime();
}
//========================================================================== //==========================================================================
// //
// I_GetTimePolled // I_GetTimePolled

View file

@ -132,6 +132,7 @@ bool I_WriteIniFailed ();
// [RH] Returns millisecond-accurate time // [RH] Returns millisecond-accurate time
unsigned int I_MSTime (void); unsigned int I_MSTime (void);
unsigned int I_FPSTime();
// [RH] Title banner to display during startup // [RH] Title banner to display during startup
extern const IWADInfo *DoomStartupInfo; extern const IWADInfo *DoomStartupInfo;