소스 검색

Change the color of the FPS display if the FPS is low (orange for <30, red for < 15). (#1676)

Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
pull/1678/head
Jeffery Myers 4 년 전
committed by GitHub
부모
커밋
13f97471a2
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. +7
    -1
      src/text.c

+ 7
- 1
src/text.c 파일 보기

@ -817,7 +817,13 @@ void UnloadFont(Font font)
// NOTE: Uses default font
void DrawFPS(int posX, int posY)
{
DrawText(TextFormat("%2i FPS", GetFPS()), posX, posY, 20, LIME);
Color color = LIME; // good fps
int fps = GetFPS();
if (fps < 30 && fps >= 15) color = ORANGE; // warning FPS
else if (fps < 15) color = RED; // bad FPS
DrawText(TextFormat("%2i FPS", GetFPS()), posX, posY, 20, color);
}
// Draw text (using default font)

불러오는 중...
취소
저장