ref: 83d4cf3fd1a257df21468f5bb3b4329e5cf8a40f
parent: 06eb848b99587ef882c121a5a65d2082e3b88aeb
author: Konstantinn Bonnet <[email protected]>
date: Wed Jan 28 15:38:38 EST 2015
remove more #else, GLQUAKE, QUAKE2; gcc warnings
--- a/asm_i386.h
+++ b/asm_i386.h
@@ -3,7 +3,8 @@
#ifdef ELF
#define C(label) label
-#else
+#endif
+#ifndef ELF
#define C(label) _##label
#endif
--- a/cl_input.c
+++ b/cl_input.c
@@ -299,10 +299,6 @@
cmd->sidemove *= cl_movespeedkey.value;
cmd->upmove *= cl_movespeedkey.value;
}
-
-#ifdef QUAKE2
- cmd->lightlevel = cl.light_level;
-#endif
}
@@ -356,13 +352,6 @@
MSG_WriteByte (&buf, in_impulse);
in_impulse = 0;
-
-#ifdef QUAKE2
-//
-// light level
-//
- MSG_WriteByte (&buf, cmd->lightlevel);
-#endif
//
// deliver the message
--- a/cl_main.c
+++ b/cl_main.c
@@ -516,10 +516,6 @@
if (ent->effects & EF_BRIGHTFIELD)
R_EntityParticles (ent);
-#ifdef QUAKE2
- if (ent->effects & EF_DARKFIELD)
- R_DarkFieldParticles (ent);
-#endif
if (ent->effects & EF_MUZZLEFLASH)
{
vec3_t fv, rv, uv;
@@ -549,23 +545,6 @@
dl->radius = 200 + (rand()&31);
dl->die = cl.time + 0.001;
}
-#ifdef QUAKE2
- if (ent->effects & EF_DARKLIGHT)
- {
- dl = CL_AllocDlight (i);
- VectorCopy (ent->origin, dl->origin);
- dl->radius = 200.0 + (rand()&31);
- dl->die = cl.time + 0.001;
- dl->dark = true;
- }
- if (ent->effects & EF_LIGHT)
- {
- dl = CL_AllocDlight (i);
- VectorCopy (ent->origin, dl->origin);
- dl->radius = 200;
- dl->die = cl.time + 0.001;
- }
-#endif
if (ent->model->flags & EF_GIB)
R_RocketTrail (oldorg, ent->origin, 2);
@@ -593,10 +572,6 @@
if (i == cl.viewentity && !chase_active.value)
continue;
-#ifdef QUAKE2
- if ( ent->effects & EF_NODRAW )
- continue;
-#endif
if (cl_numvisedicts < MAX_VISEDICTS)
{
cl_visedicts[cl_numvisedicts] = ent;
--- a/cl_parse.c
+++ b/cl_parse.c
@@ -318,7 +318,6 @@
qboolean forcelink;
entity_t *ent;
int num;
- int skin;
if (cls.signon == SIGNONS - 1)
{ // first update is the final signon stage
@@ -374,10 +373,6 @@
}
else
forcelink = true; // hack to make null model players work
-#ifdef GLQUAKE
- if (num > 0 && num <= cl.maxclients)
- R_TranslatePlayerSkin (num - 1);
-#endif
}
if (bits & U_FRAME)
@@ -398,24 +393,10 @@
ent->colormap = cl.scores[i-1].translations;
}
-#ifdef GLQUAKE
if (bits & U_SKIN)
- skin = MSG_ReadByte();
- else
- skin = ent->baseline.skin;
- if (skin != ent->skinnum) {
- ent->skinnum = skin;
- if (num > 0 && num <= cl.maxclients)
- R_TranslatePlayerSkin (num - 1);
- }
-
-#else
-
- if (bits & U_SKIN)
ent->skinnum = MSG_ReadByte();
else
ent->skinnum = ent->baseline.skin;
-#endif
if (bits & U_EFFECTS)
ent->effects = MSG_ReadByte();
@@ -623,9 +604,6 @@
memcpy (dest, vid.colormap, sizeof(cl.scores[slot].translations));
top = cl.scores[slot].colors & 0xf0;
bottom = (cl.scores[slot].colors &15)<<4;
-#ifdef GLQUAKE
- R_TranslatePlayerSkin (slot);
-#endif
for (i=0 ; i<VID_GRADES ; i++, dest += 256, source+=256)
{
--- a/cl_tent.c
+++ b/cl_tent.c
@@ -15,10 +15,6 @@
sfx_t *cl_sfx_ric2;
sfx_t *cl_sfx_ric3;
sfx_t *cl_sfx_r_exp3;
-#ifdef QUAKE2
-sfx_t *cl_sfx_imp;
-sfx_t *cl_sfx_rail;
-#endif
/*
=================
@@ -34,10 +30,6 @@
cl_sfx_ric2 = S_PrecacheSound ("weapons/ric2.wav");
cl_sfx_ric3 = S_PrecacheSound ("weapons/ric3.wav");
cl_sfx_r_exp3 = S_PrecacheSound ("weapons/r_exp3.wav");
-#ifdef QUAKE2
- cl_sfx_imp = S_PrecacheSound ("shambler/sattck1.wav");
- cl_sfx_rail = S_PrecacheSound ("weapons/lstart.wav");
-#endif
}
/*
@@ -99,9 +91,6 @@
{
int type;
vec3_t pos;
-#ifdef QUAKE2
- vec3_t endpos;
-#endif
dlight_t *dl;
int rnd;
int colorStart, colorLength;
@@ -129,11 +118,7 @@
pos[0] = MSG_ReadCoord ();
pos[1] = MSG_ReadCoord ();
pos[2] = MSG_ReadCoord ();
-#ifdef GLTEST
- Test_Spawn (pos);
-#else
R_RunParticleEffect (pos, vec3_origin, 0, 10);
-#endif
if ( rand() % 5 )
S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
else
@@ -242,33 +227,6 @@
dl->decay = 300;
S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
break;
-
-#ifdef QUAKE2
- case TE_IMPLOSION:
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
- S_StartSound (-1, 0, cl_sfx_imp, pos, 1, 1);
- break;
-
- case TE_RAILTRAIL:
- pos[0] = MSG_ReadCoord ();
- pos[1] = MSG_ReadCoord ();
- pos[2] = MSG_ReadCoord ();
- endpos[0] = MSG_ReadCoord ();
- endpos[1] = MSG_ReadCoord ();
- endpos[2] = MSG_ReadCoord ();
- S_StartSound (-1, 0, cl_sfx_rail, pos, 1, 1);
- S_StartSound (-1, 1, cl_sfx_r_exp3, endpos, 1, 1);
- R_RocketTrail (pos, endpos, 0+128);
- R_ParticleExplosion (endpos);
- dl = CL_AllocDlight (-1);
- VectorCopy (endpos, dl->origin);
- dl->radius = 350;
- dl->die = cl.time + 0.5;
- dl->decay = 300;
- break;
-#endif
default:
Sys_Error ("CL_ParseTEnt: bad type");
--- a/client.h
+++ b/client.h
@@ -6,9 +6,6 @@
float forwardmove;
float sidemove;
float upmove;
-#ifdef QUAKE2
- byte lightlevel;
-#endif
} usercmd_t;
typedef struct
@@ -56,9 +53,6 @@
float decay; // drop this each second
float minlight; // don't add when contributing less
int key;
-#ifdef QUAKE2
- qboolean dark; // subtracts light instead of adding
-#endif
} dlight_t;
@@ -205,12 +199,6 @@
// frag scoreboard
scoreboard_t *scores; // [cl.maxclients]
-#ifdef QUAKE2
-// light level at player's position including dlights
-// this is sent back to the server each frame
-// architectually ugly but it works
- int light_level;
-#endif
} client_state_t;
--- a/console.c
+++ b/console.c
@@ -478,9 +478,8 @@
// draw it
y = con_vislines-16;
-
for (i=0 ; i<con_linewidth ; i++)
- Draw_Character ( (i+1)<<3, con_vislines - 16, text[i]);
+ Draw_Character ( (i+1)<<3, y, text[i]);
// remove cursor
key_lines[edit_line][key_linepos] = 0;
--- a/d_edge.c
+++ b/d_edge.c
@@ -103,13 +103,10 @@
*/
void D_CalcGradients (msurface_t *pface)
{
- mplane_t *pplane;
float mipscale;
vec3_t p_temp1;
vec3_t p_saxis, p_taxis;
float t;
-
- pplane = pface->plane;
mipscale = 1.0 / (float)(1 << miplevel);
--- a/draw.c
+++ b/draw.c
@@ -91,12 +91,9 @@
*/
void Draw_Init (void)
{
- int i;
-
draw_chars = W_GetLumpName ("conchars");
draw_disc = W_GetLumpName ("disc");
draw_backtile = W_GetLumpName ("backtile");
-
r_rectdesc.width = draw_backtile->width;
r_rectdesc.height = draw_backtile->height;
r_rectdesc.ptexbytes = draw_backtile->data;
--- a/host.c
+++ b/host.c
@@ -50,11 +50,7 @@
cvar_t samelevel = {"samelevel","0"};
cvar_t noexit = {"noexit","0",false,true};
-#ifdef QUAKE2
-cvar_t developer = {"developer","1"}; // should be 0 for release!
-#else
cvar_t developer = {"developer","0"};
-#endif
cvar_t skill = {"skill","1"}; // 0 - 3
cvar_t deathmatch = {"deathmatch","0"}; // 0, 1, or 2
@@ -532,27 +528,8 @@
==================
*/
-#ifdef FPS_20
-
-void _Host_ServerFrame (void)
-{
-// run the world state
- pr_global_struct->frametime = host_frametime;
-
-// read client messages
- SV_RunClients ();
-
-// move things around and think
-// always pause in single player if in console or menus
- if (!sv.paused && (svs.maxclients > 1 || key_dest == key_game) )
- SV_Physics ();
-}
-
void Host_ServerFrame (void)
{
- float save_host_frametime;
- float temp_host_frametime;
-
// run the world state
pr_global_struct->frametime = host_frametime;
@@ -562,35 +539,6 @@
// check for new clients
SV_CheckForNewClients ();
- temp_host_frametime = save_host_frametime = host_frametime;
- while(temp_host_frametime > (1.0/72.0))
- {
- if (temp_host_frametime > 0.05)
- host_frametime = 0.05;
- else
- host_frametime = temp_host_frametime;
- temp_host_frametime -= host_frametime;
- _Host_ServerFrame ();
- }
- host_frametime = save_host_frametime;
-
-// send all messages to the clients
- SV_SendClientMessages ();
-}
-
-#else
-
-void Host_ServerFrame (void)
-{
-// run the world state
- pr_global_struct->frametime = host_frametime;
-
-// set the time and clear the general datagram
- SV_ClearDatagram ();
-
-// check for new clients
- SV_CheckForNewClients ();
-
// read client messages
SV_RunClients ();
@@ -603,7 +551,6 @@
SV_SendClientMessages ();
}
-#endif
/*
--- a/host_cmd.c
+++ b/host_cmd.c
@@ -261,11 +261,7 @@
svs.serverflags = 0; // haven't completed an episode yet
strcpy (name, Cmd_Argv(1));
-#ifdef QUAKE2
- SV_SpawnServer (name, NULL);
-#else
SV_SpawnServer (name);
-#endif
if (!sv.active)
return;
@@ -292,36 +288,8 @@
*/
void Host_Changelevel_f (void)
{
-#ifdef QUAKE2
char level[MAX_QPATH];
- char _startspot[MAX_QPATH];
- char *startspot;
- if (Cmd_Argc() < 2)
- {
- Con_Printf ("changelevel <levelname> : continue game on a new level\n");
- return;
- }
- if (!sv.active || cls.demoplayback)
- {
- Con_Printf ("Only the server may changelevel\n");
- return;
- }
-
- strcpy (level, Cmd_Argv(1));
- if (Cmd_Argc() == 2)
- startspot = NULL;
- else
- {
- strcpy (_startspot, Cmd_Argv(2));
- startspot = _startspot;
- }
-
- SV_SaveSpawnparms ();
- SV_SpawnServer (level, startspot);
-#else
- char level[MAX_QPATH];
-
if (Cmd_Argc() != 2)
{
Con_Printf ("changelevel <levelname> : continue game on a new level\n");
@@ -335,7 +303,6 @@
SV_SaveSpawnparms ();
strcpy (level, Cmd_Argv(1));
SV_SpawnServer (level);
-#endif
}
/*
@@ -348,9 +315,6 @@
void Host_Restart_f (void)
{
char mapname[MAX_QPATH];
-#ifdef QUAKE2
- char startspot[MAX_QPATH];
-#endif
if (cls.demoplayback || !sv.active)
return;
@@ -359,12 +323,7 @@
return;
strcpy (mapname, sv.name); // must copy out, because it gets cleared
// in sv_spawnserver
-#ifdef QUAKE2
- strcpy(startspot, sv.startspot);
- SV_SpawnServer (mapname, startspot);
-#else
SV_SpawnServer (mapname);
-#endif
}
/*
@@ -594,22 +553,12 @@
current_skill = (int)(tfloat + 0.1);
Cvar_SetValue ("skill", (float)current_skill);
-#ifdef QUAKE2
- Cvar_SetValue ("deathmatch", 0);
- Cvar_SetValue ("coop", 0);
- Cvar_SetValue ("teamplay", 0);
-#endif
-
fscanf (f, "%s\n",mapname);
fscanf (f, "%f\n",&time);
CL_Disconnect_f ();
-#ifdef QUAKE2
- SV_SpawnServer (mapname, NULL);
-#else
SV_SpawnServer (mapname);
-#endif
if (!sv.active)
{
Con_Printf ("Couldn't load map\n");
@@ -688,200 +637,7 @@
}
}
-#ifdef QUAKE2
-void SaveGamestate()
-{
- char name[256];
- FILE *f;
- int i;
- char comment[SAVEGAME_COMMENT_LENGTH+1];
- edict_t *ent;
- sprintf (name, "%s/%s.gip", com_gamedir, sv.name);
-
- Con_Printf ("Saving game to %s...\n", name);
- f = fopen (name, "w");
- if (!f)
- {
- Con_Printf ("ERROR: couldn't open.\n");
- return;
- }
-
- fprintf (f, "%i\n", SAVEGAME_VERSION);
- Host_SavegameComment (comment);
- fprintf (f, "%s\n", comment);
-// for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
-// fprintf (f, "%f\n", svs.clients->spawn_parms[i]);
- fprintf (f, "%f\n", skill.value);
- fprintf (f, "%s\n", sv.name);
- fprintf (f, "%f\n", sv.time);
-
-// write the light styles
-
- for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
- {
- if (sv.lightstyles[i])
- fprintf (f, "%s\n", sv.lightstyles[i]);
- else
- fprintf (f,"m\n");
- }
-
-
- for (i=svs.maxclients+1 ; i<sv.num_edicts ; i++)
- {
- ent = EDICT_NUM(i);
- if ((int)ent->v.flags & FL_ARCHIVE_OVERRIDE)
- continue;
- fprintf (f, "%i\n",i);
- ED_Write (f, ent);
- fflush (f);
- }
- fclose (f);
- Con_Printf ("done.\n");
-}
-
-int LoadGamestate(char *level, char *startspot)
-{
- char name[MAX_OSPATH];
- FILE *f;
- char mapname[MAX_QPATH];
- float time, sk;
- char str[32768], *start;
- int i, r;
- edict_t *ent;
- int entnum;
- int version;
-// float spawn_parms[NUM_SPAWN_PARMS];
-
- sprintf (name, "%s/%s.gip", com_gamedir, level);
-
- Con_Printf ("Loading game from %s...\n", name);
- f = fopen (name, "r");
- if (!f)
- {
- Con_Printf ("ERROR: couldn't open.\n");
- return -1;
- }
-
- fscanf (f, "%i\n", &version);
- if (version != SAVEGAME_VERSION)
- {
- fclose (f);
- Con_Printf ("Savegame is version %i, not %i\n", version, SAVEGAME_VERSION);
- return -1;
- }
- fscanf (f, "%s\n", str);
-// for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
-// fscanf (f, "%f\n", &spawn_parms[i]);
- fscanf (f, "%f\n", &sk);
- Cvar_SetValue ("skill", sk);
-
- fscanf (f, "%s\n",mapname);
- fscanf (f, "%f\n",&time);
-
- SV_SpawnServer (mapname, startspot);
-
- if (!sv.active)
- {
- Con_Printf ("Couldn't load map\n");
- return -1;
- }
-
-// load the light styles
- for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
- {
- fscanf (f, "%s\n", str);
- sv.lightstyles[i] = Hunk_Alloc (strlen(str)+1);
- strcpy (sv.lightstyles[i], str);
- }
-
-// load the edicts out of the savegame file
- while (!feof(f))
- {
- fscanf (f, "%i\n",&entnum);
- for (i=0 ; i<sizeof(str)-1 ; i++)
- {
- r = fgetc (f);
- if (r == EOF || !r)
- break;
- str[i] = r;
- if (r == '}')
- {
- i++;
- break;
- }
- }
- if (i == sizeof(str)-1)
- Sys_Error ("Loadgame buffer overflow");
- str[i] = 0;
- start = str;
- start = COM_Parse(str);
- if (!com_token[0])
- break; // end of file
- if (strcmp(com_token,"{"))
- Sys_Error ("First token isn't a brace");
-
- // parse an edict
-
- ent = EDICT_NUM(entnum);
- memset (&ent->v, 0, progs->entityfields * 4);
- ent->free = false;
- ED_ParseEdict (start, ent);
-
- // link it into the bsp tree
- if (!ent->free)
- SV_LinkEdict (ent, false);
- }
-
-// sv.num_edicts = entnum;
- sv.time = time;
- fclose (f);
-
-// for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
-// svs.clients->spawn_parms[i] = spawn_parms[i];
-
- return 0;
-}
-
-// changing levels within a unit
-void Host_Changelevel2_f (void)
-{
- char level[MAX_QPATH];
- char _startspot[MAX_QPATH];
- char *startspot;
-
- if (Cmd_Argc() < 2)
- {
- Con_Printf ("changelevel2 <levelname> : continue game on a new level in the unit\n");
- return;
- }
- if (!sv.active || cls.demoplayback)
- {
- Con_Printf ("Only the server may changelevel\n");
- return;
- }
-
- strcpy (level, Cmd_Argv(1));
- if (Cmd_Argc() == 2)
- startspot = NULL;
- else
- {
- strcpy (_startspot, Cmd_Argv(2));
- startspot = _startspot;
- }
-
- SV_SaveSpawnparms ();
-
- // save the current level's state
- SaveGamestate ();
-
- // try to restore the new level
- if (LoadGamestate (level, startspot))
- SV_SpawnServer (level, startspot);
-}
-#endif
-
-
//============================================================================
/*
@@ -1499,7 +1255,7 @@
void Host_Give_f (void)
{
char *t;
- int v, w;
+ int v;
eval_t *val;
if (cmd_source == src_command)
@@ -1869,9 +1625,6 @@
Cmd_AddCommand ("map", Host_Map_f);
Cmd_AddCommand ("restart", Host_Restart_f);
Cmd_AddCommand ("changelevel", Host_Changelevel_f);
-#ifdef QUAKE2
- Cmd_AddCommand ("changelevel2", Host_Changelevel2_f);
-#endif
Cmd_AddCommand ("connect", Host_Connect_f);
Cmd_AddCommand ("reconnect", Host_Reconnect_f);
Cmd_AddCommand ("name", Host_Name_f);
--- a/menu.c
+++ b/menu.c
@@ -1318,7 +1318,7 @@
void M_Keys_Draw (void)
{
- int i, l;
+ int i;
int keys[2];
char *name;
int x, y;
@@ -1338,8 +1338,6 @@
y = 48 + 8*i;
M_Print (16, y, bindnames[i][1]);
-
- l = strlen (bindnames[i][0]);
M_FindKeysForCommand (bindnames[i][0], keys);
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -617,36 +617,6 @@
}
-#ifdef QUAKE2
-extern trace_t SV_Trace_Toss (edict_t *ent, edict_t *ignore);
-
-void PF_TraceToss (void)
-{
- trace_t trace;
- edict_t *ent;
- edict_t *ignore;
-
- ent = G_EDICT(OFS_PARM0);
- ignore = G_EDICT(OFS_PARM1);
-
- trace = SV_Trace_Toss (ent, ignore);
-
- pr_global_struct->trace_allsolid = trace.allsolid;
- pr_global_struct->trace_startsolid = trace.startsolid;
- pr_global_struct->trace_fraction = trace.fraction;
- pr_global_struct->trace_inwater = trace.inwater;
- pr_global_struct->trace_inopen = trace.inopen;
- VectorCopy (trace.endpos, pr_global_struct->trace_endpos);
- VectorCopy (trace.plane.normal, pr_global_struct->trace_plane_normal);
- pr_global_struct->trace_plane_dist = trace.plane.dist;
- if (trace.ent)
- pr_global_struct->trace_ent = EDICT_TO_PROG(trace.ent);
- else
- pr_global_struct->trace_ent = EDICT_TO_PROG(sv.edicts);
-}
-#endif
-
-
/*
=================
PF_checkpos
@@ -929,14 +899,6 @@
G_INT(OFS_RETURN) = pr_string_temp - pr_strings;
}
-#ifdef QUAKE2
-void PF_etos (void)
-{
- sprintf (pr_string_temp, "entity %i", G_EDICTNUM(OFS_PARM0));
- G_INT(OFS_RETURN) = pr_string_temp - pr_strings;
-}
-#endif
-
void PF_Spawn (void)
{
edict_t *ed;
@@ -955,17 +917,12 @@
// entity (entity start, .string field, string match) find = #5;
void PF_Find (void)
-#ifdef QUAKE2
{
int e;
int f;
char *s, *t;
edict_t *ed;
- edict_t *first;
- edict_t *second;
- edict_t *last;
- first = second = last = (edict_t *)sv.edicts;
e = G_EDICTNUM(OFS_PARM0);
f = G_INT(OFS_PARM1);
s = G_STRING(OFS_PARM2);
@@ -982,50 +939,6 @@
continue;
if (!strcmp(t,s))
{
- if (first == (edict_t *)sv.edicts)
- first = ed;
- else if (second == (edict_t *)sv.edicts)
- second = ed;
- ed->v.chain = EDICT_TO_PROG(last);
- last = ed;
- }
- }
-
- if (first != last)
- {
- if (last != second)
- first->v.chain = last->v.chain;
- else
- first->v.chain = EDICT_TO_PROG(last);
- last->v.chain = EDICT_TO_PROG((edict_t *)sv.edicts);
- if (second && second != last)
- second->v.chain = EDICT_TO_PROG(last);
- }
- RETURN_EDICT(first);
-}
-#else
-{
- int e;
- int f;
- char *s, *t;
- edict_t *ed;
-
- e = G_EDICTNUM(OFS_PARM0);
- f = G_INT(OFS_PARM1);
- s = G_STRING(OFS_PARM2);
- if (!s)
- PR_RunError ("PF_Find: bad search string");
-
- for (e++ ; e < sv.num_edicts ; e++)
- {
- ed = EDICT_NUM(e);
- if (ed->free)
- continue;
- t = E_STRING(ed,f);
- if (!t)
- continue;
- if (!strcmp(t,s))
- {
RETURN_EDICT(ed);
return;
}
@@ -1033,7 +946,6 @@
RETURN_EDICT(sv.edicts);
}
-#endif
void PR_CheckEmptyString (char *s)
{
@@ -1428,51 +1340,7 @@
ent->v.angles[1] = anglemod (current + move);
}
-#ifdef QUAKE2
/*
-==============
-PF_changepitch
-==============
-*/
-void PF_changepitch (void)
-{
- edict_t *ent;
- float ideal, current, move, speed;
-
- ent = G_EDICT(OFS_PARM0);
- current = anglemod( ent->v.angles[0] );
- ideal = ent->v.idealpitch;
- speed = ent->v.pitch_speed;
-
- if (current == ideal)
- return;
- move = ideal - current;
- if (ideal > current)
- {
- if (move >= 180)
- move = move - 360;
- }
- else
- {
- if (move <= -180)
- move = move + 360;
- }
- if (move > 0)
- {
- if (move > speed)
- move = speed;
- }
- else
- {
- if (move < -speed)
- move = -speed;
- }
-
- ent->v.angles[0] = anglemod (current + move);
-}
-#endif
-
-/*
===============================================================================
MESSAGE WRITING
@@ -1619,21 +1487,6 @@
*/
void PF_changelevel (void)
{
-#ifdef QUAKE2
- char *s1, *s2;
-
- if (svs.changelevel_issued)
- return;
- svs.changelevel_issued = true;
-
- s1 = G_STRING(OFS_PARM0);
- s2 = G_STRING(OFS_PARM1);
-
- if ((int)pr_global_struct->serverflags & (SFL_NEW_UNIT | SFL_NEW_EPISODE))
- Cbuf_AddText (va("changelevel %s %s\n",s1, s2));
- else
- Cbuf_AddText (va("changelevel2 %s %s\n",s1, s2));
-#else
char *s;
// make sure we don't issue two changelevels
@@ -1643,166 +1496,8 @@
s = G_STRING(OFS_PARM0);
Cbuf_AddText (va("changelevel %s\n",s));
-#endif
}
-
-#ifdef QUAKE2
-
-#define CONTENT_WATER -3
-#define CONTENT_SLIME -4
-#define CONTENT_LAVA -5
-
-#define FL_IMMUNE_WATER 131072
-#define FL_IMMUNE_SLIME 262144
-#define FL_IMMUNE_LAVA 524288
-
-#define CHAN_VOICE 2
-#define CHAN_BODY 4
-
-#define ATTN_NORM 1
-
-void PF_WaterMove (void)
-{
- edict_t *self;
- int flags;
- int waterlevel;
- int watertype;
- float drownlevel;
- float damage = 0.0;
-
- self = PROG_TO_EDICT(pr_global_struct->self);
-
- if (self->v.movetype == MOVETYPE_NOCLIP)
- {
- self->v.air_finished = sv.time + 12;
- G_FLOAT(OFS_RETURN) = damage;
- return;
- }
-
- if (self->v.health < 0)
- {
- G_FLOAT(OFS_RETURN) = damage;
- return;
- }
-
- if (self->v.deadflag == DEAD_NO)
- drownlevel = 3;
- else
- drownlevel = 1;
-
- flags = (int)self->v.flags;
- waterlevel = (int)self->v.waterlevel;
- watertype = (int)self->v.watertype;
-
- if (!(flags & (FL_IMMUNE_WATER + FL_GODMODE)))
- if (((flags & FL_SWIM) && (waterlevel < drownlevel)) || (waterlevel >= drownlevel))
- {
- if (self->v.air_finished < sv.time)
- if (self->v.pain_finished < sv.time)
- {
- self->v.dmg = self->v.dmg + 2;
- if (self->v.dmg > 15)
- self->v.dmg = 10;
-// T_Damage (self, world, world, self.dmg, 0, FALSE);
- damage = self->v.dmg;
- self->v.pain_finished = sv.time + 1.0;
- }
- }
- else
- {
- if (self->v.air_finished < sv.time)
-// sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM);
- SV_StartSound (self, CHAN_VOICE, "player/gasp2.wav", 255, ATTN_NORM);
- else if (self->v.air_finished < sv.time + 9)
-// sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM);
- SV_StartSound (self, CHAN_VOICE, "player/gasp1.wav", 255, ATTN_NORM);
- self->v.air_finished = sv.time + 12.0;
- self->v.dmg = 2;
- }
-
- if (!waterlevel)
- {
- if (flags & FL_INWATER)
- {
- // play leave water sound
-// sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM);
- SV_StartSound (self, CHAN_BODY, "misc/outwater.wav", 255, ATTN_NORM);
- self->v.flags = (float)(flags &~FL_INWATER);
- }
- self->v.air_finished = sv.time + 12.0;
- G_FLOAT(OFS_RETURN) = damage;
- return;
- }
-
- if (watertype == CONTENT_LAVA)
- { // do damage
- if (!(flags & (FL_IMMUNE_LAVA + FL_GODMODE)))
- if (self->v.dmgtime < sv.time)
- {
- if (self->v.radsuit_finished < sv.time)
- self->v.dmgtime = sv.time + 0.2;
- else
- self->v.dmgtime = sv.time + 1.0;
-// T_Damage (self, world, world, 10*self.waterlevel, 0, TRUE);
- damage = (float)(10*waterlevel);
- }
- }
- else if (watertype == CONTENT_SLIME)
- { // do damage
- if (!(flags & (FL_IMMUNE_SLIME + FL_GODMODE)))
- if (self->v.dmgtime < sv.time && self->v.radsuit_finished < sv.time)
- {
- self->v.dmgtime = sv.time + 1.0;
-// T_Damage (self, world, world, 4*self.waterlevel, 0, TRUE);
- damage = (float)(4*waterlevel);
- }
- }
-
- if ( !(flags & FL_INWATER) )
- {
-
-// player enter water sound
- if (watertype == CONTENT_LAVA)
-// sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM);
- SV_StartSound (self, CHAN_BODY, "player/inlava.wav", 255, ATTN_NORM);
- if (watertype == CONTENT_WATER)
-// sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM);
- SV_StartSound (self, CHAN_BODY, "player/inh2o.wav", 255, ATTN_NORM);
- if (watertype == CONTENT_SLIME)
-// sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM);
- SV_StartSound (self, CHAN_BODY, "player/slimbrn2.wav", 255, ATTN_NORM);
-
- self->v.flags = (float)(flags | FL_INWATER);
- self->v.dmgtime = 0;
- }
-
- if (! (flags & FL_WATERJUMP) )
- {
-// self.velocity = self.velocity - 0.8*self.waterlevel*frametime*self.velocity;
- VectorMA (self->v.velocity, -0.8 * self->v.waterlevel * host_frametime, self->v.velocity, self->v.velocity);
- }
-
- G_FLOAT(OFS_RETURN) = damage;
-}
-
-
-void PF_sin (void)
-{
- G_FLOAT(OFS_RETURN) = sin(G_FLOAT(OFS_PARM0));
-}
-
-void PF_cos (void)
-{
- G_FLOAT(OFS_RETURN) = cos(G_FLOAT(OFS_PARM0));
-}
-
-void PF_sqrt (void)
-{
- G_FLOAT(OFS_RETURN) = sqrt(G_FLOAT(OFS_PARM0));
-}
-#endif
-
void PF_Fixme (void)
{
PR_RunError ("unimplemented bulitin");
@@ -1874,15 +1569,6 @@
PF_WriteString,
PF_WriteEntity,
-#ifdef QUAKE2
-PF_sin,
-PF_cos,
-PF_sqrt,
-PF_changepitch,
-PF_TraceToss,
-PF_etos,
-PF_WaterMove,
-#else
PF_Fixme,
PF_Fixme,
PF_Fixme,
@@ -1890,7 +1576,6 @@
PF_Fixme,
PF_Fixme,
PF_Fixme,
-#endif
SV_MoveToGoal,
PF_precache_file,
--- a/pr_exec.c
+++ b/pr_exec.c
@@ -630,11 +630,7 @@
case OP_STATE:
ed = PROG_TO_EDICT(pr_global_struct->self);
-#ifdef FPS_20
- ed->v.nextthink = pr_global_struct->time + 0.05;
-#else
ed->v.nextthink = pr_global_struct->time + 0.1;
-#endif
if (a->_float != ed->v.frame)
{
ed->v.frame = a->_float;
--- a/progdefs.h
+++ b/progdefs.h
@@ -1,5 +1,1 @@
-#ifdef QUAKE2
-#include "progdefs.q2"
-#else
#include "progdefs.q1"
-#endif
--- a/protocol.h
+++ b/protocol.h
@@ -141,8 +141,3 @@
// PGM 01/21/97
#define TE_BEAM 13
// PGM 01/21/97
-
-#ifdef QUAKE2
-#define TE_IMPLOSION 14
-#define TE_RAILTRAIL 15
-#endif
--- a/quakedef.h
+++ b/quakedef.h
@@ -1,13 +1,8 @@
// quakedef.h -- primary header for client
-//#define GLTEST // experimental stuff
-
#define QUAKE_GAME // as opposed to utilities
#define VERSION 1.09
-#define GLQUAKE_VERSION 1.00
-#define D3DQUAKE_VERSION 0.01
-#define WINQUAKE_VERSION 0.996
#define LINUX_VERSION 1.30
#define X11_VERSION 1.10
@@ -200,15 +195,8 @@
#include "client.h"
#include "progs.h"
#include "server.h"
-
-#ifdef GLQUAKE
-#include "gl_model.h"
-#endif
-#ifndef GLQUAKE
#include "model.h"
#include "d_iface.h"
-#endif
-
#include "input.h"
#include "world.h"
#include "keys.h"
@@ -217,10 +205,6 @@
#include "menu.h"
#include "crc.h"
#include "cdaudio.h"
-
-#ifdef GLQUAKE
-#include "glquake.h"
-#endif
//=============================================================================
--- a/r_local.h
+++ b/r_local.h
@@ -1,6 +1,5 @@
// r_local.h -- private refresh defs
-#ifndef GLQUAKE
#include "r_shared.h"
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
@@ -293,5 +292,3 @@
void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip);
void R_SplitEntityOnNode2 (mnode_t *node);
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
-
-#endif
--- a/r_main.c
+++ b/r_main.c
@@ -645,10 +645,6 @@
r_viewlighting.plightvec = lightvec;
-#ifdef QUAKE2
- cl.light_level = r_viewlighting.ambientlight;
-#endif
-
R_AliasDrawModel (&r_viewlighting);
}
@@ -943,8 +939,9 @@
R_SetupFrame ();
#ifdef PASSAGES
-SetVisibilityByPassages ();
-#else
+ SetVisibilityByPassages ();
+#endif
+#ifndef PASSAGES
R_MarkLeaves (); // done here so we know if we're in water
#endif
--- a/r_part.c
+++ b/r_part.c
@@ -46,49 +46,7 @@
Hunk_AllocName (r_numparticles * sizeof(particle_t), "particles");
}
-#ifdef QUAKE2
-void R_DarkFieldParticles (entity_t *ent)
-{
- int i, j, k;
- particle_t *p;
- float vel;
- vec3_t dir;
- vec3_t org;
- org[0] = ent->origin[0];
- org[1] = ent->origin[1];
- org[2] = ent->origin[2];
- for (i=-16 ; i<16 ; i+=8)
- for (j=-16 ; j<16 ; j+=8)
- for (k=0 ; k<32 ; k+=8)
- {
- if (!free_particles)
- return;
- p = free_particles;
- free_particles = p->next;
- p->next = active_particles;
- active_particles = p;
-
- p->die = cl.time + 0.2 + (rand()&7) * 0.02;
- p->color = 150 + rand()%6;
- p->type = pt_slowgrav;
-
- dir[0] = j*8;
- dir[1] = i*8;
- dir[2] = k*8;
-
- p->org[0] = org[0] + i + (rand()&3);
- p->org[1] = org[1] + j + (rand()&3);
- p->org[2] = org[2] + k + (rand()&3);
-
- VectorNormalize (dir);
- vel = 50 + (rand()&63);
- VectorScale (dir, vel, p->vel);
- }
-}
-#endif
-
-
/*
===============
R_EntityParticles
@@ -638,24 +596,11 @@
float dvel;
float frametime;
-#ifdef GLQUAKE
- vec3_t up, right;
- float scale;
-
- GL_Bind(particletexture);
- glEnable (GL_BLEND);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- glBegin (GL_TRIANGLES);
-
- VectorScale (vup, 1.5, up);
- VectorScale (vright, 1.5, right);
-#else
D_StartParticles ();
VectorScale (vright, xscaleshrink, r_pright);
VectorScale (vup, yscaleshrink, r_pup);
VectorCopy (vpn, r_ppn);
-#endif
frametime = cl.time - cl.oldtime;
time3 = frametime * 15;
time2 = frametime * 10; // 15;
@@ -691,24 +636,7 @@
break;
}
-#ifdef GLQUAKE
- // hack a scale up to keep particles from disapearing
- scale = (p->org[0] - r_origin[0])*vpn[0] + (p->org[1] - r_origin[1])*vpn[1]
- + (p->org[2] - r_origin[2])*vpn[2];
- if (scale < 20)
- scale = 1;
- else
- scale = 1 + scale * 0.004;
- glColor3ubv ((byte *)&d_8to24table[(int)p->color]);
- glTexCoord2f (0,0);
- glVertex3fv (p->org);
- glTexCoord2f (1,0);
- glVertex3f (p->org[0] + up[0]*scale, p->org[1] + up[1]*scale, p->org[2] + up[2]*scale);
- glTexCoord2f (0,1);
- glVertex3f (p->org[0] + right[0]*scale, p->org[1] + right[1]*scale, p->org[2] + right[2]*scale);
-#else
D_DrawParticle (p);
-#endif
p->org[0] += p->vel[0]*frametime;
p->org[1] += p->vel[1]*frametime;
p->org[2] += p->vel[2]*frametime;
@@ -761,10 +689,6 @@
break;
case pt_grav:
-#ifdef QUAKE2
- p->vel[2] -= grav * 20;
- break;
-#endif
case pt_slowgrav:
p->vel[2] -= grav;
break;
@@ -771,12 +695,6 @@
}
}
-#ifdef GLQUAKE
- glEnd ();
- glDisable (GL_BLEND);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
-#else
D_EndParticles ();
-#endif
}
--- a/r_shared.h
+++ b/r_shared.h
@@ -1,4 +1,3 @@
-#ifndef GLQUAKE
// r_shared.h: general refresh-related stuff shared between the refresh and the
// driver
@@ -134,5 +133,3 @@
} edge_t;
#endif // _R_SHARED_H_
-
-#endif // GLQUAKE
--- a/r_surf.c
+++ b/r_surf.c
@@ -99,24 +99,7 @@
else
dist = td + (sd>>1);
if (dist < minlight)
-#ifdef QUAKE2
- {
- unsigned temp;
- temp = (rad - dist)*256;
- i = t*smax + s;
- if (!cl_dlights[lnum].dark)
- blocklights[i] += temp;
- else
- {
- if (blocklights[i] > temp)
- blocklights[i] -= temp;
- else
- blocklights[i] = 0;
- }
- }
-#else
blocklights[t*smax + s] += (rad - dist)*256;
-#endif
}
}
}
--- a/render.h
+++ b/render.h
@@ -110,10 +110,6 @@
void R_ParseParticleEffect (void);
void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
void R_RocketTrail (vec3_t start, vec3_t end, int type);
-
-#ifdef QUAKE2
-void R_DarkFieldParticles (entity_t *ent);
-#endif
void R_EntityParticles (entity_t *ent);
void R_BlobExplosion (vec3_t org);
void R_ParticleExplosion (vec3_t org);
--- a/sbar.c
+++ b/sbar.c
@@ -1149,8 +1149,7 @@
*/
void Sbar_MiniDeathmatchOverlay (void)
{
- qpic_t *pic;
- int i, k, l;
+ int i, k;
int top, bottom;
int x, y, f;
char num[12];
@@ -1167,7 +1166,6 @@
Sbar_SortFrags ();
// draw the text
- l = scoreboardlines;
y = vid.height - sb_lines;
numlines = sb_lines/8;
if (numlines < 3)
--- a/server.h
+++ b/server.h
@@ -24,9 +24,6 @@
double lastchecktime;
char name[64]; // map name
-#ifdef QUAKE2
- char startspot[64];
-#endif
char modelname[64]; // maps/<name>.bsp, for model_precache[0]
struct model_s *worldmodel;
char *model_precache[MAX_MODELS]; // NULL terminated
@@ -102,10 +99,6 @@
#define MOVETYPE_NOCLIP 8
#define MOVETYPE_FLYMISSILE 9 // extra size to monsters
#define MOVETYPE_BOUNCE 10
-#ifdef QUAKE2
-#define MOVETYPE_BOUNCEMISSILE 11 // bounce w/o gravity
-#define MOVETYPE_FOLLOW 12 // track movement of aiment
-#endif
// edict->solid values
#define SOLID_NOT 0 // no interaction with other objects
@@ -138,10 +131,6 @@
#define FL_PARTIALGROUND 1024 // not all corners are valid
#define FL_WATERJUMP 2048 // player jumping out of water
#define FL_JUMPRELEASED 4096 // for jump debouncing
-#ifdef QUAKE2
-#define FL_FLASHLIGHT 8192
-#define FL_ARCHIVE_OVERRIDE 1048576
-#endif
// entity effects
@@ -149,12 +138,6 @@
#define EF_MUZZLEFLASH 2
#define EF_BRIGHTLIGHT 4
#define EF_DIMLIGHT 8
-#ifdef QUAKE2
-#define EF_DARKLIGHT 16
-#define EF_DARKFIELD 32
-#define EF_LIGHT 64
-#define EF_NODRAW 128
-#endif
#define SPAWNFLAG_NOT_EASY 256
#define SPAWNFLAG_NOT_MEDIUM 512
@@ -161,17 +144,6 @@
#define SPAWNFLAG_NOT_HARD 1024
#define SPAWNFLAG_NOT_DEATHMATCH 2048
-#ifdef QUAKE2
-// server flags
-#define SFL_EPISODE_1 1
-#define SFL_EPISODE_2 2
-#define SFL_EPISODE_3 4
-#define SFL_EPISODE_4 8
-#define SFL_NEW_UNIT 16
-#define SFL_NEW_EPISODE 32
-#define SFL_CROSS_TRIGGERS 65280
-#endif
-
//============================================================================
extern cvar_t teamplay;
@@ -229,8 +201,4 @@
void SV_CheckForNewClients (void);
void SV_RunClients (void);
void SV_SaveSpawnparms ();
-#ifdef QUAKE2
-void SV_SpawnServer (char *server, char *startspot);
-#else
void SV_SpawnServer (char *server);
-#endif
--- a/sv_main.c
+++ b/sv_main.c
@@ -425,12 +425,6 @@
ent = NEXT_EDICT(sv.edicts);
for (e=1 ; e<sv.num_edicts ; e++, ent = NEXT_EDICT(ent))
{
-#ifdef QUAKE2
- // don't send if flagged for NODRAW and there are no lighting effects
- if (ent->v.effects == EF_NODRAW)
- continue;
-#endif
-
// ignore if not touching a PV leaf
if (ent != clent) // clent is ALLWAYS sent
{
@@ -563,9 +557,7 @@
int i;
edict_t *other;
int items;
-#ifndef QUAKE2
eval_t *val;
-#endif
//
// send a damage message
@@ -607,9 +599,6 @@
// stuff the sigil bits into the high bits of items for sbar, or else
// mix in items2
-#ifdef QUAKE2
- items = (int)ent->v.items | ((int)ent->v.items2 << 23);
-#else
val = GetEdictFieldValue(ent, "items2");
if (val)
@@ -616,7 +605,6 @@
items = (int)ent->v.items | ((int)val->_float << 23);
else
items = (int)ent->v.items | ((int)pr_global_struct->serverflags << 28);
-#endif
bits |= SU_ITEMS;
@@ -980,11 +968,7 @@
NET_SendToAll (&msg, 5);
if (cls.state != ca_dedicated)
-#ifdef QUAKE2
- Cbuf_InsertText ("reconnect\n");
-#else
Cmd_ExecuteString ("reconnect\n", src_command);
-#endif
}
@@ -1025,11 +1009,7 @@
*/
extern float scr_centertime_off;
-#ifdef QUAKE2
-void SV_SpawnServer (char *server, char *startspot)
-#else
void SV_SpawnServer (char *server)
-#endif
{
edict_t *ent;
int i;
@@ -1071,10 +1051,6 @@
memset (&sv, 0, sizeof(sv));
strcpy (sv.name, server);
-#ifdef QUAKE2
- if (startspot)
- strcpy(sv.startspot, startspot);
-#endif
// load progs to get entity field count
PR_LoadProgs ();
@@ -1152,9 +1128,6 @@
pr_global_struct->deathmatch = deathmatch.value;
pr_global_struct->mapname = sv.name - pr_strings;
-#ifdef QUAKE2
- pr_global_struct->startspot = sv.startspot - pr_strings;
-#endif
// serverflags are for cross level information (sigils)
pr_global_struct->serverflags = svs.serverflags;
--- a/sv_move.c
+++ b/sv_move.c
@@ -377,9 +377,6 @@
{
edict_t *ent, *goal;
float dist;
-#ifdef QUAKE2
- edict_t *enemy;
-#endif
ent = PROG_TO_EDICT(pr_global_struct->self);
goal = PROG_TO_EDICT(ent->v.goalentity);
@@ -392,12 +389,7 @@
}
// if the next step hits the enemy, return immediately
-#ifdef QUAKE2
- enemy = PROG_TO_EDICT(ent->v.enemy);
- if (enemy != sv.edicts && SV_CloseEnough (ent, enemy, dist) )
-#else
if ( PROG_TO_EDICT(ent->v.enemy) != sv.edicts && SV_CloseEnough (ent, goal, dist) )
-#endif
return;
// bump around...
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -26,10 +26,6 @@
cvar_t sv_maxvelocity = {"sv_maxvelocity","2000"};
cvar_t sv_nostep = {"sv_nostep","0"};
-#ifdef QUAKE2
-static vec3_t vec_origin = {0.0, 0.0, 0.0};
-#endif
-
#define MOVE_EPSILON 0.01
void SV_Physics_Toss (edict_t *ent);
@@ -52,9 +48,6 @@
continue;
if (check->v.movetype == MOVETYPE_PUSH
|| check->v.movetype == MOVETYPE_NONE
-#ifdef QUAKE2
- || check->v.movetype == MOVETYPE_FOLLOW
-#endif
|| check->v.movetype == MOVETYPE_NOCLIP)
continue;
@@ -353,12 +346,6 @@
{
float ent_gravity;
-#ifdef QUAKE2
- if (ent->v.gravity)
- ent_gravity = ent->v.gravity;
- else
- ent_gravity = 1.0;
-#else
eval_t *val;
val = GetEdictFieldValue(ent, "gravity");
@@ -366,7 +353,6 @@
ent_gravity = val->_float;
else
ent_gravity = 1.0;
-#endif
ent->v.velocity[2] -= ent_gravity * sv_gravity.value * host_frametime;
}
@@ -458,9 +444,6 @@
continue;
if (check->v.movetype == MOVETYPE_PUSH
|| check->v.movetype == MOVETYPE_NONE
-#ifdef QUAKE2
- || check->v.movetype == MOVETYPE_FOLLOW
-#endif
|| check->v.movetype == MOVETYPE_NOCLIP)
continue;
@@ -537,147 +520,8 @@
}
-#ifdef QUAKE2
/*
-============
-SV_PushRotate
-
-============
-*/
-void SV_PushRotate (edict_t *pusher, float movetime)
-{
- int i, e;
- edict_t *check, *block;
- vec3_t move, a, amove;
- vec3_t entorig, pushorig;
- int num_moved;
- edict_t *moved_edict[MAX_EDICTS];
- vec3_t moved_from[MAX_EDICTS];
- vec3_t org, org2;
- vec3_t forward, right, up;
-
- if (!pusher->v.avelocity[0] && !pusher->v.avelocity[1] && !pusher->v.avelocity[2])
- {
- pusher->v.ltime += movetime;
- return;
- }
-
- for (i=0 ; i<3 ; i++)
- amove[i] = pusher->v.avelocity[i] * movetime;
-
- VectorSubtract (vec3_origin, amove, a);
- AngleVectors (a, forward, right, up);
-
- VectorCopy (pusher->v.angles, pushorig);
-
-// move the pusher to it's final position
-
- VectorAdd (pusher->v.angles, amove, pusher->v.angles);
- pusher->v.ltime += movetime;
- SV_LinkEdict (pusher, false);
-
-
-// see if any solid entities are inside the final position
- num_moved = 0;
- check = NEXT_EDICT(sv.edicts);
- for (e=1 ; e<sv.num_edicts ; e++, check = NEXT_EDICT(check))
- {
- if (check->free)
- continue;
- if (check->v.movetype == MOVETYPE_PUSH
- || check->v.movetype == MOVETYPE_NONE
- || check->v.movetype == MOVETYPE_FOLLOW
- || check->v.movetype == MOVETYPE_NOCLIP)
- continue;
-
- // if the entity is standing on the pusher, it will definately be moved
- if ( ! ( ((int)check->v.flags & FL_ONGROUND)
- && PROG_TO_EDICT(check->v.groundentity) == pusher) )
- {
- if ( check->v.absmin[0] >= pusher->v.absmax[0]
- || check->v.absmin[1] >= pusher->v.absmax[1]
- || check->v.absmin[2] >= pusher->v.absmax[2]
- || check->v.absmax[0] <= pusher->v.absmin[0]
- || check->v.absmax[1] <= pusher->v.absmin[1]
- || check->v.absmax[2] <= pusher->v.absmin[2] )
- continue;
-
- // see if the ent's bbox is inside the pusher's final position
- if (!SV_TestEntityPosition (check))
- continue;
- }
-
- // remove the onground flag for non-players
- if (check->v.movetype != MOVETYPE_WALK)
- check->v.flags = (int)check->v.flags & ~FL_ONGROUND;
-
- VectorCopy (check->v.origin, entorig);
- VectorCopy (check->v.origin, moved_from[num_moved]);
- moved_edict[num_moved] = check;
- num_moved++;
-
- // calculate destination position
- VectorSubtract (check->v.origin, pusher->v.origin, org);
- org2[0] = DotProduct (org, forward);
- org2[1] = -DotProduct (org, right);
- org2[2] = DotProduct (org, up);
- VectorSubtract (org2, org, move);
-
- // try moving the contacted entity
- pusher->v.solid = SOLID_NOT;
- SV_PushEntity (check, move);
- pusher->v.solid = SOLID_BSP;
-
- // if it is still inside the pusher, block
- block = SV_TestEntityPosition (check);
- if (block)
- { // fail the move
- if (check->v.mins[0] == check->v.maxs[0])
- continue;
- if (check->v.solid == SOLID_NOT || check->v.solid == SOLID_TRIGGER)
- { // corpse
- check->v.mins[0] = check->v.mins[1] = 0;
- VectorCopy (check->v.mins, check->v.maxs);
- continue;
- }
-
- VectorCopy (entorig, check->v.origin);
- SV_LinkEdict (check, true);
-
- VectorCopy (pushorig, pusher->v.angles);
- SV_LinkEdict (pusher, false);
- pusher->v.ltime -= movetime;
-
- // if the pusher has a "blocked" function, call it
- // otherwise, just stay in place until the obstacle is gone
- if (pusher->v.blocked)
- {
- pr_global_struct->self = EDICT_TO_PROG(pusher);
- pr_global_struct->other = EDICT_TO_PROG(check);
- PR_ExecuteProgram (pusher->v.blocked);
- }
-
- // move back any entities we already moved
- for (i=0 ; i<num_moved ; i++)
- {
- VectorCopy (moved_from[i], moved_edict[i]->v.origin);
- VectorSubtract (moved_edict[i]->v.angles, amove, moved_edict[i]->v.angles);
- SV_LinkEdict (moved_edict[i], false);
- }
- return;
- }
- else
- {
- VectorAdd (check->v.angles, amove, check->v.angles);
- }
- }
-
-
-}
-#endif
-
-/*
-================
+================
SV_Physics_Pusher
================
@@ -701,14 +545,7 @@
movetime = host_frametime;
if (movetime)
- {
-#ifdef QUAKE2
- if (ent->v.avelocity[0] || ent->v.avelocity[1] || ent->v.avelocity[2])
- SV_PushRotate (ent, movetime);
- else
-#endif
- SV_PushMove (ent, movetime); // advances ent->v.ltime if not blocked
- }
+ SV_PushMove (ent, movetime); // advances ent->v.ltime if not blocked
if (thinktime > oldltime && thinktime <= ent->v.ltime)
{
@@ -790,9 +627,6 @@
{
vec3_t point;
int cont;
-#ifdef QUAKE2
- int truecont;
-#endif
point[0] = ent->v.origin[0];
point[1] = ent->v.origin[1];
@@ -803,9 +637,6 @@
cont = SV_PointContents (point);
if (cont <= CONTENTS_WATER)
{
-#ifdef QUAKE2
- truecont = SV_TruePointContents (point);
-#endif
ent->v.watertype = cont;
ent->v.waterlevel = 1;
point[2] = ent->v.origin[2] + (ent->v.mins[2] + ent->v.maxs[2])*0.5;
@@ -818,22 +649,6 @@
if (cont <= CONTENTS_WATER)
ent->v.waterlevel = 3;
}
-#ifdef QUAKE2
- if (truecont <= CONTENTS_CURRENT_0 && truecont >= CONTENTS_CURRENT_DOWN)
- {
- static vec3_t current_table[] =
- {
- {1, 0, 0},
- {0, 1, 0},
- {-1, 0, 0},
- {0, -1, 0},
- {0, 0, 1},
- {0, 0, -1}
- };
-
- VectorMA (ent->v.basevelocity, 150.0*ent->v.waterlevel/3.0, current_table[CONTENTS_CURRENT_0 - truecont], ent->v.basevelocity);
- }
-#endif
}
return ent->v.waterlevel > 1;
@@ -1070,14 +885,7 @@
if (!SV_CheckWater (ent) && ! ((int)ent->v.flags & FL_WATERJUMP) )
SV_AddGravity (ent);
SV_CheckStuck (ent);
-#ifdef QUAKE2
- VectorAdd (ent->v.velocity, ent->v.basevelocity, ent->v.velocity);
-#endif
SV_WalkMove (ent);
-
-#ifdef QUAKE2
- VectorSubtract (ent->v.velocity, ent->v.basevelocity, ent->v.velocity);
-#endif
break;
case MOVETYPE_TOSS:
@@ -1126,25 +934,8 @@
SV_RunThink (ent);
}
-#ifdef QUAKE2
/*
=============
-SV_Physics_Follow
-
-Entities that are "stuck" to another entity
-=============
-*/
-void SV_Physics_Follow (edict_t *ent)
-{
-// regular thinking
- SV_RunThink (ent);
- VectorAdd (PROG_TO_EDICT(ent->v.aiment)->v.origin, ent->v.v_angle, ent->v.origin);
- SV_LinkEdict (ent, true);
-}
-#endif
-
-/*
-=============
SV_Physics_Noclip
A moving object that doesn't obey physics
@@ -1179,16 +970,7 @@
void SV_CheckWaterTransition (edict_t *ent)
{
int cont;
-#ifdef QUAKE2
- vec3_t point;
-
- point[0] = ent->v.origin[0];
- point[1] = ent->v.origin[1];
- point[2] = ent->v.origin[2] + ent->v.mins[2] + 1;
- cont = SV_PointContents (point);
-#else
cont = SV_PointContents (ent->v.origin);
-#endif
if (!ent->v.watertype)
{ // just spawned here
ent->v.watertype = cont;
@@ -1228,39 +1010,11 @@
trace_t trace;
vec3_t move;
float backoff;
-#ifdef QUAKE2
- edict_t *groundentity;
- groundentity = PROG_TO_EDICT(ent->v.groundentity);
- if ((int)groundentity->v.flags & FL_CONVEYOR)
- VectorScale(groundentity->v.movedir, groundentity->v.speed, ent->v.basevelocity);
- else
- VectorCopy(vec_origin, ent->v.basevelocity);
- SV_CheckWater (ent);
-#endif
// regular thinking
if (!SV_RunThink (ent))
return;
-#ifdef QUAKE2
- if (ent->v.velocity[2] > 0)
- ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
-
- if ( ((int)ent->v.flags & FL_ONGROUND) )
-//@@
- if (VectorCompare(ent->v.basevelocity, vec_origin))
- return;
-
- SV_CheckVelocity (ent);
-
-// add gravity
- if (! ((int)ent->v.flags & FL_ONGROUND)
- && ent->v.movetype != MOVETYPE_FLY
- && ent->v.movetype != MOVETYPE_BOUNCEMISSILE
- && ent->v.movetype != MOVETYPE_FLYMISSILE)
- SV_AddGravity (ent);
-
-#else
// if onground, return without moving
if ( ((int)ent->v.flags & FL_ONGROUND) )
return;
@@ -1271,20 +1025,13 @@
if (ent->v.movetype != MOVETYPE_FLY
&& ent->v.movetype != MOVETYPE_FLYMISSILE)
SV_AddGravity (ent);
-#endif
// move angles
VectorMA (ent->v.angles, host_frametime, ent->v.avelocity, ent->v.angles);
// move origin
-#ifdef QUAKE2
- VectorAdd (ent->v.velocity, ent->v.basevelocity, ent->v.velocity);
-#endif
VectorScale (ent->v.velocity, host_frametime, move);
trace = SV_PushEntity (ent, move);
-#ifdef QUAKE2
- VectorSubtract (ent->v.velocity, ent->v.basevelocity, ent->v.velocity);
-#endif
if (trace.fraction == 1)
return;
if (ent->free)
@@ -1292,10 +1039,6 @@
if (ent->v.movetype == MOVETYPE_BOUNCE)
backoff = 1.5;
-#ifdef QUAKE2
- else if (ent->v.movetype == MOVETYPE_BOUNCEMISSILE)
- backoff = 2.0;
-#endif
else
backoff = 1;
@@ -1304,11 +1047,7 @@
// stop if on ground
if (trace.plane.normal[2] > 0.7)
{
-#ifdef QUAKE2
- if (ent->v.velocity[2] < 60 || (ent->v.movetype != MOVETYPE_BOUNCE && ent->v.movetype != MOVETYPE_BOUNCEMISSILE))
-#else
if (ent->v.velocity[2] < 60 || ent->v.movetype != MOVETYPE_BOUNCE)
-#endif
{
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
@@ -1340,114 +1079,8 @@
will fall if the floor is pulled out from under them.
=============
*/
-#ifdef QUAKE2
void SV_Physics_Step (edict_t *ent)
{
- qboolean wasonground;
- qboolean inwater;
- qboolean hitsound = false;
- float *vel;
- float speed, newspeed, control;
- float friction;
- edict_t *groundentity;
-
- groundentity = PROG_TO_EDICT(ent->v.groundentity);
- if ((int)groundentity->v.flags & FL_CONVEYOR)
- VectorScale(groundentity->v.movedir, groundentity->v.speed, ent->v.basevelocity);
- else
- VectorCopy(vec_origin, ent->v.basevelocity);
-//@@
- pr_global_struct->time = sv.time;
- pr_global_struct->self = EDICT_TO_PROG(ent);
- PF_WaterMove();
-
- SV_CheckVelocity (ent);
-
- wasonground = (int)ent->v.flags & FL_ONGROUND;
-// ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
-
- // add gravity except:
- // flying monsters
- // swimming monsters who are in the water
- inwater = SV_CheckWater(ent);
- if (! wasonground)
- if (!((int)ent->v.flags & FL_FLY))
- if (!(((int)ent->v.flags & FL_SWIM) && (ent->v.waterlevel > 0)))
- {
- if (ent->v.velocity[2] < sv_gravity.value*-0.1)
- hitsound = true;
- if (!inwater)
- SV_AddGravity (ent);
- }
-
- if (!VectorCompare(ent->v.velocity, vec_origin) || !VectorCompare(ent->v.basevelocity, vec_origin))
- {
- ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
- // apply friction
- // let dead monsters who aren't completely onground slide
- if (wasonground)
- if (!(ent->v.health <= 0.0 && !SV_CheckBottom(ent)))
- {
- vel = ent->v.velocity;
- speed = sqrt(vel[0]*vel[0] +vel[1]*vel[1]);
- if (speed)
- {
- friction = sv_friction.value;
-
- control = speed < sv_stopspeed.value ? sv_stopspeed.value : speed;
- newspeed = speed - host_frametime*control*friction;
-
- if (newspeed < 0)
- newspeed = 0;
- newspeed /= speed;
-
- vel[0] = vel[0] * newspeed;
- vel[1] = vel[1] * newspeed;
- }
- }
-
- VectorAdd (ent->v.velocity, ent->v.basevelocity, ent->v.velocity);
- SV_FlyMove (ent, host_frametime, NULL);
- VectorSubtract (ent->v.velocity, ent->v.basevelocity, ent->v.velocity);
-
- // determine if it's on solid ground at all
- {
- vec3_t mins, maxs, point;
- int x, y;
-
- VectorAdd (ent->v.origin, ent->v.mins, mins);
- VectorAdd (ent->v.origin, ent->v.maxs, maxs);
-
- point[2] = mins[2] - 1;
- for (x=0 ; x<=1 ; x++)
- for (y=0 ; y<=1 ; y++)
- {
- point[0] = x ? maxs[0] : mins[0];
- point[1] = y ? maxs[1] : mins[1];
- if (SV_PointContents (point) == CONTENTS_SOLID)
- {
- ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
- break;
- }
- }
-
- }
-
- SV_LinkEdict (ent, true);
-
- if ((int)ent->v.flags & FL_ONGROUND)
- if (!wasonground)
- if (hitsound)
- SV_StartSound (ent, 0, "demon/dland2.wav", 255, 1);
- }
-
-// regular thinking
- SV_RunThink (ent);
- SV_CheckWaterTransition (ent);
-}
-#else
-void SV_Physics_Step (edict_t *ent)
-{
qboolean hitsound;
// freefall if not onground
@@ -1475,7 +1108,6 @@
SV_CheckWaterTransition (ent);
}
-#endif
//============================================================================
@@ -1518,10 +1150,6 @@
SV_Physics_Pusher (ent);
else if (ent->v.movetype == MOVETYPE_NONE)
SV_Physics_None (ent);
-#ifdef QUAKE2
- else if (ent->v.movetype == MOVETYPE_FOLLOW)
- SV_Physics_Follow (ent);
-#endif
else if (ent->v.movetype == MOVETYPE_NOCLIP)
SV_Physics_Noclip (ent);
else if (ent->v.movetype == MOVETYPE_STEP)
@@ -1528,9 +1156,6 @@
SV_Physics_Step (ent);
else if (ent->v.movetype == MOVETYPE_TOSS
|| ent->v.movetype == MOVETYPE_BOUNCE
-#ifdef QUAKE2
- || ent->v.movetype == MOVETYPE_BOUNCEMISSILE
-#endif
|| ent->v.movetype == MOVETYPE_FLY
|| ent->v.movetype == MOVETYPE_FLYMISSILE)
SV_Physics_Toss (ent);
@@ -1543,56 +1168,3 @@
sv.time += host_frametime;
}
-
-
-#ifdef QUAKE2
-trace_t SV_Trace_Toss (edict_t *ent, edict_t *ignore)
-{
- edict_t tempent, *tent;
- trace_t trace;
- vec3_t move;
- vec3_t end;
- double save_frametime;
-// extern particle_t *active_particles, *free_particles;
-// particle_t *p;
-
-
- save_frametime = host_frametime;
- host_frametime = 0.05;
-
- memcpy(&tempent, ent, sizeof(edict_t));
- tent = &tempent;
-
- while (1)
- {
- SV_CheckVelocity (tent);
- SV_AddGravity (tent);
- VectorMA (tent->v.angles, host_frametime, tent->v.avelocity, tent->v.angles);
- VectorScale (tent->v.velocity, host_frametime, move);
- VectorAdd (tent->v.origin, move, end);
- trace = SV_Move (tent->v.origin, tent->v.mins, tent->v.maxs, end, MOVE_NORMAL, tent);
- VectorCopy (trace.endpos, tent->v.origin);
-
-// p = free_particles;
-// if (p)
-// {
-// free_particles = p->next;
-// p->next = active_particles;
-// active_particles = p;
-//
-// p->die = 256;
-// p->color = 15;
-// p->type = pt_static;
-// VectorCopy (vec3_origin, p->vel);
-// VectorCopy (tent->v.origin, p->org);
-// }
-
- if (trace.ent)
- if (trace.ent != ignore)
- break;
- }
-// p->color = 224;
- host_frametime = save_frametime;
- return trace;
-}
-#endif
--- a/sv_user.c
+++ b/sv_user.c
@@ -448,11 +448,6 @@
i = MSG_ReadByte ();
if (i)
host_client->edict->v.impulse = i;
-
-#ifdef QUAKE2
-// read light level
- host_client->edict->v.light_level = MSG_ReadByte ();
-#endif
}
/*
--- a/sys_linux.c
+++ b/sys_linux.c
@@ -374,13 +374,7 @@
COM_InitArgv(c, v);
parms.argc = com_argc;
parms.argv = com_argv;
-
-#ifdef GLQUAKE
- parms.memsize = 16*1024*1024;
-#endif
-#ifndef GLQUAKE
parms.memsize = 8*1024*1024;
-#endif
j = COM_CheckParm("-mem");
if (j)
--- a/view.c
+++ b/view.c
@@ -241,11 +241,6 @@
byte gammatable[256]; // palette is sent through this
-#ifdef GLQUAKE
-byte ramps[3][256];
-float v_blend[4]; // rgba 0.0 - 1.0
-#endif // GLQUAKE
-
void BuildGammaTable (float g)
{
int i, inf;
@@ -456,55 +451,9 @@
/*
=============
-V_CalcBlend
-=============
-*/
-#ifdef GLQUAKE
-void V_CalcBlend (void)
-{
- float r, g, b, a, a2;
- int j;
-
- r = 0;
- g = 0;
- b = 0;
- a = 0;
-
- for (j=0 ; j<NUM_CSHIFTS ; j++)
- {
- if (!gl_cshiftpercent.value)
- continue;
-
- a2 = ((cl.cshifts[j].percent * gl_cshiftpercent.value) / 100.0) / 255.0;
-
-// a2 = cl.cshifts[j].percent/255.0;
- if (!a2)
- continue;
- a = a + a2*(1-a);
-//Con_Printf ("j:%i a:%f\n", j, a);
- a2 = a2/a;
- r = r*(1-a2) + cl.cshifts[j].destcolor[0]*a2;
- g = g*(1-a2) + cl.cshifts[j].destcolor[1]*a2;
- b = b*(1-a2) + cl.cshifts[j].destcolor[2]*a2;
- }
-
- v_blend[0] = r/255.0;
- v_blend[1] = g/255.0;
- v_blend[2] = b/255.0;
- v_blend[3] = a;
- if (v_blend[3] > 1)
- v_blend[3] = 1;
- if (v_blend[3] < 0)
- v_blend[3] = 0;
-}
-#endif
-
-/*
-=============
V_UpdatePalette
=============
*/
-#ifdef GLQUAKE
void V_UpdatePalette (void)
{
int i, j;
@@ -511,94 +460,6 @@
qboolean new;
byte *basepal, *newpal;
byte pal[768];
- float r,g,b,a;
- int ir, ig, ib;
- qboolean force;
-
- V_CalcPowerupCshift ();
-
- new = false;
-
- for (i=0 ; i<NUM_CSHIFTS ; i++)
- {
- if (cl.cshifts[i].percent != cl.prev_cshifts[i].percent)
- {
- new = true;
- cl.prev_cshifts[i].percent = cl.cshifts[i].percent;
- }
- for (j=0 ; j<3 ; j++)
- if (cl.cshifts[i].destcolor[j] != cl.prev_cshifts[i].destcolor[j])
- {
- new = true;
- cl.prev_cshifts[i].destcolor[j] = cl.cshifts[i].destcolor[j];
- }
- }
-
-// drop the damage value
- cl.cshifts[CSHIFT_DAMAGE].percent -= host_frametime*150;
- if (cl.cshifts[CSHIFT_DAMAGE].percent <= 0)
- cl.cshifts[CSHIFT_DAMAGE].percent = 0;
-
-// drop the bonus value
- cl.cshifts[CSHIFT_BONUS].percent -= host_frametime*100;
- if (cl.cshifts[CSHIFT_BONUS].percent <= 0)
- cl.cshifts[CSHIFT_BONUS].percent = 0;
-
- force = V_CheckGamma ();
- if (!new && !force)
- return;
-
- V_CalcBlend ();
-
- a = v_blend[3];
- r = 255*v_blend[0]*a;
- g = 255*v_blend[1]*a;
- b = 255*v_blend[2]*a;
-
- a = 1-a;
- for (i=0 ; i<256 ; i++)
- {
- ir = i*a + r;
- ig = i*a + g;
- ib = i*a + b;
- if (ir > 255)
- ir = 255;
- if (ig > 255)
- ig = 255;
- if (ib > 255)
- ib = 255;
-
- ramps[0][i] = gammatable[ir];
- ramps[1][i] = gammatable[ig];
- ramps[2][i] = gammatable[ib];
- }
-
- basepal = host_basepal;
- newpal = pal;
-
- for (i=0 ; i<256 ; i++)
- {
- ir = basepal[0];
- ig = basepal[1];
- ib = basepal[2];
- basepal += 3;
-
- newpal[0] = ramps[0][ir];
- newpal[1] = ramps[1][ig];
- newpal[2] = ramps[2][ib];
- newpal += 3;
- }
-
- VID_ShiftPalette (pal);
-}
-#endif /* GLQUAKE */
-#ifndef GLQUAKE
-void V_UpdatePalette (void)
-{
- int i, j;
- qboolean new;
- byte *basepal, *newpal;
- byte pal[768];
int r,g,b;
qboolean force;
@@ -660,7 +521,6 @@
VID_ShiftPalette (pal);
}
-#endif /* ! GLQUAKE */
/*
@@ -1035,12 +895,9 @@
R_RenderView ();
}
-#ifndef GLQUAKE
if (crosshair.value)
Draw_Character (scr_vrect.x + scr_vrect.width/2 + cl_crossx.value,
scr_vrect.y + scr_vrect.height/2 + cl_crossy.value, '+');
-#endif
-
}
//============================================================================
--- a/world.c
+++ b/world.c
@@ -366,37 +366,9 @@
return;
// set the abs box
+ VectorAdd (ent->v.origin, ent->v.mins, ent->v.absmin);
+ VectorAdd (ent->v.origin, ent->v.maxs, ent->v.absmax);
-#ifdef QUAKE2
- if (ent->v.solid == SOLID_BSP &&
- (ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]) )
- { // expand for rotation
- float max, v;
- int i;
-
- max = 0;
- for (i=0 ; i<3 ; i++)
- {
- v =fabs( ent->v.mins[i]);
- if (v > max)
- max = v;
- v =fabs( ent->v.maxs[i]);
- if (v > max)
- max = v;
- }
- for (i=0 ; i<3 ; i++)
- {
- ent->v.absmin[i] = ent->v.origin[i] - max;
- ent->v.absmax[i] = ent->v.origin[i] + max;
- }
- }
- else
-#endif
- {
- VectorAdd (ent->v.origin, ent->v.mins, ent->v.absmin);
- VectorAdd (ent->v.origin, ent->v.maxs, ent->v.absmax);
- }
-
//
// to make items easier to pick up and allow them to be grabbed off
// of shelves, the abs sizes are expanded
@@ -722,58 +694,8 @@
VectorSubtract (start, offset, start_l);
VectorSubtract (end, offset, end_l);
-#ifdef QUAKE2
- // rotate start and end into the models frame of reference
- if (ent->v.solid == SOLID_BSP &&
- (ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]) )
- {
- vec3_t a;
- vec3_t forward, right, up;
- vec3_t temp;
-
- AngleVectors (ent->v.angles, forward, right, up);
-
- VectorCopy (start_l, temp);
- start_l[0] = DotProduct (temp, forward);
- start_l[1] = -DotProduct (temp, right);
- start_l[2] = DotProduct (temp, up);
-
- VectorCopy (end_l, temp);
- end_l[0] = DotProduct (temp, forward);
- end_l[1] = -DotProduct (temp, right);
- end_l[2] = DotProduct (temp, up);
- }
-#endif
-
// trace a line through the apropriate clipping hull
SV_RecursiveHullCheck (hull, hull->firstclipnode, 0, 1, start_l, end_l, &trace);
-
-#ifdef QUAKE2
- // rotate endpos back to world frame of reference
- if (ent->v.solid == SOLID_BSP &&
- (ent->v.angles[0] || ent->v.angles[1] || ent->v.angles[2]) )
- {
- vec3_t a;
- vec3_t forward, right, up;
- vec3_t temp;
-
- if (trace.fraction != 1)
- {
- VectorSubtract (vec3_origin, ent->v.angles, a);
- AngleVectors (a, forward, right, up);
-
- VectorCopy (trace.endpos, temp);
- trace.endpos[0] = DotProduct (temp, forward);
- trace.endpos[1] = -DotProduct (temp, right);
- trace.endpos[2] = DotProduct (temp, up);
-
- VectorCopy (trace.plane.normal, temp);
- trace.plane.normal[0] = DotProduct (temp, forward);
- trace.plane.normal[1] = -DotProduct (temp, right);
- trace.plane.normal[2] = DotProduct (temp, up);
- }
- }
-#endif
// fix trace up by the offset
if (trace.fraction != 1)