From 4213c0fa6afbd4e062c47608aac84256e621d1fd Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 5 Feb 2015 07:39:14 +0100 Subject: [PATCH] Try to precache the crosshairs with mipmapping enabled. --- qcsrc/client/main.qc | 2 ++ qcsrc/client/view.qc | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 13f9545fa..7b34ce14a 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -52,6 +52,7 @@ void menu_sub_null() string forcefog; void WaypointSprite_Load(); void ConsoleCommand_macro_init(); +void View_Precache(); void CSQC_Init(void) { prvm_language = cvar_string("prvm_language"); @@ -122,6 +123,7 @@ void CSQC_Init(void) precache_sound("misc/hit.wav"); precache_sound("misc/typehit.wav"); + View_Precache(); Projectile_Precache(); Hook_Precache(); GibSplash_Precache(); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index ee8ef320a..681fed7a9 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -609,8 +609,10 @@ void UpdateCrosshair() } } - if(wcross_name == "") + if(wcross_name == "") { wcross_name = strcat("gfx/crosshair", wcross_style); + precache_pic(wcross_name, PRECACHE_PIC_MIPMAP); + } // MAIN CROSSHAIR COLOR DECISION switch(autocvar_crosshair_color_special) @@ -1796,6 +1798,12 @@ void CSQC_UpdateView(float w, float h) setproperty(VF_SIZE, '1 0 0' * w + '0 1 0' * h); } +void View_Precache(void) { + precache_pic("gfx/crosshair_ring.tga", PRECACHE_PIC_MIPMAP); + precache_pic("gfx/crosshair_ring_inner.tga", PRECACHE_PIC_MIPMAP); + precache_pic("gfx/crosshair_ring_rifle.tga", PRECACHE_PIC_MIPMAP); + precache_pic("gfx/crosshairdot.tga", PRECACHE_PIC_MIPMAP); +} void CSQC_common_hud(void) { -- 2.39.2