Cleaned up a lot of fixmes.

This commit is contained in:
Zephaniah E. Hull 2001-01-27 04:58:07 +00:00
parent e73ff67bf3
commit c316ae0069
4 changed files with 12 additions and 64 deletions

View file

@ -53,13 +53,11 @@ extern int nanmask;
* Yes, this is the same as sqrt(VectorSubtract then DotProduct),
* however that way would involve more vars, this is cheaper.
*/
#define VectorDistance(a, b) sqrt(((a[0] - b[0]) * (a[0] - b[0])) + \
((a[1] - b[1]) * (a[1] - b[1])) + \
((a[2] - b[2]) * (a[2] - b[2])))
#define VectorDistance_fast(a, b) (((a[0] - b[0]) * (a[0] - b[0])) + \
((a[1] - b[1]) * (a[1] - b[1])) + \
((a[2] - b[2]) * (a[2] - b[2])))
#define VectorDistance(a, b) sqrt(VectorDistance_fast(a, b))
#define lhrandom(MIN,MAX) ((rand() & 32767) * (((MAX)-(MIN)) * (1.0f / 32767.0f)) + (MIN))

View file

@ -475,10 +475,8 @@ CL_LinkPacketEntities (void)
{
entity_t **ent;
packet_entities_t *pack;
entity_state_t *s1, *s2;
float f;
entity_state_t *s1;
model_t *model;
float autorotate;
int i;
int pnum;
dlight_t *dl;
@ -487,13 +485,8 @@ CL_LinkPacketEntities (void)
pack = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK].packet_entities;
autorotate = anglemod (100 * cl.time);
f = 0; // FIXME: no interpolation right now
for (pnum = 0; pnum < pack->num_entities; pnum++) {
s1 = &pack->entities[pnum];
s2 = s1; // FIXME: no interpolation right now
// spawn light flashes, even ones coming from invisible objects
if ((s1->effects & (EF_BLUE | EF_RED)) == (EF_BLUE | EF_RED))
@ -583,43 +576,28 @@ CL_LinkPacketEntities (void)
if (model->flags & EF_ROTATE) { // rotate binary objects locally
(*ent)->angles[0] = 0;
(*ent)->angles[1] = autorotate;
(*ent)->angles[1] = anglemod (100 * cl.time);
(*ent)->angles[2] = 0;
} else {
float a1, a2;
for (i = 0; i < 3; i++) {
a1 = s1->angles[i];
a2 = s2->angles[i];
if (a1 - a2 > 180)
a1 -= 360;
if (a1 - a2 < -180)
a1 += 360;
(*ent)->angles[i] = a2 + f * (a1 - a2);
}
VectorCopy(s1->angles, (*ent)->angles);
}
VectorCopy ((*ent)->origin, (*ent)->old_origin);
// calculate origin
for (i = 0; i < 3; i++)
(*ent)->origin[i] = s2->origin[i] + f * (s1->origin[i] - s2->origin[i]);
VectorCopy (s1->origin, (*ent)->origin);
// add automatic particle trails
if (!model->flags)
continue;
for (i = 0; i < 3; i++)
if (abs ((*ent)->old_origin[i] - (*ent)->origin[i]) > 128) { // no trail
// if too far
// No trail if too far.
if (VectorDistance_fast((*ent)->old_origin, (*ent)->origin) > (128^2))
VectorCopy ((*ent)->origin, (*ent)->old_origin);
break;
}
if (model->flags & EF_ROCKET) {
dl = CL_AllocDlight (-(*ent)->keynum);
VectorCopy ((*ent)->origin, dl->origin);
dl->radius = 200;
VectorCopy (r_firecolor->vec, dl->color);
dl->radius = 200;
dl->die = cl.time + 0.1;
R_RocketTrail (0, (*ent));
} else if (model->flags & EF_GRENADE)
@ -1188,7 +1166,7 @@ CL_EmitEntities (void)
return;
cl_oldnumvisedicts = cl_numvisedicts;
cl_oldvisedicts = cl_visedicts_list[(cls.netchan.incoming_sequence - 1) & 1];
cl_oldvisedicts = cl_visedicts_list[!(cls.netchan.incoming_sequence & 1)];
cl_visedicts = cl_visedicts_list[cls.netchan.incoming_sequence & 1];
cl_numvisedicts = 0;

View file

@ -137,35 +137,9 @@ Cbuf_InsertText
Adds command text immediately after the current command
Adds a \n to the text
FIXME: actually change the command buffer to do less copying
TODO: Can we just read the buffer in the reverse order?
============
*/
#if 0 // Tonik
void
Cbuf_InsertText (char *text)
{
char *temp;
int templen;
// copy off any commands still remaining in the exec buffer
templen = cmd_text.cursize;
if (templen) {
temp = malloc (templen);
memcpy (temp, cmd_text.data, templen);
SZ_Clear (&cmd_text);
} else
temp = NULL; // shut up compiler
// add the entire text of the file
Cbuf_AddText (text);
SZ_Write (&cmd_text, "\n", 1);
// add the copied off data
if (templen) {
SZ_Write (&cmd_text, temp, templen);
free (temp);
}
}
#else
void
Cbuf_InsertText (char *text)
{
@ -190,7 +164,6 @@ Cbuf_InsertText (char *text)
memcpy (cmd_text.data, text, textlen);
cmd_text.data[textlen] = '\n';
}
#endif
static void

View file

@ -264,7 +264,6 @@ R_NewMap (void)
r_worldentity.model = cl.worldmodel;
// clear out efrags in case the level hasn't been reloaded
// FIXME: is this one short?
for (i = 0; i < cl.worldmodel->numleafs; i++)
cl.worldmodel->leafs[i].efrags = NULL;