- update more millisecond-storing data structures to u/int64_t to fix possible rollover bugs

This commit is contained in:
Rachael Alexanderson 2017-11-15 20:33:08 -05:00
commit 909daadd75
14 changed files with 36 additions and 35 deletions

View file

@ -870,8 +870,8 @@ void DFrameBuffer::DrawRateStuff ()
// Draws frame time and cumulative fps
if (vid_fps)
{
uint32_t ms = screen->FrameTime;
uint32_t howlong = ms - LastMS;
uint64_t ms = screen->FrameTime;
uint64_t howlong = ms - LastMS;
if ((signed)howlong >= 0)
{
char fpsbuff[40];
@ -888,7 +888,7 @@ void DFrameBuffer::DrawRateStuff ()
DTA_VirtualHeight, screen->GetHeight() / textScale,
DTA_KeepRatio, true, TAG_DONE);
uint32_t thisSec = ms/1000;
uint32_t thisSec = (uint32_t)(ms/1000);
if (LastSec < thisSec)
{
LastCount = FrameCount / (thisSec - LastSec);
@ -903,8 +903,8 @@ void DFrameBuffer::DrawRateStuff ()
// draws little dots on the bottom of the screen
if (ticker)
{
int i = I_GetTime();
int tics = i - LastTic;
int64_t i = I_GetTime();
int64_t tics = i - LastTic;
uint8_t *buffer = GetBuffer();
LastTic = i;
@ -931,6 +931,7 @@ void DFrameBuffer::DrawRateStuff ()
}
else
{
int i;
for (i = 0; i < tics*2; i += 2) Clear(i, Height-1, i+1, Height, 255, 0);
for ( ; i < 20*2; i += 2) Clear(i, Height-1, i+1, Height, 0, 0);
}