Commit 2eb949d3 authored by Mario's avatar Mario

Merge branch 'TimePath/refactor/nocompat' into 'master'

Remove dead code

Removes code between redundant `COMPAT` macros

See merge request !69
parents 9e55f951 d0c9f09e
......@@ -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()
......
......@@ -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);
......
......@@ -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
......
......@@ -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")
......
......@@ -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;
......
#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
......@@ -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
#ifndef NOCOMPAT
//# define WORKAROUND_XON010
//# define COMPAT_XON050_ENGINE
# define COMPAT_NO_MOD_IS_XONOTIC
# define COMPAT_XON060_DONTCRASH_CHECKPVS
#endif
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment