]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Cleanup
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 5 Nov 2015 07:32:07 +0000 (18:32 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 5 Nov 2015 07:32:07 +0000 (18:32 +1100)
15 files changed:
qcsrc/client/main.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/miscfunctions.qh
qcsrc/client/particles.qc [deleted file]
qcsrc/client/particles.qh [deleted file]
qcsrc/client/progs.inc
qcsrc/client/teamradar.qc
qcsrc/client/teamradar.qh
qcsrc/common/physics.qh
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/lib/vector.qh
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/server/miscfunctions.qc

index 71765f5e06d23c322658e9ac7f54a47301b345a4..af1da5c2109aa7df8ed48dbce07acffb481897f4 100644 (file)
@@ -8,7 +8,6 @@
 #include "mapvoting.qh"
 #include "modeleffects.qh"
 #include "mutators/events.qh"
-#include "particles.qh"
 #include "quickmenu.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
index e8808e21299420831f25bb0fc78c088cfa8e3b06..ab4cb1f15673c6c952872e83e22f2048c3b15237 100644 (file)
@@ -156,15 +156,6 @@ float PreviewExists(string name)
        return false;
 }
 
-vector rotate(vector v, float a)
-{
-       vector w = '0 0 0';
-       // FTEQCC SUCKS AGAIN
-       w.x =      v.x * cos(a) + v.y * sin(a);
-       w.y = -1 * v.x * sin(a) + v.y * cos(a);
-       return w;
-}
-
 // decolorizes and team colors the player name when needed
 string playername(string thename, float teamid)
 {
@@ -199,10 +190,6 @@ vector project_3d_to_2d(vector vec)
        return vec;
 }
 
-void dummyfunction(float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8)
-{
-}
-
 float expandingbox_sizefactor_from_fadelerp(float fadelerp)
 {
        return 1.2 / (1.2 - fadelerp);
@@ -287,7 +274,6 @@ void drawstring_expanding(vector position, string text, vector theScale, vector
        sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
 
        drawfontscale = sz * '1 1 0';
-       dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
        drawstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, false, theScale * (sz / drawfontscale.x)) / (theScale.x * sz)), text, theScale * (sz / drawfontscale.x), rgb, theAlpha * (1 - fadelerp), flag);
        // width parameter:
        //    (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
@@ -307,7 +293,6 @@ void drawcolorcodedstring_expanding(vector position, string text, vector theScal
        sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
 
        drawfontscale = sz * '1 1 0';
-       dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
        drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, theScale, stringwidth(text, true, theScale * (sz / drawfontscale.x)) / (theScale.x * sz)), text, theScale * (sz / drawfontscale.x), theAlpha * (1 - fadelerp), flag);
        drawfontscale = '1 1 0';
 }
@@ -548,6 +533,7 @@ float getplayerisdead(float pl)
        return false;
 }
 
+/** engine callback */
 void URI_Get_Callback(int id, float status, string data)
 {
        if(url_URI_Get_Callback(id, status, data))
@@ -569,16 +555,6 @@ void URI_Get_Callback(int id, float status, string data)
        }
 }
 
