fixed GUI main menu bar crash

This commit is contained in:
myT 2024-02-18 16:16:05 +01:00
parent dad7565aa0
commit e69dc0c57b

View file

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