Refactor debug info

Author Mitja Felicijan <mitja.felicijan@gmail.com> 2026-04-30 19:09:18 +0200
Committer Mitja Felicijan <mitja.felicijan@gmail.com> 2026-04-30 19:09:28 +0200
Commit ddde2e8fdf05efac5914ca2b812b7762b78ba9ec (patch)
-rw-r--r-- all.h 1
-rw-r--r-- game.c 5
-rw-r--r-- interface.c 6
3 files changed, 8 insertions, 4 deletions
diff --git a/all.h b/all.h
...
140
  
140
  
141
// Interface
141
// Interface
142
void DrawCrosshair(void);
142
void DrawCrosshair(void);
  
143
void DrawDebugInfo(void);
143
  
144
  
144
// Player
145
// Player
145
void UpdatePlayer(void);
146
void UpdatePlayer(void);
...
diff --git a/game.c b/game.c
...
325
        EndMode3D();
325
        EndMode3D();
326
        
326
        
327
        DrawCrosshair();
327
        DrawCrosshair();
328
        
328
        DrawDebugInfo();
329
        DrawTextEx(game.font_ui, TextFormat("%i FPS", GetFPS()), (Vector2){ 10, 10 }, 20, 2, GREEN);
  
330
        DrawTextEx(game.font_ui, TextFormat("VSync: %s", game.vsync ? "ON" : "OFF"), (Vector2){ 10, 35 }, 20, 2, GREEN);
  
331
        DrawTextEx(game.font_ui, TextFormat("Speed: %.0f", game.horizontal_speed), (Vector2){ 10, 60 }, 20, 2, GREEN);
  
332
    }
329
    }
333
  
330
  
334
    EndDrawing();
331
    EndDrawing();
...
diff --git a/interface.c b/interface.c
...
6
	DrawLine(screenWidth / 2 - 10, screenHeight / 2, screenWidth / 2 + 10, screenHeight / 2, GREEN);
6
	DrawLine(screenWidth / 2 - 10, screenHeight / 2, screenWidth / 2 + 10, screenHeight / 2, GREEN);
7
	DrawLine(screenWidth / 2, screenHeight / 2 - 10, screenWidth / 2, screenHeight / 2 + 10, GREEN);
7
	DrawLine(screenWidth / 2, screenHeight / 2 - 10, screenWidth / 2, screenHeight / 2 + 10, GREEN);
8
}
8
}
  
9
  
  
10
void DrawDebugInfo(void) {
  
11
    DrawTextEx(game.font_ui, TextFormat("%i FPS", GetFPS()), (Vector2){ 10, 10 }, 20, 2, GREEN);
  
12
    DrawTextEx(game.font_ui, TextFormat("VSync: %s", game.vsync ? "ON" : "OFF"), (Vector2){ 10, 35 }, 20, 2, GREEN);
  
13
    DrawTextEx(game.font_ui, TextFormat("Speed: %.0f", game.horizontal_speed), (Vector2){ 10, 60 }, 20, 2, GREEN);
  
14
}