#include "physics.qh"
+#include <client/autocvars.qh>
+#include <client/defs.qh>
+#include <client/miscfunctions.qh>
#include <client/main.qh>
#include <common/mapinfo.qh>
#include <lib/csqcmodel/cl_player.qh>
-// Physics panel (#15)
+// Physics (#15)
vector acc_prevspeed;
float acc_prevtime, acc_avg, top_speed, top_speed_time;
if(autocvar_hud_panel_physics == 3 && !(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
}
- HUD_Panel_UpdateCvars();
+ HUD_Panel_LoadCvars();
draw_beginBoldFont();
HUD_Scale_Enable();
else
HUD_Scale_Disable();
- HUD_Panel_DrawBg(1);
+ HUD_Panel_DrawBg();
if(panel_bg_padding)
{
panel_pos += '1 1 0' * panel_bg_padding;
}
}
- int acc_decimals = 2;
+ const int acc_decimals = 2;
if(time > physics_update_time)
{
+ discrete_acceleration = acceleration;
// workaround for ftos_decimals returning a negative 0
- if(discrete_acceleration > -1 / pow(10, acc_decimals) && discrete_acceleration < 0)
+ if(discrete_acceleration > -1 / (10 ** acc_decimals) && discrete_acceleration < 0)
discrete_acceleration = 0;
- discrete_acceleration = acceleration;
discrete_speed = speed;
physics_update_time += autocvar_hud_panel_physics_update_interval;
+ if(physics_update_time < time)
+ physics_update_time = time + autocvar_hud_panel_physics_update_interval;
}
//compute layout