-void draw_beginBoldFont()
-{
-       drawfont = FONT_USER+2;
-}
-
-void draw_endBoldFont()
-{
-       drawfont = FONT_USER+1;
-}
-
 void Accuracy_LoadLevels()
 {
        if(autocvar_accuracy_color_levels != acc_color_levels)
index b223d88b9ee1408f755ad627acf9c6aeff6558a6..60048d0497bdd65279c9ec7f1e57c0551031bab2 100644 (file)
@@ -44,7 +44,8 @@ float cvar_or(string cv, float v);
 
 vector project_3d_to_2d(vector vec);
 
-void dummyfunction(float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8);
+#define draw_beginBoldFont()    do { drawfont = FONT_USER + 2; } while (0)
+#define draw_endBoldFont()      do { drawfont = FONT_USER + 1; } while (0)
 
 float expandingbox_sizefactor_from_fadelerp(float fadelerp);
 
@@ -151,13 +152,6 @@ vector getcsqcplayercolor(float pl);
 
 float getplayerisdead(float pl);
 
-void URI_Get_Callback(int id, float status, string data);
-
-void draw_beginBoldFont();
-
-void draw_endBoldFont();
-
-
 const int MAX_ACCURACY_LEVELS = 10;
 float acc_lev[MAX_ACCURACY_LEVELS];
 vector acc_col[MAX_ACCURACY_LEVELS];
diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc
deleted file mode 100644 (file)
index 4c9ff20..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "particles.qh"
-
-#include "../common/stats.qh"
-
-#include "../lib/warpzone/common.qh"
-
-void Net_ReadVortexBeamParticle()
-{
-       vector shotorg, endpos;
-       float charge;
-       shotorg.x = ReadCoord(); shotorg.y = ReadCoord(); shotorg.z = ReadCoord();
-       endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord();
-       charge = ReadByte() / 255.0;
-
-       pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
-
-       //draw either the old v2.3 beam or the new beam
-       charge = sqrt(charge); // divide evenly among trail spacing and alpha
-       particles_alphamin = particles_alphamax = particles_fade = charge;
-
-       if (autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo()))
-               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
-       else
-               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
-}
-NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
-{
-       Net_ReadVortexBeamParticle();
-       return true;
-}
diff --git a/qcsrc/client/particles.qh b/qcsrc/client/particles.qh
deleted file mode 100644 (file)
index a35866c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef CLIENT_PARTICLES_H
-#define CLIENT_PARTICLES_H
-.int dphitcontentsmask;
-
-entityclass(PointParticles);
-class(PointParticles) .int cnt; // effect number
-class(PointParticles) .vector velocity; // particle velocity
-class(PointParticles) .float waterlevel; // direction jitter
-class(PointParticles) .int count; // count multiplier
-class(PointParticles) .int impulse; // density
-class(PointParticles) .string noise; // sound
-class(PointParticles) .float atten;
-class(PointParticles) .float volume;
-class(PointParticles) .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
-class(PointParticles) .vector movedir; // trace direction
-
-void Draw_PointParticles(entity this);
-
-void Ent_PointParticles_Remove();
-
-class(PointParticles) .float glow_color; // palette index
-
-void Net_ReadVortexBeamParticle();
-#endif
index e72a127944a51403436f82a1a94cb72fbf19eaff..17cde57b874de67b50925897eaeadc66dc0f6c0d 100644 (file)
@@ -14,7 +14,6 @@
 #include "miscfunctions.qc"
 #include "modeleffects.qc"
 #include "movelib.qc"
-#include "particles.qc"
 #include "player_skeleton.qc"
 #include "rubble.qc"
 #include "scoreboard.qc"
index 80f25fbb0b8c159ae34cfa77781e6ae60ab9962a..af43dae0373f125aa37d7856b65667dbb4880281 100644 (file)
@@ -58,12 +58,6 @@ vector teamradar_texcoord_to_3dcoord(vector in,float z)
        return out;
 }
 
-vector yinvert(vector v)
-{
-       v.y = 1 - v.y;
-       return v;
-}
-
 void draw_teamradar_background(float fg)
 {
        float fga;
index 0f51a2a0dde5574cb41b1079c51117ed311f0562..ca7ec87b59f14e58deab8b41a291556e00379fcd 100644 (file)
@@ -35,8 +35,6 @@ vector teamradar_texcoord_to_2dcoord(vector in);
 
 vector teamradar_texcoord_to_3dcoord(vector in,float z);
 
-vector yinvert(vector v);
-
 void draw_teamradar_background(float fg);
 
 void draw_teamradar_player(vector coord3d, vector pangles, vector rgb);
index d1f82991cd3308f4e5f45c70043e3f2ad076b0a9..5ee8954d0c1bd9cbdeb8232f0aef5692672d7b7d 100644 (file)
@@ -33,6 +33,7 @@ bool IsFlying(entity a);
        void PM_multijump();
 
        .float watertype;
+       .float waterlevel;
        .int items;
 
        .vector movement;
index 5e8636729c48a5e9183ef43314b071a2ba69d90c..470e5ff5ba2f4a84245e8e6926087b951a5af3c3 100644 (file)
@@ -1,7 +1,3 @@
-#ifdef CSQC
-       #include "../../../client/particles.qh"
-#endif
-
 #ifdef SVQC
 // NOTE: also contains func_sparks
 
@@ -183,6 +179,21 @@ spawnfunc(func_sparks)
 }
 #elif defined(CSQC)
 
