beam system overhaul

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@333 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2004-10-15 00:00:15 +00:00
parent c9f4af34bf
commit fd5c54cbdc
4 changed files with 702 additions and 643 deletions

View file

@ -1068,7 +1068,15 @@ void CL_LinkPacketEntities (void)
}
if (i == cl_oldnumvisedicts)
{
cl.lerpents[s1->number].trailstate.lastdist = 0;
trailstate_t *t;
t = &cl.lerpents[s1->number].trailstate;
t->lastdist = 0;
if (t->lastbeam)
{
t->lastbeam->flags &= ~BS_LASTSEG;
t->lastbeam->flags |= BS_NODRAW;
}
t->lastbeam = NULL;
continue; // not in last message
}

File diff suppressed because it is too large Load diff

View file

@ -192,10 +192,13 @@ void MediaSW_ShowFrameBGR_24_Flip(qbyte *framedata, int inwidth, int inheight);
void R_ParseParticleEffect (void);
void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
typedef struct beamseg_s beamseg_t;
typedef struct {
float lastdist;
vec3_t lastorg; //use only if lastdist
vec3_t lastdir; //use only if lastdist
beamseg_t *lastbeam; // last beam point
} trailstate_t;
void R_RocketTrail (vec3_t start, vec3_t end, int type, trailstate_t *oldpoint);
int R_RunParticleEffectType(vec3_t org, vec3_t dir, float count, int type);

View file

@ -62,10 +62,11 @@ typedef struct particle_s
float rotationspeed;
float nextemit;
} p; //point blob
struct {
/* struct {
vec3_t org2;
vec3_t lastdir;
} b; //beam
} b;
*/
} u;
// drivers never touch the following fields
@ -74,6 +75,18 @@ typedef struct particle_s
float die;
} particle_t;
#define BS_LASTSEG 0x1 // no draw to next, no delete
#define BS_DEAD 0x2 // segment is dead
#define BS_NODRAW 0x4 // only used for lerp switching
typedef struct beamseg_s
{
particle_t *p;
struct beamseg_s *next; // next in beamseg list
int flags; // flags for beamseg
vec3_t dir;
} beamseg_t;
#define PARTICLE_Z_CLIP 8.0
#define frandom() (rand()*(1.0f/RAND_MAX))