mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
Implement damage tracking for the framecounter.
This fixes the framecounter in the soft renderer when `viewsize` is set to something smaller than 100. This requires the renerer to rerender bigger parts of the borders which has a measurable speed impact. About 5 frames less with the framecounter enabled on my system. No impact with `viewsize 100`.
This commit is contained in:
parent
be3e0cc695
commit
4db6534ab3
1 changed files with 6 additions and 0 deletions
|
@ -1475,6 +1475,8 @@ SCR_Framecounter(void) {
|
|||
char str[10];
|
||||
snprintf(str, sizeof(str), "%3.2ffps", (1000.0 * 1000.0) / (avg / num));
|
||||
DrawStringScaled(viddef.width - scale*(strlen(str)*8 + 2), 0, str, scale);
|
||||
SCR_AddDirtyPoint(viddef.width - scale*(strlen(str)*8 + 2), 0);
|
||||
SCR_AddDirtyPoint(viddef.width, 0);
|
||||
} else if (cl_showfps->value >= 2) {
|
||||
// Calculate average of frames.
|
||||
int avg = 0;
|
||||
|
@ -1506,12 +1508,16 @@ SCR_Framecounter(void) {
|
|||
snprintf(str, sizeof(str), "Min: %7.2ffps, Max: %7.2ffps, Avg: %7.2ffps",
|
||||
(1000.0 * 1000.0) / min, (1000.0 * 1000.0) / max, (1000.0 * 1000.0) / (avg / num));
|
||||
DrawStringScaled(viddef.width - scale*(strlen(str)*8 + 2), 0, str, scale);
|
||||
SCR_AddDirtyPoint(viddef.width - scale*(strlen(str)*8 + 2), 0);
|
||||
SCR_AddDirtyPoint(viddef.width, 0);
|
||||
|
||||
if (cl_showfps->value > 2)
|
||||
{
|
||||
snprintf(str, sizeof(str), "Max: %5.2fms, Min: %5.2fms, Avg: %5.2fms",
|
||||
0.001f*min, 0.001f*max, 0.001f*(avg / num));
|
||||
DrawStringScaled(viddef.width - scale*(strlen(str)*8 + 2), scale*10, str, scale);
|
||||
SCR_AddDirtyPoint(viddef.width - scale*(strlen(str)*8 + 2), scale*10);
|
||||
SCR_AddDirtyPoint(viddef.width, scale+10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue