fixed GUI main menu bar crash

This commit is contained in:
myT 2024-02-18 16:16:05 +01:00
parent dad7565aa0
commit e69dc0c57b
1 changed files with 9 additions and 1 deletions

View File

@ -1903,7 +1903,15 @@ void RE_DrawMainMenuBarInfo()
static uint32_t frameCount = 0; static uint32_t frameCount = 0;
static int displayedFPS = 0; static int displayedFPS = 0;
// frame times can be 0 in some cases
if(rhie.presentToPresentUS > 0)
{
frameTimes[frameCount++] = rhie.presentToPresentUS; frameTimes[frameCount++] = rhie.presentToPresentUS;
}
else
{
frameCount = 0;
}
if(frameCount == ARRAY_LEN(frameTimes)) if(frameCount == ARRAY_LEN(frameTimes))
{ {
uint32_t sum = 0; uint32_t sum = 0;