]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/engineinfo.qc
Purge autocvars.qh from the client-side codebase, cvars are defined in the headers...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / engineinfo.qc
index ea136a21489abd1c111b457ec27855cd23a673fc..4b4911e33c7ebe41f6b0f3b1fc42f42278db39b3 100644 (file)
@@ -1,5 +1,13 @@
 #include "engineinfo.qh"
-// Engine info panel (#13)
+
+#include <client/draw.qh>
+
+// Engine info (#13)
+
+void HUD_EngineInfo_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
 
 float prevfps;
 float prevfps_time;
@@ -18,19 +26,23 @@ void HUD_EngineInfo()
                if(!autocvar_hud_panel_engineinfo) return;
        }
 
-       HUD_Panel_UpdateCvars();
+       HUD_Panel_LoadCvars();
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Panel_DrawBg(1);
+       if (autocvar_hud_panel_engineinfo_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
+       HUD_Panel_DrawBg();
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       float currentTime = gettime(GETTIME_REALTIME);
+       float currentTime = gettime(GETTIME_FRAMESTART);
        if(autocvar_hud_panel_engineinfo_framecounter_exponentialmovingaverage)
        {
                float currentframetime = currentTime - prevfps_time;
@@ -59,7 +71,6 @@ void HUD_EngineInfo()
                }
        }
 
-       vector color;
-       color = HUD_Get_Num_Color (prevfps, 100);
+       vector color = HUD_Get_Num_Color(prevfps, 100, true);
        drawstring_aspect(pos, sprintf(_("FPS: %.*f"), autocvar_hud_panel_engineinfo_framecounter_decimals, prevfps), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
 }