diff --git a/src/d_main.c b/src/d_main.c index ced90b261..8aff70d97 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -827,6 +827,11 @@ void D_SRB2Loop(void) { renderdeltatics = FloatToFixed(deltatics); + // I looked at the possibility of putting in a float drawer for + // perfstats and it's very complicated, so we'll just do this instead... + ps_interp_frac.value.p = (precise_t)((FIXED_TO_FLOAT(g_time.timefrac)) * 1000.0f); + ps_interp_lag.value.p = (precise_t)((deltasecs) * 1000.0f); + if (!(paused || P_AutoPause()) && deltatics < 1.0 && !hu_stopped) { rendertimefrac = g_time.timefrac; diff --git a/src/m_perfstats.c b/src/m_perfstats.c index 6b6a7f7db..52d65b020 100644 --- a/src/m_perfstats.c +++ b/src/m_perfstats.c @@ -126,11 +126,11 @@ perfstatrow_t commoncounter_rows[] = { {0} }; -/*perfstatrow_t interpolation_rows[] = { - {"intpfrc", "Interp frac: ", &ps_interp_frac, PS_TIME}, - {"intplag", "Interp lag: ", &ps_interp_lag, PS_TIME}, +perfstatrow_t interpolation_rows[] = { + {"intpfrc", "Interp frac: ", &ps_interp_frac, 0}, + {"intplag", "Interp lag: ", &ps_interp_lag, 0}, {0} -};*/ +}; #ifdef HWRENDER perfstatrow_t batchcount_rows[] = { @@ -553,8 +553,8 @@ static void PS_UpdateFrameStats(void) if (PS_IsLevelActive()) PS_UpdateRowHistories(commoncounter_rows, true); - /*if (R_UsingFrameInterpolation()) - PS_UpdateRowHistories(interpolation_rows, true);*/ + if (R_UsingFrameInterpolation()) + PS_UpdateRowHistories(interpolation_rows, true); #ifdef HWRENDER if (rendermode == render_opengl && cv_glbatching.value) @@ -773,7 +773,7 @@ static void PS_DrawRenderStats(void) { const boolean hires = PS_HighResolution(); const int half_row = hires ? 5 : 4; - int x, y = 10; //, cy = 10; + int x, y, cy = 10; PS_DrawDescriptorHeader(); @@ -784,7 +784,7 @@ static void PS_DrawRenderStats(void) if (PS_IsLevelActive()) { x = hires ? 115 : 90; - /*cy = */PS_DrawPerfRows(x, 10, V_BLUEMAP, commoncounter_rows);// + half_row; + cy = PS_DrawPerfRows(x, 10, V_BLUEMAP, commoncounter_rows) + half_row; #ifdef HWRENDER if (rendermode == render_opengl && cv_glbatching.value) @@ -799,11 +799,11 @@ static void PS_DrawRenderStats(void) #endif } - /*if (R_UsingFrameInterpolation()) + if (R_UsingFrameInterpolation()) { x = hires ? 115 : 90; - PS_DrawPerfRows(x, cy, V_ROSYMAP, interpolation_rows); - }*/ + PS_DrawPerfRows(x, cy, V_PEACHMAP, interpolation_rows); + } } static void PS_DrawGameLogicStats(void) diff --git a/src/r_fps.c b/src/r_fps.c index b9daabe06..5dbae1e9f 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -45,6 +45,9 @@ consvar_t cv_fpscap = {"fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, N consvar_t cv_precipinterp = {"precipinterpolation", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +ps_metric_t ps_interp_frac = {0}; +ps_metric_t ps_interp_lag = {0}; + UINT32 R_GetFramerateCap(void) { if (rendermode == render_none) diff --git a/src/r_fps.h b/src/r_fps.h index 006f80b67..2ca6f1bf3 100644 --- a/src/r_fps.h +++ b/src/r_fps.h @@ -18,10 +18,14 @@ #include "m_fixed.h" #include "p_local.h" #include "r_state.h" +#include "m_perfstats.h" extern consvar_t cv_fpscap; extern consvar_t cv_precipinterp; +extern ps_metric_t ps_interp_frac; +extern ps_metric_t ps_interp_lag; + UINT32 R_GetFramerateCap(void); boolean R_UsingFrameInterpolation(void);