mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-11 08:36:38 -04:00
Support displaying < 1 FPS in HUD
This commit is contained in:
parent
c4e8729034
commit
dfcd025cab
@ -669,7 +669,7 @@ static void Game_Free(void* obj) {
|
||||
Window_ProcessEvents(delta);\
|
||||
if (!gameRunning) return;\
|
||||
\
|
||||
if (delta > 1.0) delta = 1.0; /* avoid large delta with suspended process */ \
|
||||
if (delta > 5.0) delta = 5.0; /* avoid large delta with suspended process */ \
|
||||
if (delta > 0.0) { Game_FrameStart = render; Game_RenderFrame(delta); }
|
||||
|
||||
#ifdef CC_BUILD_WEB
|
||||
|
@ -88,13 +88,20 @@ static struct HUDScreen {
|
||||
static void HUDScreen_RemakeLine1(struct HUDScreen* s) {
|
||||
cc_string status; char statusBuffer[STRING_SIZE * 2];
|
||||
int indices, ping, fps;
|
||||
float real_fps;
|
||||
|
||||
String_InitArray(status, statusBuffer);
|
||||
/* Don't remake texture when FPS isn't being shown */
|
||||
if (!Gui.ShowFPS && s->line1.tex.ID) return;
|
||||
|
||||
fps = s->accumulator == 0 ? 1 : (int)(s->frames / s->accumulator);
|
||||
String_Format1(&status, "%i fps, ", &fps);
|
||||
|
||||
if (fps == 0) {
|
||||
/* Running at less than 1 FPS.. */
|
||||
real_fps = s->frames / s->accumulator;
|
||||
String_Format1(&status, "%f1 fps, ", &real_fps);
|
||||
} else {
|
||||
String_Format1(&status, "%i fps, ", &fps);
|
||||
}
|
||||
|
||||
if (Game_ClassicMode) {
|
||||
String_Format1(&status, "%i chunk updates", &Game.ChunkUpdates);
|
||||
|
Loading…
x
Reference in New Issue
Block a user