From: TimePath Date: Mon, 24 Aug 2015 08:13:43 +0000 (+1000) Subject: Move waypoint autocvars and initialization X-Git-Tag: xonotic-v0.8.2~2027^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=81eb9e150cf5398ec70c90e1248fc3c24dee3639;p=xonotic%2Fxonotic-data.pk3dir.git Move waypoint autocvars and initialization --- diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index a9a442b30..9f769cc28 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -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; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 0894b5991..6c7a94bdd 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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"); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 2bc260ffc..2f8888c75 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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; diff --git a/qcsrc/common/mutators/mutator/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypointsprites.qc index f048c8837..18d00518e 100644 --- a/qcsrc/common/mutators/mutator/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypointsprites.qc @@ -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; } diff --git a/qcsrc/common/mutators/mutator/waypointsprites.qh b/qcsrc/common/mutators/mutator/waypointsprites.qh index bd261128a..0c6cfadf5 100644 --- a/qcsrc/common/mutators/mutator/waypointsprites.qh +++ b/qcsrc/common/mutators/mutator/waypointsprites.qh @@ -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; diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 9d6c49d2f..27136d2c3 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -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;