]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move waypoint autocvars and initialization
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 24 Aug 2015 08:13:43 +0000 (18:13 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 24 Aug 2015 08:13:43 +0000 (18:13 +1000)
qcsrc/client/autocvars.qh
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/common/mutators/mutator/waypointsprites.qc
qcsrc/common/mutators/mutator/waypointsprites.qh
qcsrc/server/autocvars.qh

index a9a442b308f5068fa005b35f5d8baae579bda85e..9f769cc282b1864e59618b860dd1548f45e1a8fa 100644 (file)
@@ -158,32 +158,6 @@ float autocvar_g_balance_tuba_fadetime;
 float autocvar_g_balance_tuba_volume;
 int autocvar_g_balance_tuba_pitchstep;
 float autocvar_g_warmup_limit;
-bool autocvar_g_waypointsprite_uppercase;
-float autocvar_g_waypointsprite_alpha;
-float autocvar_g_waypointsprite_crosshairfadealpha;
-float autocvar_g_waypointsprite_crosshairfadedistance;
-float autocvar_g_waypointsprite_crosshairfadescale;
-float autocvar_g_waypointsprite_distancealphaexponent;
-float autocvar_g_waypointsprite_distancefadealpha;
-float autocvar_g_waypointsprite_distancefadedistancemultiplier;
-float autocvar_g_waypointsprite_distancefadescale;
-float autocvar_g_waypointsprite_edgefadealpha;
-float autocvar_g_waypointsprite_edgefadedistance;
-float autocvar_g_waypointsprite_edgefadescale;
-float autocvar_g_waypointsprite_edgeoffset_bottom;
-float autocvar_g_waypointsprite_edgeoffset_left;
-float autocvar_g_waypointsprite_edgeoffset_right;
-float autocvar_g_waypointsprite_edgeoffset_top;
-float autocvar_g_waypointsprite_fontsize;
-int autocvar_g_waypointsprite_itemstime;
-float autocvar_g_waypointsprite_minalpha;
-float autocvar_g_waypointsprite_minscale;
-float autocvar_g_waypointsprite_normdistance;
-float autocvar_g_waypointsprite_scale;
-int autocvar_g_waypointsprite_spam;
-float autocvar_g_waypointsprite_timealphaexponent;
-bool autocvar_g_waypointsprite_turrets = true;
-float autocvar_g_waypointsprite_turrets_maxdist = 5000;
 bool autocvar_hud_cursormode = true;
 float autocvar_hud_colorflash_alpha;
 bool autocvar_hud_configure_checkcollisions;
index 0894b59911a0ad2e59672f0eb7814e1336103e5c..6c7a94bdd3884795422894a944442f0dfa215206 100644 (file)
@@ -87,7 +87,6 @@ void menu_sub_null()
 }
 
 string forcefog;
