diff --git a/src/screen.c b/src/screen.c index b996c93a8ac310f5f7f765074e5034884999e786..915875e9039ca9cfb5fb1ad2aaec49f626b79f1b 100644 --- a/src/screen.c +++ b/src/screen.c @@ -223,6 +223,7 @@ void SCR_Startup(void) CV_RegisterVar(&cv_fpscounter); CV_RegisterVar(&cv_tpscounter); + CV_RegisterVar(&cv_thinfps); CV_RegisterVar(&cv_constextsize); V_SetPalette(0); @@ -578,9 +579,18 @@ void SCR_DisplayTicRate(void) if (cv_fpscounter.value == 2) // compact counter { - V_DrawRightAlignedString(vid.width, h, - fpscntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%04.2f", averageFPS)); // use averageFPS directly - hstep = 8*vid.dup; + if(cv_thinfps.value) + { + V_DrawRightAlignedThinString(vid.width, h, + fpscntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%04.2f", averageFPS)); // use averageFPS directly + hstep = 8*vid.dup; + } + else + { + V_DrawString(vid.width, h, + fpscntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%04.2f", averageFPS)); // use averageFPS directly + hstep = 8*vid.dup; + } } else if (cv_fpscounter.value == 1) // full counter { @@ -593,26 +603,55 @@ void SCR_DisplayTicRate(void) else drawnstr = va("%4.2f", averageFPS); - width = V_StringWidth(drawnstr, V_NOSCALESTART); + width = (cv_thinfps.value) ? V_ThinStringWidth(drawnstr, V_NOSCALESTART) : V_StringWidth(drawnstr, V_NOSCALESTART); - V_DrawString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("FPS: ", V_NOSCALESTART)), h, - V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS: "); - V_DrawString(vid.width - width, h, - fpscntcolor|V_NOSCALESTART|V_USERHUDTRANS, drawnstr); - hstep = 8*vid.dup; + if(cv_thinfps.value) + { + V_DrawThinString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("FPS: ", V_NOSCALESTART)), h, + V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS: "); + V_DrawThinString(vid.width - width, h, + fpscntcolor|V_NOSCALESTART|V_USERHUDTRANS, drawnstr); + hstep = 8*vid.dup; + } + else + { + V_DrawString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("FPS: ", V_NOSCALESTART)), h, + V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS: "); + V_DrawString(vid.width - width, h, + fpscntcolor|V_NOSCALESTART|V_USERHUDTRANS, drawnstr); + hstep = 8*vid.dup; + } } if (cv_tpscounter.value == 2) // compact counter { - V_DrawRightAlignedString(vid.width, h-hstep, - ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%d", totaltics)); + if(cv_thinfps.value) + { + V_DrawRightAlignedThinString(vid.width, h-hstep, + ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%d", totaltics)); + } + else + { + V_DrawThinString(vid.width, h-hstep, + ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%d", totaltics)); + } } else if (cv_tpscounter.value == 1) // full counter - { - V_DrawString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("TPS: ", V_NOSCALESTART)), h-hstep, - V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "TPS: "); - V_DrawRightAlignedString(vid.width, h-hstep, - ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%d/%u", totaltics, TICRATE)); + { + if(cv_thinfps.value) + { + V_DrawThinString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("TPS: ", V_NOSCALESTART)), h-hstep, + V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "TPS: "); + V_DrawRightAlignedThinString(vid.width, h-hstep, + ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%d/%u", totaltics, TICRATE)); + } + else + { + V_DrawString(vid.width - ((7 * 8 * vid.dup) + V_StringWidth("TPS: ", V_NOSCALESTART)), h-hstep, + V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "TPS: "); + V_DrawRightAlignedString(vid.width, h-hstep, + ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%d/%u", totaltics, TICRATE)); + } } lasttic = ontic; } diff --git a/src/v_video.c b/src/v_video.c index 3e2a59a3a7e12b11dadca76410b21a8a76e91672..d01b176013860e31dbf01b45b61b890d40557f61 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -45,6 +45,7 @@ UINT8 *screens[5]; static CV_PossibleValue_t fpscounter_cons_t[] = {{0, "No"}, {1, "Full"}, {2, "Compact"}, {0, NULL}}; consvar_t cv_fpscounter = CVAR_INIT ("showfps", "No", "Displays the current framerate", CV_SAVE, fpscounter_cons_t, NULL); consvar_t cv_tpscounter = CVAR_INIT ("showtps", "No", "Displays the current ticrate", CV_SAVE, fpscounter_cons_t, NULL); +consvar_t cv_thinfps = CVAR_INIT("thinfps", "No", "Renders FPS/TPS display in a thinner font", CV_SAVE, CV_YesNo, NULL); static void CV_palette_OnChange(void); diff --git a/src/v_video.h b/src/v_video.h index a8904beac989b67250ce751832fc150f08606936..6e2bae1645077a8b7cb966aea732ce68ee3eca21 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -28,7 +28,7 @@ extern UINT8 *screens[5]; -extern consvar_t cv_fpscounter, cv_tpscounter, cv_constextsize, +extern consvar_t cv_fpscounter, cv_tpscounter, cv_thinfps, cv_constextsize, cv_globalgamma, cv_globalsaturation, cv_rhue, cv_yhue, cv_ghue, cv_chue, cv_bhue, cv_mhue, cv_rgamma, cv_ygamma, cv_ggamma, cv_cgamma, cv_bgamma, cv_mgamma,