]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Try to precache the crosshairs with mipmapping enabled. divVerent/crosshair-mipmaps
authorRudolf Polzer <divverent@xonotic.org>
Thu, 5 Feb 2015 06:39:14 +0000 (07:39 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 5 Feb 2015 06:39:14 +0000 (07:39 +0100)
qcsrc/client/main.qc
qcsrc/client/view.qc

index 13f9545faab60a7c944d4d45b192dc6e16ca8a46..7b34ce14a09c22279ab02cc4d01641f516b70c64 100644 (file)
@@ -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();
index ee8ef320ae4643740f8bb275f848b9436914462f..681fed7a9d2c83e1143b14bb9f3b548769cb7f97 100644 (file)
@@ -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)
 {