mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-18 09:18:15 +00:00
Corrected crashing bug!
When SetTargetFPS(0) app crashes horribly (division by zero)
This commit is contained in:
@@ -689,7 +689,8 @@ void EndTextureMode(void)
|
|||||||
// Set target FPS for the game
|
// Set target FPS for the game
|
||||||
void SetTargetFPS(int fps)
|
void SetTargetFPS(int fps)
|
||||||
{
|
{
|
||||||
targetTime = 1.0/(double)fps;
|
if (fps < 1) targetTime = 0.0;
|
||||||
|
else targetTime = 1.0/(double)fps;
|
||||||
|
|
||||||
TraceLog(INFO, "Target time per frame: %02.03f milliseconds", (float)targetTime*1000);
|
TraceLog(INFO, "Target time per frame: %02.03f milliseconds", (float)targetTime*1000);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user