From d0c9f09e15aac75e277d69de13bd23b719d3d52b Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 26 Dec 2014 17:15:34 +1100 Subject: [PATCH] Remove dead code --- qcsrc/client/Main.qc | 7 +------ qcsrc/client/View.qc | 15 ++------------- qcsrc/client/damage.qc | 4 ---- qcsrc/client/hud.qc | 12 ------------ qcsrc/client/shownames.qc | 4 ---- qcsrc/client/sys-post.qh | 9 --------- qcsrc/client/sys-pre.qh | 7 ------- qcsrc/common/util-pre.qh | 3 --- qcsrc/csqcmodellib/cl_model.qc | 4 ---- qcsrc/csqcmodellib/cl_player.qc | 17 ----------------- qcsrc/warpzonelib/client.qc | 26 +------------------------- 11 files changed, 4 insertions(+), 104 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 58bd4f4974..d6b00ec9f5 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -41,11 +41,6 @@ void CSQC_Init(void) float i; -#ifdef COMPAT_XON050_ENGINE - // old engine lacks implementation of player_localnum - player_localnum = player_localentnum - 1; -#endif - binddb = db_create(); tempdb = db_create(); ClientProgsDB = db_load("client.db"); @@ -523,7 +518,7 @@ void Ent_ClientData() } spectatee_status = newspectatee_status; - // non-COMPAT_XON050_ENGINE: we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum + // we could get rid of spectatee_status, and derive it from player_localentnum and player_localnum } void Ent_Nagger() diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 0eacfb7f33..220e44260d 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -1017,12 +1017,7 @@ void CSQC_UpdateView(float w, float h) CSQCPlayer_SetCamera(); -#ifdef COMPAT_XON050_ENGINE - if(spectatee_status) - myteam = GetPlayerColor(spectatee_status - 1); - else -#endif - myteam = GetPlayerColor(player_localentnum - 1); + myteam = GetPlayerColor(player_localentnum - 1); if(myteam != prev_myteam) { @@ -1299,15 +1294,9 @@ void CSQC_UpdateView(float w, float h) // ALWAYS Clear Current Scene First clearscene(); -#ifdef WORKAROUND_XON010 - if(checkextension("DP_CSQC_ROTATEMOVES")) - { -#endif + setproperty(VF_ORIGIN, view_origin); setproperty(VF_ANGLES, view_angles); -#ifdef WORKAROUND_XON010 - } -#endif // FIXME engine bug? VF_SIZE and VF_MIN are not restored to sensible values by this setproperty(VF_SIZE, vf_size); diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 64e12620da..162ef6a07e 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -22,11 +22,7 @@ void DamageEffect_Think() return; } self.state = self.owner.csqcmodel_isdead; -#ifdef COMPAT_XON050_ENGINE - if(self.owner.isplayermodel && (self.owner.entnum == player_localentnum || self.owner.entnum == spectatee_status) && !autocvar_chase_active) -#else if(self.owner.isplayermodel && (self.owner.entnum == player_localentnum) && !autocvar_chase_active) -#endif return; // if we aren't using a third person camera, hide our own effects // now generate the particles diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7359468e09..51c5c6489c 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2203,11 +2203,7 @@ void HUD_Score(void) vector distribution_color; entity tm, pl, me; -#ifdef COMPAT_XON050_ENGINE - me = (spectatee_status > 0) ? playerslots[spectatee_status - 1] : playerslots[player_localentnum - 1]; -#else me = playerslots[player_localentnum - 1]; -#endif if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD string timer, distrtimer; @@ -3708,11 +3704,7 @@ void HUD_InfoMessages(void) if(spectatee_status == -1) s = _("^1Observing"); else -#ifdef COMPAT_XON050_ENGINE - s = sprintf(_("^1Spectating: ^7%s"), GetPlayerName(spectatee_status - 1)); -#else s = sprintf(_("^1Spectating: ^7%s"), GetPlayerName(player_localentnum - 1)); -#endif drawInfoMessage(s) if(spectatee_status == -1) @@ -4533,11 +4525,7 @@ void HUD_Main (void) hud_skin_prev = strzone(autocvar_hud_skin); } -#ifdef COMPAT_XON050_ENGINE - current_player = (spectatee_status > 0) ? spectatee_status : player_localentnum; -#else current_player = player_localentnum; -#endif // draw the dock if(autocvar_hud_dock != "" && autocvar_hud_dock != "0") diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 3c89f312b0..4a948ca2e8 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -14,11 +14,7 @@ void Draw_ShowNames(entity ent) if(!autocvar_hud_shownames) return; -#ifdef COMPAT_XON050_ENGINE - if((ent.sv_entnum == player_localentnum) || (ent.sv_entnum == spectatee_status)) // ent is me or person i'm spectating -#else if(ent.sv_entnum == player_localentnum) // ent is me or person i'm spectating -#endif if(!(autocvar_hud_shownames_self && autocvar_chase_active)) return; diff --git a/qcsrc/client/sys-post.qh b/qcsrc/client/sys-post.qh index a883039fed..ec4e31ac33 100644 --- a/qcsrc/client/sys-post.qh +++ b/qcsrc/client/sys-post.qh @@ -1,12 +1,3 @@ #pragma noref 0 #undef ATTEN_NORM - -#ifdef COMPAT_050_ENGINE -// WORKAROUND for 0.5.0 engine -// FIXME remove this after 0.6 release -#undef getproperty -#undef getpropertyvec -float (float property) getproperty = #303; -vector (float property) getpropertyvec = #303; -#endif diff --git a/qcsrc/client/sys-pre.qh b/qcsrc/client/sys-pre.qh index 2f59e713d3..3b4fc14b59 100644 --- a/qcsrc/client/sys-pre.qh +++ b/qcsrc/client/sys-pre.qh @@ -2,11 +2,4 @@ #define ATTEN_NORM builtin_ATTEN_NORM -#ifdef COMPAT_050_ENGINE -// WORKAROUND for 0.5.0 engine -// FIXME remove this after 0.6 release -#define getproperty builtin_getproperty -#define getpropertyvec builtin_getpropertyvec -#endif - #pragma noref 1 diff --git a/qcsrc/common/util-pre.qh b/qcsrc/common/util-pre.qh index 3f4c3e57f4..634b0fdf1d 100644 --- a/qcsrc/common/util-pre.qh +++ b/qcsrc/common/util-pre.qh @@ -1,6 +1,3 @@ #ifndef NOCOMPAT -//# define WORKAROUND_XON010 -//# define COMPAT_XON050_ENGINE # define COMPAT_NO_MOD_IS_XONOTIC -# define COMPAT_XON060_DONTCRASH_CHECKPVS #endif diff --git a/qcsrc/csqcmodellib/cl_model.qc b/qcsrc/csqcmodellib/cl_model.qc index e04b92ecc8..7c723c44c2 100644 --- a/qcsrc/csqcmodellib/cl_model.qc +++ b/qcsrc/csqcmodellib/cl_model.qc @@ -263,11 +263,7 @@ void CSQCModel_Read(float isnew) setorigin(self, self.origin); // set obvious render flags -#ifdef COMPAT_XON050_ENGINE - if(self.entnum == player_localentnum || self.entnum == spectatee_status) -#else if(self.entnum == player_localentnum) -#endif self.renderflags |= RF_EXTERNALMODEL; else self.renderflags &= ~RF_EXTERNALMODEL; diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index 4f7381a4af..63db0ac14b 100644 --- a/qcsrc/csqcmodellib/cl_player.qc +++ b/qcsrc/csqcmodellib/cl_player.qc @@ -182,11 +182,7 @@ void CSQCPlayer_SetCamera() oldself = self; self = csqcplayer; -#ifdef COMPAT_XON050_ENGINE - if(servercommandframe == 0 || clientcommandframe == 0 || !(checkextension("DP_CSQC_V_CALCREFDEF") || checkextension("DP_CSQC_V_CALCREFDEF_WIP1"))) -#else if(servercommandframe == 0 || clientcommandframe == 0) -#endif { InterpolateOrigin_Do(); self.view_ofs = '0 0 1' * getstati(STAT_VIEWHEIGHT); @@ -265,11 +261,7 @@ void CSQCPlayer_SetCamera() } entity view; -#ifdef COMPAT_XON050_ENGINE - view = CSQCModel_server2csqc((spectatee_status > 0) ? spectatee_status : player_localentnum); -#else view = CSQCModel_server2csqc(player_localentnum); -#endif if(view && view != csqcplayer) { @@ -280,15 +272,6 @@ void CSQCPlayer_SetCamera() self = oldself; } -#ifdef COMPAT_XON050_ENGINE - if(view && !(checkextension("DP_CSQC_V_CALCREFDEF") || checkextension("DP_CSQC_V_CALCREFDEF_WIP1"))) - { - // legacy code, not totally correct, but good enough for not having V_CalcRefdef - setproperty(VF_ORIGIN, view.origin + '0 0 1' * getstati(STAT_VIEWHEIGHT)); - setproperty(VF_ANGLES, view_angles); - } - else -#endif if(view) { var float refdefflags = 0; diff --git a/qcsrc/warpzonelib/client.qc b/qcsrc/warpzonelib/client.qc index c2a110b4a1..9f540bc50a 100644 --- a/qcsrc/warpzonelib/client.qc +++ b/qcsrc/warpzonelib/client.qc @@ -2,12 +2,7 @@ void WarpZone_Fade_PreDraw() { vector org; org = getpropertyvec(VF_ORIGIN); - if( -#ifdef COMPAT_XON060_DONTCRASH_CHECKPVS - cvar_string("g_xonoticversion") != "0.5.0" && - cvar_string("g_xonoticversion") != "0.6.0" && -#endif - !checkpvs(org, self)) // this makes sense as long as we don't support recursive warpzones + if(!checkpvs(org, self)) // this makes sense as long as we don't support recursive warpzones self.alpha = 0; else if(self.warpzone_fadestart) self.alpha = bound(0, (self.warpzone_fadeend - vlen(org - self.origin - 0.5 * (self.mins + self.maxs))) / (self.warpzone_fadeend - self.warpzone_fadestart), 1); @@ -241,19 +236,12 @@ void WarpZone_FixView() warpzone_save_view_origin = org = getpropertyvec(VF_ORIGIN); warpzone_save_view_angles = ang = getpropertyvec(VF_ANGLES); -#ifdef WORKAROUND_XON010 - float dirty; - dirty = checkextension("DP_CSQC_ROTATEMOVES"); -#endif e = WarpZone_Find(org, org); if(e) { org = WarpZone_TransformOrigin(e, org); ang = WarpZone_TransformVAngles(e, ang); -#ifdef WORKAROUND_XON010 - dirty = 1; -#endif WarpZone_View_Inside(); } else @@ -269,23 +257,11 @@ void WarpZone_FixView() rick = getproperty(VF_CL_VIEWANGLES_Z); rick *= f; setproperty(VF_CL_VIEWANGLES_Z, rick); - -#ifdef WORKAROUND_XON010 - if(ang_z > 1 || ang_z < -1) - dirty = 1; -#endif ang_z *= f; #endif -#ifdef WORKAROUND_XON010 - if(dirty) - { -#endif setproperty(VF_ORIGIN, org); setproperty(VF_ANGLES, ang); -#ifdef WORKAROUND_XON010 - } -#endif nearclip = '0 0 1' * (cvar("r_nearclip") * 1.125); corner0 = cs_unproject('0 0 0' + nearclip); -- 2.39.2