diff --git a/client/lg-renderer.h b/client/lg-renderer.h index e25808f0..eb5b5189 100644 --- a/client/lg-renderer.h +++ b/client/lg-renderer.h @@ -117,7 +117,7 @@ typedef bool (* LG_RendererOnMouseEvent)(void * opaque, const bool visib typedef bool (* LG_RendererOnFrameEvent)(void * opaque, const LG_RendererFormat format, const uint8_t * data); typedef void (* LG_RendererOnAlert )(void * opaque, const LG_RendererAlert alert, const char * message, bool ** closeFlag); typedef bool (* LG_RendererRender )(void * opaque, SDL_Window *window); -typedef void (* LG_RendererUpdateFPS )(void * opaque, const float avgFPS, const float renderFPS); +typedef void (* LG_RendererUpdateFPS )(void * opaque, const float avgUPS, const float avgFPS); typedef struct LG_Renderer { diff --git a/client/main.c b/client/main.c index 4dd96fd9..6215e7c1 100644 --- a/client/main.c +++ b/client/main.c @@ -210,13 +210,13 @@ int renderThread(void * unused) if (state.renderTime > 1e9) { - const float avgFPS = 1000.0f / (((float)state.renderTime / state.frameCount ) / 1e6f); - const float renderFPS = 1000.0f / (((float)state.renderTime / state.renderCount) / 1e6f); + const float avgUPS = 1000.0f / (((float)state.renderTime / state.frameCount ) / 1e6f); + const float avgFPS = 1000.0f / (((float)state.renderTime / state.renderCount) / 1e6f); state.renderTime = 0; state.frameCount = 0; state.renderCount = 0; - state.lgr->update_fps(state.lgrData, avgFPS, renderFPS); + state.lgr->update_fps(state.lgrData, avgUPS, avgFPS); } const uint64_t total = microtime() - start; diff --git a/client/renderers/egl.c b/client/renderers/egl.c index ff5e0901..dacf11a9 100644 --- a/client/renderers/egl.c +++ b/client/renderers/egl.c @@ -339,13 +339,13 @@ bool egl_render(void * opaque, SDL_Window * window) return true; } -void egl_update_fps(void * opaque, const float avgFPS, const float renderFPS) +void egl_update_fps(void * opaque, const float avgUPS, const float avgFPS) { struct Inst * this = (struct Inst *)opaque; if (!this->params.showFPS) return; - egl_fps_update(this->fps, avgFPS, renderFPS); + egl_fps_update(this->fps, avgUPS, avgFPS); } static void handle_opt_vsync(void * opaque, const char *value) diff --git a/client/renderers/egl/fps.h b/client/renderers/egl/fps.h index c73919e7..a0261025 100644 --- a/client/renderers/egl/fps.h +++ b/client/renderers/egl/fps.h @@ -28,5 +28,5 @@ typedef struct EGL_FPS EGL_FPS; bool egl_fps_init(EGL_FPS ** fps, const LG_Font * font, LG_FontObj fontObj); void egl_fps_free(EGL_FPS ** fps); -void egl_fps_update(EGL_FPS * fps, const float avgFPS, const float renderFPS); +void egl_fps_update(EGL_FPS * fps, const float avgUPS, const float avgFPS); void egl_fps_render(EGL_FPS * fps, const float screenWidth, const float screenHeight); \ No newline at end of file diff --git a/client/renderers/opengl.c b/client/renderers/opengl.c index 384fb994..36a7abe7 100644 --- a/client/renderers/opengl.c +++ b/client/renderers/opengl.c @@ -622,14 +622,14 @@ bool opengl_render(void * opaque, SDL_Window * window) return true; } -void opengl_update_fps(void * opaque, const float avgFPS, const float renderFPS) +void opengl_update_fps(void * opaque, const float avgUPS, const float avgFPS) { struct Inst * this = (struct Inst *)opaque; if (!this->params.showFPS) return; char str[128]; - snprintf(str, sizeof(str), "UPS: %8.4f, FPS: %8.4f", avgFPS, renderFPS); + snprintf(str, sizeof(str), "UPS: %8.4f, FPS: %8.4f", avgUPS, avgFPS); LG_FontBitmap *textSurface = NULL; if (!(textSurface = this->font->render(this->fontObj, 0xffffff00, str)))