diff --git a/src/rtext.c b/src/rtext.c index 5ca97d06d..66ccc78ca 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1069,13 +1069,14 @@ bool ExportFontAsCode(Font font, const char *fileName) // NOTE: Uses default font void DrawFPS(int posX, int posY) { - Color color = LIME; // Good FPS - int fps = GetFPS(); + const int fps = GetFPS(); - if ((fps < 30) && (fps >= 15)) color = ORANGE; // Warning FPS - else if (fps < 15) color = RED; // Low FPS + Color color = + fps < 15 ? RED : // Low FPS + fps < 30 ? ORANGE : // Warning FPS + LIME; // Good FPS - DrawText(TextFormat("%2i FPS", GetFPS()), posX, posY, 20, color); + DrawText(TextFormat("%2i FPS", fps), posX, posY, 20, color); } // Draw text (using default font)