+.int dphitcontentsmask;
+
+entityclass(PointParticles);
+class(PointParticles) .int cnt; // effect number
+class(PointParticles) .vector velocity; // particle velocity
+class(PointParticles) .float waterlevel; // direction jitter
+class(PointParticles) .int count; // count multiplier
+class(PointParticles) .int impulse; // density
+class(PointParticles) .string noise; // sound
+class(PointParticles) .float atten;
+class(PointParticles) .float volume;
+class(PointParticles) .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
+class(PointParticles) .vector movedir; // trace direction
+class(PointParticles) .float glow_color; // palette index
+
 void Draw_PointParticles(entity this)
 {
        float n, i, fail;
index 705bf66443bbffbde919e40177c5d1288e87038d..b5e81c8e6d9678d802c6658d2534ceb2976b4a15 100644 (file)
@@ -60,10 +60,8 @@ VORTEX_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 #endif
 #endif
 #ifdef IMPLEMENTATION
-#ifdef SVQC
-spawnfunc(weapon_vortex) { weapon_defaultspawnfunc(this, WEP_VORTEX); }
-spawnfunc(weapon_nex) { spawnfunc_weapon_vortex(this); }
 
+#if defined(SVQC)
 void SendCSQCVortexBeamParticle(float charge) {
        vector v;
        v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
@@ -76,6 +74,32 @@ void SendCSQCVortexBeamParticle(float charge) {
        WriteCoord(MSG_BROADCAST, v.z);
        WriteByte(MSG_BROADCAST, bound(0, 255 * charge, 255));
 }
+#elif defined(CSQC)
+NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew)
+{
+       vector shotorg, endpos;
+       float charge;
+       shotorg.x = ReadCoord(); shotorg.y = ReadCoord(); shotorg.z = ReadCoord();
+       endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord();
+       charge = ReadByte() / 255.0;
+
+       pointparticles(EFFECT_VORTEX_MUZZLEFLASH, shotorg, normalize(endpos - shotorg) * 1000, 1);
+
+       //draw either the old v2.3 beam or the new beam
+       charge = sqrt(charge); // divide evenly among trail spacing and alpha
+       particles_alphamin = particles_alphamax = particles_fade = charge;
+
+       if (autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo()))
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
+       else
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
+       return true;
+}
+#endif
+
+#ifdef SVQC
+spawnfunc(weapon_vortex) { weapon_defaultspawnfunc(this, WEP_VORTEX); }
+spawnfunc(weapon_nex) { spawnfunc_weapon_vortex(this); }
 
 void W_Vortex_Attack(Weapon thiswep, float issecondary)
 {SELFPARAM();
index de32d206f3b1f40235498f1914c7db66e2e6fd3c..6cbaebdcdb124aa7e18626b084902c8834394749 100644 (file)
@@ -63,6 +63,21 @@ vector vec3(float x, float y, float z)
        return v;
 }
 
+vector rotate(vector v, float a)
+{
+       float a_sin = sin(a), a_cos = cos(a);
+       vector r = '0 0 0';
+       r.x =      v.x * a_cos + v.y * a_sin;
+       r.y = -1 * v.x * a_sin + v.y * a_cos;
+       return r;
+}
+
+vector yinvert(vector v)
+{
+       v.y = 1 - v.y;
+       return v;
+}
+
 #ifndef MENUQC
        vector get_corner_position(entity box, int corner)
        {
index 146075ecaedc0842e145d98988be47ecc07db524..426048002255bb4ec838055409ead3ff54be17c6 100644 (file)
@@ -277,6 +277,7 @@ string _Nex_ExtResponseSystem_UpdateToURL;
 string _Nex_ExtResponseSystem_Packs;
 float _Nex_ExtResponseSystem_PacksStep;
 
+/** engine callback */
 void URI_Get_Callback(float id, float status, string data)
 {
        if(url_URI_Get_Callback(id, status, data))
index 9e989a4662070fea39b6ae7a8934dd2f1109f00a..79ce7c5eefa7abbaca8a705961879b6503762a13 100644 (file)
@@ -28,8 +28,6 @@ float updateCompression();
 
 void UpdateNotification_URI_Get_Callback(float id, float status, string data);
 
-void URI_Get_Callback(float id, float status, string data);
-
 // game type list box stuff (does not NEED to contain all game types, other
 // types stay available via console)
 int GameType_GetID(int cnt);
index 623387b579a6a8fd725826007952acf14a9312fe..de7559222744c29760621dc65a21ebc12a2a894f 100644 (file)
@@ -1341,7 +1341,7 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback()
        return false;
 }
 
-
+/** engine callback */
 void URI_Get_Callback(float id, float status, string data)
 {
        if(url_URI_Get_Callback(id, status, data))