[client] rename fps variables to be more correct

This commit is contained in:
Geoffrey McRae 2018-12-12 23:59:22 +11:00
parent b927f991d6
commit 5fe2db7e56
5 changed files with 9 additions and 9 deletions

View file

@ -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
{

View file

@ -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;

View file

@ -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)

View file

@ -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);

View file

@ -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)))