#include "view.qh"
#include "autocvars.qh"
-#include "miscfunctions.qh"
+#include <client/draw.qh>
#include "announcer.qh"
#include "hud/_mod.qh"
#include "main.qh"
viewmodels[slot] = new(viewmodel);
}
+vector project_3d_to_2d(vector vec)
+{
+ vec = cs_project(vec);
+ if(cs_project_is_b0rked > 0)
+ {
+ vec.x *= vid_conwidth / vid_width;
+ vec.y *= vid_conheight / vid_height;
+ }
+ return vec;
+}
+
+bool projected_on_screen(vector screen_pos)
+{
+ return screen_pos.z >= 0
+ && screen_pos.x >= 0
+ && screen_pos.y >= 0
+ && screen_pos.x < vid_conwidth
+ && screen_pos.y < vid_conheight;
+}
+
+void update_mousepos()
+{
+ mousepos += getmousepos() * autocvar_menu_mouse_speed;
+ mousepos.x = bound(0, mousepos.x, vid_conwidth);
+ mousepos.y = bound(0, mousepos.y, vid_conheight);
+}
+
float showfps_prevfps;
float showfps_prevfps_time;
int showfps_framecounter;
else if(STAT(FROZEN))
{
vector col = '0.25 0.90 1';
- if(STAT(REVIVE_PROGRESS))
- col += vec3(STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS), -STAT(REVIVE_PROGRESS));
- drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha, DRAWFLAG_ADDITIVE);
+ float col_fade = max(0, STAT(REVIVE_PROGRESS) * 2 - 1);
+ float alpha_fade = 0.3 + 0.7 * (1 - max(0, STAT(REVIVE_PROGRESS) * 4 - 3));
+ if(col_fade)
+ col += vec3(col_fade, -col_fade, -col_fade);
+ drawfill('0 0 0', vec2(vid_conwidth, vid_conheight), col, autocvar_hud_colorflash_alpha * alpha_fade, DRAWFLAG_ADDITIVE);
}
HUD_Scale_Enable();