-void WaypointSprite_Load();
 void ConsoleCommand_macro_init();
 void CSQC_Init(void)
 {
@@ -154,8 +153,6 @@ void CSQC_Init(void)
        CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
        CALL_ACCUMULATED_FUNCTION(RegisterEffects);
 
-       WaypointSprite_Load();
-
        // precaches
        precache_model("null");
        precache_sound("misc/hit.wav");
index 2bc260ffcfcefc294e8aeb3f0f7bd0a171b026b4..2f8888c75ee38ad4dce90425f3498a596469735d 100644 (file)
@@ -1011,6 +1011,7 @@ float cl_notice_run();
 float prev_myteam;
 int lasthud;
 float vh_notice_time;
+void WaypointSprite_Load();
 void CSQC_UpdateView(float w, float h)
 {
        entity e;
index f048c8837d85211e98cc43e59f1f323638b9c10f..18d00518eb5022e66eb7301b6ae6efd1cd9ecada 100644 (file)
@@ -783,6 +783,12 @@ void WaypointSprite_Load_Frames(string ext)
     search_end(dh);
 }
 
+void WaypointSprite_Load();
+STATIC_INIT(WaypointSprite_Load) {
+    WaypointSprite_Load();
+    WaypointSprite_Load_Frames(".tga");
+    WaypointSprite_Load_Frames(".jpg");
+}
 void WaypointSprite_Load()
 {
     waypointsprite_fadedistance = vlen(mi_scale);
@@ -808,13 +814,6 @@ void WaypointSprite_Load()
     waypointsprite_distancefadedistance = waypointsprite_fadedistance * autocvar_g_waypointsprite_distancefadedistancemultiplier;
     waypointsprite_alpha = autocvar_g_waypointsprite_alpha * (1 - autocvar__menu_alpha);
 
-    if (!waypointsprite_initialized)
-    {
-        WaypointSprite_Load_Frames(".tga");
-        WaypointSprite_Load_Frames(".jpg");
-        waypointsprite_initialized = true;
-    }
-
     waypointsprite_count = waypointsprite_newcount;
     waypointsprite_newcount = 0;
 }
index bd261128af13f9b9b4e5aa779ef3e63aca51d0ef..0c6cfadf587317fb1886495c2113add28342edbe 100644 (file)
@@ -19,7 +19,33 @@ class(WaypointSprite) .float build_started;
 class(WaypointSprite) .float build_starthealth;
 class(WaypointSprite) .float build_finished;
 
-float waypointsprite_initialized;
+bool autocvar_g_waypointsprite_uppercase;
+float autocvar_g_waypointsprite_alpha;
+float autocvar_g_waypointsprite_crosshairfadealpha;
+float autocvar_g_waypointsprite_crosshairfadedistance;
+float autocvar_g_waypointsprite_crosshairfadescale;
+float autocvar_g_waypointsprite_distancealphaexponent;
+float autocvar_g_waypointsprite_distancefadealpha;
+float autocvar_g_waypointsprite_distancefadedistancemultiplier;
+float autocvar_g_waypointsprite_distancefadescale;
+float autocvar_g_waypointsprite_edgefadealpha;
+float autocvar_g_waypointsprite_edgefadedistance;
+float autocvar_g_waypointsprite_edgefadescale;
+float autocvar_g_waypointsprite_edgeoffset_bottom;
+float autocvar_g_waypointsprite_edgeoffset_left;
+float autocvar_g_waypointsprite_edgeoffset_right;
+float autocvar_g_waypointsprite_edgeoffset_top;
+float autocvar_g_waypointsprite_fontsize;
+int autocvar_g_waypointsprite_itemstime;
+float autocvar_g_waypointsprite_minalpha;
+float autocvar_g_waypointsprite_minscale;
+float autocvar_g_waypointsprite_normdistance;
+float autocvar_g_waypointsprite_scale;
+int autocvar_g_waypointsprite_spam;
+float autocvar_g_waypointsprite_timealphaexponent;
+bool autocvar_g_waypointsprite_turrets = true;
+float autocvar_g_waypointsprite_turrets_maxdist = 5000;
+
 float waypointsprite_fadedistance;
 float waypointsprite_normdistance;
 float waypointsprite_minscale;
@@ -87,6 +113,10 @@ void Draw_WaypointSprite();
 #endif
 
 #ifdef SVQC
+float autocvar_sv_waypointsprite_deadlifetime;
+float autocvar_sv_waypointsprite_deployed_lifetime;
+float autocvar_sv_waypointsprite_limitedrange;
+
 ..entity owned_by_field;
 .float rule;
 .string model1;
index 9d6c49d2f0747164b1f95424944ab265965d6896..27136d2c3339fa8dd4eccd8eeba94c302d8a88d3 100644 (file)
@@ -642,9 +642,6 @@ float autocvar_sv_vote_stop;
 float autocvar_sv_vote_timeout;
 float autocvar_sv_vote_wait;
 bool autocvar_sv_vote_gamestart;
-float autocvar_sv_waypointsprite_deadlifetime;
-float autocvar_sv_waypointsprite_deployed_lifetime;
-float autocvar_sv_waypointsprite_limitedrange;
 string autocvar_sv_weaponstats_file;
 float autocvar_sv_gibhealth;
 float autocvar_sys_ticrate;