Restore EF_RAYGREEN & RAYRED in Quakespasm

This commit is contained in:
Tyler Young 2023-01-23 19:56:08 -05:00
parent dfe723f6e8
commit 51573765d6
2 changed files with 30 additions and 3 deletions

View file

@ -328,6 +328,24 @@ dlight_t *CL_AllocDlight (int key)
return dl;
}
dlighttype_t SetDlightColor (float f, dlighttype_t def, qboolean random)
{
dlighttype_t colors[NUM_DLIGHTTYPES-4] = {lt_red, lt_blue, lt_redblue, lt_green};
if ((int)f == 1)
return lt_red;
else if ((int)f == 2)
return lt_blue;
else if ((int)f == 3)
return lt_redblue;
else if ((int)f == 4)
return lt_green;
else if (((int)f == NUM_DLIGHTTYPES - 3) && random)
return colors[rand()%(NUM_DLIGHTTYPES-4)];
else
return def;
}
/*
===============
@ -712,8 +730,8 @@ void CL_RelinkEntities (void)
dl->color[2] = 1;
}
// naievil -- fixme
/*
// naievil -- fixme sB FIXED
if (ent->effects & EF_RAYGREEN)
{
R_RocketTrail (oldorg, ent->origin, 12);
@ -739,7 +757,7 @@ void CL_RelinkEntities (void)
dl->color[2] = 0;
dl->type = SetDlightColor (2, lt_rocket, true);
}
*/
if (ent->model->flags & EF_GIB)
R_RocketTrail (oldorg, ent->origin, 2);
@ -756,6 +774,7 @@ void CL_RelinkEntities (void)
VectorCopy (ent->origin, dl->origin);
dl->radius = 200;
dl->die = cl.time + 0.01;
dl->type = SetDlightColor (2, lt_rocket, true);
}
else if (ent->model->flags & EF_GRENADE)
R_RocketTrail (oldorg, ent->origin, 1);

View file

@ -49,6 +49,13 @@ typedef struct
int percent; // 0-256
} cshift_t;
typedef enum
{
lt_default, lt_muzzleflash, lt_explosion, lt_rocket,
lt_red, lt_blue, lt_redblue, lt_green, NUM_DLIGHTTYPES,
lt_explosion2, lt_explosion3, lt_rayred, lt_raygreen
} dlighttype_t;
#define CSHIFT_CONTENTS 0
#define CSHIFT_DAMAGE 1
#define CSHIFT_BONUS 2
@ -74,6 +81,7 @@ typedef struct
float minlight; // don't add when contributing less
int key;
vec3_t color; //johnfitz -- lit support via lordhavoc
int type; // color
} dlight_t;