mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-22 03:21:08 +00:00
Small stuph.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@297 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
1ba53e017e
commit
5fbe74b582
31 changed files with 884 additions and 528 deletions
|
@ -1020,7 +1020,7 @@ void CL_LinkPacketEntities (void)
|
|||
}
|
||||
if (i == cl_oldnumvisedicts)
|
||||
{
|
||||
cl.lerpents[s1->number].traildist = 0;
|
||||
cl.lerpents[s1->number].trailstate.lastdist = 0;
|
||||
continue; // not in last message
|
||||
}
|
||||
|
||||
|
@ -1032,7 +1032,7 @@ void CL_LinkPacketEntities (void)
|
|||
}
|
||||
|
||||
if (model->particletrail>=0)
|
||||
cl.lerpents[s1->number].traildist = R_RocketTrail (old_origin, ent->origin, model->particletrail, cl.lerpents[s1->number].traildist);
|
||||
R_RocketTrail (old_origin, ent->origin, model->particletrail, &cl.lerpents[s1->number].trailstate);
|
||||
|
||||
//dlights are not customisable.
|
||||
if (model->flags & EF_ROCKET)
|
||||
|
|
|
@ -1362,7 +1362,7 @@ void CL_Startdemos_f (void)
|
|||
for (i=1 ; i<c+1 ; i++)
|
||||
Q_strncpyz (cls.demos[i-1], Cmd_Argv(i), sizeof(cls.demos[0]));
|
||||
|
||||
if (!sv.state && cls.demonum != -1 && cls.demoplayback==DPB_NONE && !media_filmtype)
|
||||
if (!sv.state && cls.demonum != -1 && cls.demoplayback==DPB_NONE && !media_filmtype && COM_CheckParm("-demos"))
|
||||
{
|
||||
cls.demonum = 0;
|
||||
CL_NextDemo ();
|
||||
|
|
|
@ -978,7 +978,7 @@ void SCR_ImageName (char *mapname)
|
|||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
SCR_DrawLoading();
|
||||
SCR_SetUpToDrawConsole();
|
||||
SCR_DrawConsole(true);
|
||||
SCR_DrawConsole(!!*levelshotname);
|
||||
GL_EndRendering();
|
||||
scr_drawloading = false;
|
||||
|
||||
|
|
|
@ -679,7 +679,7 @@ void CL_ParseTEnt (void)
|
|||
|
||||
|
||||
// sound
|
||||
S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
|
||||
S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1);
|
||||
|
||||
// sprite
|
||||
if (cl_expsprite.value) // temp hopefully
|
||||
|
|
|
@ -357,7 +357,7 @@ typedef struct {
|
|||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
int frame;
|
||||
float traildist; //when to next throw out a trail
|
||||
trailstate_t trailstate; //when to next throw out a trail
|
||||
} lerpents_t;
|
||||
//
|
||||
// the client_state_t structure is wiped completely at every
|
||||
|
|
|
@ -135,7 +135,8 @@ typedef struct q2centity_s
|
|||
|
||||
int serverframe; // if not current, this ent isn't in the frame
|
||||
|
||||
float trailcount; // for diminishing grenade trails
|
||||
trailstate_t trailstate;
|
||||
// float trailcount; // for diminishing grenade trails
|
||||
vec3_t lerp_origin; // for trails (variable hz)
|
||||
|
||||
int fly_stoptime;
|
||||
|
@ -158,7 +159,7 @@ void CLQ2_BlasterTrail2(vec3_t oldorg, vec3_t neworg){};
|
|||
void CLQ2_RocketTrail(vec3_t oldorg, vec3_t neworg, q2centity_t *ent)
|
||||
{
|
||||
extern int rt_rocket;
|
||||
ent->trailcount = R_RocketTrail(oldorg, neworg, rt_rocket, ent->trailcount);
|
||||
R_RocketTrail(oldorg, neworg, rt_rocket, &ent->trailstate);
|
||||
};
|
||||
|
||||
|
||||
|
@ -504,7 +505,7 @@ void CLQ2_DeltaEntity (q2frame_t *frame, int newnum, entity_state_t *old, int bi
|
|||
|
||||
if (ent->serverframe != cl.q2frame.serverframe - 1)
|
||||
{ // wasn't in last update, so initialize some things
|
||||
ent->trailcount = 1024; // for diminishing rocket / grenade trails
|
||||
ent->trailstate.lastdist = 0; // for diminishing rocket / grenade trails
|
||||
// duplicate the current state so lerping doesn't hurt anything
|
||||
ent->prev = *state;
|
||||
if (state->event == Q2EV_OTHER_TELEPORT)
|
||||
|
|
|
@ -134,6 +134,9 @@ keyname_t keynames[] =
|
|||
{"MOUSE3", K_MOUSE3},
|
||||
{"MOUSE4", K_MOUSE4},
|
||||
{"MOUSE5", K_MOUSE5},
|
||||
{"MOUSE6", K_MOUSE6},
|
||||
{"MOUSE7", K_MOUSE7},
|
||||
{"MOUSE8", K_MOUSE8},
|
||||
|
||||
{"LWIN", K_LWIN},
|
||||
{"RWIN", K_RWIN},
|
||||
|
|
|
@ -75,8 +75,6 @@ void D_DrawSparkTrans (particle_t *pparticle);
|
|||
|
||||
#define MAX_PARTICLES 32768 // default max # of particles at one
|
||||
// time
|
||||
#define ABSOLUTE_MIN_PARTICLES 512 // no fewer than this no matter what's
|
||||
// on the command line
|
||||
|
||||
//int ramp1[8] = {0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61};
|
||||
//int ramp2[8] = {0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66};
|
||||
|
@ -84,7 +82,7 @@ void D_DrawSparkTrans (particle_t *pparticle);
|
|||
|
||||
particle_t *free_particles;
|
||||
|
||||
particle_t *particles;
|
||||
particle_t *particles; //contains the initial list of alloced particles.
|
||||
int r_numparticles;
|
||||
|
||||
vec3_t r_pright, r_pup, r_ppn;
|
||||
|
@ -99,7 +97,6 @@ extern cvar_t r_bloodstains;
|
|||
|
||||
cvar_t r_particlesdesc = {"r_particlesdesc", "spikeset", NULL, CVAR_LATCH, CVAR_SEMICHEAT};
|
||||
|
||||
cvar_t r_part_rain_colour = {"r_part_rain_colour", "15"};
|
||||
cvar_t r_part_rain_quantity = {"r_part_rain_quantity", "1"};
|
||||
|
||||
cvar_t gl_part_trifansparks = {"gl_part_trifansparks", "0"};
|
||||
|
@ -151,6 +148,7 @@ typedef struct part_type_s {
|
|||
float offsetspreadvert;
|
||||
float randomvelvert;
|
||||
float randscale;
|
||||
qboolean isbeam;
|
||||
enum {BM_MERGE, BM_ADD, BM_SUBTRACT} blendmode;
|
||||
|
||||
float rotationstartmin, rotationstartrand;
|
||||
|
@ -516,6 +514,8 @@ void R_ParticleEffect_f(void)
|
|||
ptype->spawnmode = SM_BOX;
|
||||
|
||||
}
|
||||
else if (!strcmp(var, "isbeam"))
|
||||
ptype->isbeam = true;
|
||||
|
||||
else if (!strcmp(var, "cliptype"))
|
||||
{
|
||||
|
@ -785,8 +785,6 @@ void R_InitParticles (void)
|
|||
if (i)
|
||||
{
|
||||
r_numparticles = (int)(Q_atoi(com_argv[i+1]));
|
||||
// if (r_numparticles < ABSOLUTE_MIN_PARTICLES)
|
||||
// r_numparticles = ABSOLUTE_MIN_PARTICLES;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -808,7 +806,6 @@ void R_InitParticles (void)
|
|||
Cvar_Register(&r_part_rain, particlecvargroupname);
|
||||
|
||||
Cvar_Register(&r_part_rain_quantity, particlecvargroupname);
|
||||
Cvar_Register(&r_part_rain_colour, particlecvargroupname);
|
||||
|
||||
Cvar_Register(&gl_part_trifansparks, particlecvargroupname);
|
||||
Cvar_Register(&r_particle_tracelimit, particlecvargroupname);
|
||||
|
@ -1014,6 +1011,7 @@ void R_AddRainParticles(void)
|
|||
float x;
|
||||
float y;
|
||||
static float skipped;
|
||||
static float lastrendered;
|
||||
int ptype;
|
||||
|
||||
vec3_t org, vdist;
|
||||
|
@ -1026,8 +1024,8 @@ void R_AddRainParticles(void)
|
|||
return;
|
||||
}
|
||||
|
||||
// if (skytris->nexttime < particletime - 0.5)
|
||||
// skipped = true; //we've gone for half a sec without any new rain. This would cause some strange effects, so reset times.
|
||||
if (lastrendered < particletime - 0.5)
|
||||
skipped = true; //we've gone for half a sec without any new rain. This would cause some strange effects, so reset times.
|
||||
|
||||
if (skipped)
|
||||
{
|
||||
|
@ -1040,6 +1038,8 @@ void R_AddRainParticles(void)
|
|||
}
|
||||
}
|
||||
skipped = false;
|
||||
|
||||
lastrendered = particletime;
|
||||
/*
|
||||
{
|
||||
int i;
|
||||
|
@ -1399,6 +1399,89 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
return 1;
|
||||
|
||||
while(ptype)
|
||||
{
|
||||
if (ptype->isbeam)
|
||||
{
|
||||
vec3_t lastorg, lastdir;
|
||||
float a;
|
||||
|
||||
switch (ptype->spawnmode)
|
||||
{
|
||||
default:
|
||||
a = (2*M_PI);
|
||||
lastorg[0] = org[0] + sin(a)*ptype->areaspread;
|
||||
lastorg[1] = org[1] + cos(a)*ptype->areaspread;
|
||||
lastorg[2] = org[2] + ptype->offsetup;
|
||||
|
||||
VectorNormalize(lastdir);
|
||||
|
||||
for (i = 0; i < count*ptype->count; i++)
|
||||
{
|
||||
if (!free_particles)
|
||||
return 0;
|
||||
p = free_particles;
|
||||
free_particles = p->next;
|
||||
p->next = ptype->particles;
|
||||
ptype->particles = p;
|
||||
|
||||
p->die = ptype->randdie*frandom();
|
||||
p->scale = ptype->scale+ptype->randscale*frandom();
|
||||
p->alpha = ptype->alpha-p->die*(ptype->alpha/ptype->die)*ptype->alphachange;
|
||||
p->color = 0;
|
||||
|
||||
if (ptype->colorindex >= 0)
|
||||
{
|
||||
int cidx;
|
||||
cidx = ptype->colorrand > 0 ? rand() % ptype->colorrand : 0;
|
||||
cidx = ptype->colorindex + cidx;
|
||||
if (cidx > 255)
|
||||
p->alpha = p->alpha / 2;
|
||||
cidx = d_8to24rgbtable[cidx & 0xff];
|
||||
p->rgb[0] = (cidx & 0xff) * (1/255.0);
|
||||
p->rgb[1] = (cidx >> 8 & 0xff) * (1/255.0);
|
||||
p->rgb[2] = (cidx >> 16 & 0xff) * (1/255.0);
|
||||
}
|
||||
else
|
||||
VectorCopy(ptype->rgb, p->rgb);
|
||||
|
||||
// use org temporarily for rgbsync
|
||||
p->org[2] = frandom();
|
||||
p->org[0] = p->org[2]*ptype->rgbrandsync[0] + frandom()*(1-ptype->rgbrandsync[0]);
|
||||
p->org[1] = p->org[2]*ptype->rgbrandsync[1] + frandom()*(1-ptype->rgbrandsync[1]);
|
||||
p->org[2] = p->org[2]*ptype->rgbrandsync[2] + frandom()*(1-ptype->rgbrandsync[2]);
|
||||
|
||||
p->rgb[0] += p->org[0]*ptype->rgbrand[0] + ptype->rgbchange[0]*p->die;
|
||||
p->rgb[1] += p->org[1]*ptype->rgbrand[1] + ptype->rgbchange[1]*p->die;
|
||||
p->rgb[2] += p->org[2]*ptype->rgbrand[2] + ptype->rgbchange[2]*p->die;
|
||||
|
||||
p->org[0] = hrandom();
|
||||
p->org[1] = hrandom();
|
||||
if (ptype->areaspreadvert)
|
||||
p->org[2] = hrandom();
|
||||
else
|
||||
p->org[2] = 0;
|
||||
|
||||
VectorNormalize(p->org);
|
||||
if (ptype->spawnmode != SM_CIRCLE)
|
||||
VectorScale(p->org, frandom(), p->org);
|
||||
|
||||
p->org[0] = org[0] + p->org[0]*ptype->areaspread;
|
||||
p->org[1] = org[1] + p->org[1]*ptype->areaspread;
|
||||
p->org[2] = org[2] + p->org[2]*ptype->areaspreadvert + ptype->offsetup;
|
||||
|
||||
p->die = particletime + ptype->die - p->die;
|
||||
|
||||
VectorCopy(lastorg, p->u.b.org2);
|
||||
VectorCopy(lastdir, p->u.b.lastdir);
|
||||
|
||||
VectorCopy(p->org, lastorg);
|
||||
VectorSubtract(p->org, p->u.b.org2, lastdir);
|
||||
VectorNormalize(lastdir);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ptype->spawnmode)
|
||||
{
|
||||
|
@ -1416,10 +1499,10 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->scale = ptype->scale+ptype->randscale*frandom();
|
||||
p->alpha = ptype->alpha-p->die*(ptype->alpha/ptype->die)*ptype->alphachange;
|
||||
p->color = 0;
|
||||
p->nextemit = particletime + ptype->emitstart - p->die;
|
||||
p->u.p.nextemit = particletime + ptype->emitstart - p->die;
|
||||
|
||||
p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->alpha = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
p->u.p.rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->u.p.angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
|
||||
if (ptype->colorindex >= 0)
|
||||
{
|
||||
|
@ -1450,21 +1533,21 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->org[1] = crandom();
|
||||
p->org[2] = crandom();
|
||||
|
||||
p->vel[0] = crandom()*ptype->randomvel;
|
||||
p->vel[1] = crandom()*ptype->randomvel;
|
||||
p->vel[2] = crandom()*ptype->randomvelvert;
|
||||
p->u.p.vel[0] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[1] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[2] = crandom()*ptype->randomvelvert;
|
||||
|
||||
if (dir)
|
||||
{
|
||||
p->vel[0] += dir[0]*ptype->veladd+p->org[0]*ptype->offsetspread;
|
||||
p->vel[1] += dir[1]*ptype->veladd+p->org[1]*ptype->offsetspread;
|
||||
p->vel[2] += dir[2]*ptype->veladd+p->org[2]*ptype->offsetspreadvert;
|
||||
p->u.p.vel[0] += dir[0]*ptype->veladd+p->org[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += dir[1]*ptype->veladd+p->org[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += dir[2]*ptype->veladd+p->org[2]*ptype->offsetspreadvert;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->vel[0] += p->org[0]*ptype->offsetspread;
|
||||
p->vel[1] += p->org[1]*ptype->offsetspread;
|
||||
p->vel[2] += p->org[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
p->u.p.vel[0] += p->org[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += p->org[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += p->org[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
}
|
||||
p->org[0] = org[0] + p->org[0]*ptype->areaspread;
|
||||
p->org[1] = org[1] + p->org[1]*ptype->areaspread;
|
||||
|
@ -1490,10 +1573,10 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->scale = ptype->scale+ptype->randscale*frandom();
|
||||
p->alpha = ptype->alpha-p->die*(ptype->alpha/ptype->die)*ptype->alphachange;
|
||||
p->color = 0;
|
||||
p->nextemit = particletime + ptype->emitstart - p->die;
|
||||
p->u.p.nextemit = particletime + ptype->emitstart - p->die;
|
||||
|
||||
p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->alpha = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
p->u.p.rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->u.p.angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
|
||||
if (ptype->colorindex >= 0)
|
||||
{
|
||||
|
@ -1520,9 +1603,9 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->rgb[1] += p->org[1]*ptype->rgbrand[1] + ptype->rgbchange[1]*p->die;
|
||||
p->rgb[2] += p->org[2]*ptype->rgbrand[2] + ptype->rgbchange[2]*p->die;
|
||||
|
||||
p->vel[0] = crandom()*ptype->randomvel;
|
||||
p->vel[1] = crandom()*ptype->randomvel;
|
||||
p->vel[2] = crandom()*ptype->randomvelvert;
|
||||
p->u.p.vel[0] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[1] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[2] = crandom()*ptype->randomvelvert;
|
||||
|
||||
// use org to store temp for particle dir
|
||||
p->org[0] = k;
|
||||
|
@ -1533,15 +1616,15 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
|
||||
if (dir)
|
||||
{
|
||||
p->vel[0] += dir[0]*ptype->veladd+p->org[0]*ptype->offsetspread;
|
||||
p->vel[1] += dir[1]*ptype->veladd+p->org[1]*ptype->offsetspread;
|
||||
p->vel[2] += dir[2]*ptype->veladd+p->org[2]*ptype->offsetspreadvert;
|
||||
p->u.p.vel[0] += dir[0]*ptype->veladd+p->org[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += dir[1]*ptype->veladd+p->org[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += dir[2]*ptype->veladd+p->org[2]*ptype->offsetspreadvert;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->vel[0] += p->org[0]*ptype->offsetspread;
|
||||
p->vel[1] += p->org[1]*ptype->offsetspread;
|
||||
p->vel[2] += p->org[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
p->u.p.vel[0] += p->org[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += p->org[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += p->org[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
}
|
||||
|
||||
// org is just like the original
|
||||
|
@ -1583,10 +1666,10 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->scale = ptype->scale+ptype->randscale*frandom();
|
||||
p->alpha = ptype->alpha-p->die*(ptype->alpha/ptype->die)*ptype->alphachange;
|
||||
p->color = 0;
|
||||
p->nextemit = particletime + ptype->emitstart - p->die;
|
||||
p->u.p.nextemit = particletime + ptype->emitstart - p->die;
|
||||
|
||||
p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->alpha = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
p->u.p.rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->u.p.angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
|
||||
if (ptype->colorindex >= 0)
|
||||
{
|
||||
|
@ -1613,9 +1696,9 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->rgb[1] += p->org[1]*ptype->rgbrand[1] + ptype->rgbchange[1]*p->die;
|
||||
p->rgb[2] += p->org[2]*ptype->rgbrand[2] + ptype->rgbchange[2]*p->die;
|
||||
|
||||
p->vel[0] = crandom()*ptype->randomvel;
|
||||
p->vel[1] = crandom()*ptype->randomvel;
|
||||
p->vel[2] = crandom()*ptype->randomvelvert;
|
||||
p->u.p.vel[0] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[1] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[2] = crandom()*ptype->randomvelvert;
|
||||
|
||||
// calc directions, org with temp vector
|
||||
{
|
||||
|
@ -1635,15 +1718,15 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
|
||||
if (dir)
|
||||
{
|
||||
p->vel[0] += dir[0]*ptype->veladd+temp[0]*ptype->offsetspread;
|
||||
p->vel[1] += dir[1]*ptype->veladd+temp[1]*ptype->offsetspread;
|
||||
p->vel[2] += dir[2]*ptype->veladd+temp[2]*ptype->offsetspreadvert;
|
||||
p->u.p.vel[0] += dir[0]*ptype->veladd+temp[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += dir[1]*ptype->veladd+temp[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += dir[2]*ptype->veladd+temp[2]*ptype->offsetspreadvert;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->vel[0] += temp[0]*ptype->offsetspread;
|
||||
p->vel[1] += temp[1]*ptype->offsetspread;
|
||||
p->vel[2] += temp[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
p->u.p.vel[0] += temp[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += temp[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += temp[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1675,10 +1758,10 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->scale = ptype->scale+ptype->randscale*frandom();
|
||||
p->alpha = ptype->alpha-p->die*(ptype->alpha/ptype->die)*ptype->alphachange;
|
||||
p->color = 0;
|
||||
p->nextemit = particletime + ptype->emitstart - p->die;
|
||||
p->u.p.nextemit = particletime + ptype->emitstart - p->die;
|
||||
|
||||
p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->alpha = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
p->u.p.rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->u.p.angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
|
||||
if (ptype->colorindex >= 0)
|
||||
{
|
||||
|
@ -1716,21 +1799,21 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
if (ptype->spawnmode != SM_CIRCLE)
|
||||
VectorScale(p->org, frandom(), p->org);
|
||||
|
||||
p->vel[0] = crandom()*ptype->randomvel;
|
||||
p->vel[1] = crandom()*ptype->randomvel;
|
||||
p->vel[2] = crandom()*ptype->randomvelvert;
|
||||
p->u.p.vel[0] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[1] = crandom()*ptype->randomvel;
|
||||
p->u.p.vel[2] = crandom()*ptype->randomvelvert;
|
||||
|
||||
if (dir)
|
||||
{
|
||||
p->vel[0] += dir[0]*ptype->veladd+org[0]*ptype->offsetspread;
|
||||
p->vel[1] += dir[1]*ptype->veladd+org[1]*ptype->offsetspread;
|
||||
p->vel[2] += dir[2]*ptype->veladd+org[2]*ptype->offsetspreadvert;
|
||||
p->u.p.vel[0] += dir[0]*ptype->veladd+org[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += dir[1]*ptype->veladd+org[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += dir[2]*ptype->veladd+org[2]*ptype->offsetspreadvert;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->vel[0] += p->org[0]*ptype->offsetspread;
|
||||
p->vel[1] += p->org[1]*ptype->offsetspread;
|
||||
p->vel[2] += p->org[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
p->u.p.vel[0] += p->org[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] += p->org[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] += p->org[2]*ptype->offsetspreadvert - ptype->veladd;
|
||||
|
||||
}
|
||||
p->org[0] = org[0] + p->org[0]*ptype->areaspread;
|
||||
|
@ -1740,6 +1823,7 @@ int R_RunParticleEffectType (vec3_t org, vec3_t dir, float count, int typenum)
|
|||
p->die = particletime + ptype->die - p->die;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ptype->assoc < 0)
|
||||
|
@ -1948,8 +2032,7 @@ void CLQ2_RailTrail (vec3_t start, vec3_t end)
|
|||
R_RocketTrail(start, end, rt_railtrail, 0);
|
||||
}
|
||||
|
||||
|
||||
float R_RocketTrail (vec3_t start, vec3_t end, int type, float lastdistance)
|
||||
void R_RocketTrail (vec3_t start, vec3_t end, int type, trailstate_t *ts)
|
||||
{
|
||||
vec3_t vec, right, up;
|
||||
float len;
|
||||
|
@ -1963,24 +2046,22 @@ float R_RocketTrail (vec3_t start, vec3_t end, int type, float lastdistance)
|
|||
float stop;
|
||||
|
||||
if (!ptype->loaded)
|
||||
return lastdistance;
|
||||
return;
|
||||
|
||||
if (ptype->assoc>=0)
|
||||
{
|
||||
trailstate_t nts;
|
||||
VectorCopy(start, vec);
|
||||
R_RocketTrail(vec, end, ptype->assoc, lastdistance);
|
||||
memcpy(&nts, ts, sizeof(nts));
|
||||
R_RocketTrail(vec, end, ptype->assoc, &nts);
|
||||
}
|
||||
step = 1/ptype->count;
|
||||
|
||||
if (!ptype->scale)
|
||||
return lastdistance;
|
||||
if (step < 0.01)
|
||||
step = 0.01;
|
||||
|
||||
VectorSubtract (end, start, vec);
|
||||
len = VectorNormalize (vec);
|
||||
if (len > 1024)
|
||||
return lastdistance;
|
||||
|
||||
// add offset
|
||||
start[2] += ptype->offsetup;
|
||||
|
@ -1988,24 +2069,64 @@ float R_RocketTrail (vec3_t start, vec3_t end, int type, float lastdistance)
|
|||
if (ptype->spawnmode == SM_SPIRAL)
|
||||
{
|
||||
VectorVectors(vec, right, up);
|
||||
|
||||
//nice idea, stops areaspread/offsetspread being so seperate.
|
||||
// VectorScale(right, ptype->offsetspread, right);
|
||||
// VectorScale(up, ptype->offsetspread, up);
|
||||
}
|
||||
|
||||
stop = lastdistance + len; //when to stop
|
||||
stop = ts->lastdist + len; //when to stop
|
||||
|
||||
len = lastdistance/step;
|
||||
len = (len - (int)len)*step;
|
||||
// len = ts->lastdist/step;
|
||||
// len = (len - (int)len)*step;
|
||||
// VectorMA (start, -len, vec, start);
|
||||
|
||||
len = lastdistance;
|
||||
len = ts->lastdist;
|
||||
|
||||
if (len/step > 1024)
|
||||
return;
|
||||
|
||||
if (!len && ptype->isbeam)
|
||||
{ //first particle of the trail
|
||||
switch(ptype->spawnmode)
|
||||
{
|
||||
case SM_SPIRAL:
|
||||
{
|
||||
float tsin, tcos;
|
||||
|
||||
tcos = cos(len/50)*ptype->areaspread;
|
||||
tsin = sin(len/50)*ptype->areaspread;
|
||||
|
||||
ts->lastorg[0] = start[0] + right[0]*tcos + up[0]*tsin;
|
||||
ts->lastorg[1] = start[1] + right[1]*tcos + up[1]*tsin;
|
||||
ts->lastorg[2] = start[2] + right[2]*tcos + up[2]*tsin;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ts->lastorg[0] = crandom();
|
||||
ts->lastorg[1] = crandom();
|
||||
ts->lastorg[2] = crandom();
|
||||
|
||||
ts->lastorg[0] = ts->lastorg[0]*ptype->areaspread + start[0];
|
||||
ts->lastorg[1] = ts->lastorg[1]*ptype->areaspread + start[1];
|
||||
ts->lastorg[2] = ts->lastorg[2]*ptype->areaspreadvert + start[2];
|
||||
break;
|
||||
}
|
||||
VectorCopy(vec, ts->lastdir);
|
||||
|
||||
len += step;
|
||||
stop += step;
|
||||
}
|
||||
|
||||
while (len < stop)
|
||||
{
|
||||
len += step;
|
||||
|
||||
if (!free_particles)
|
||||
return stop;
|
||||
{
|
||||
ts->lastdist = stop;
|
||||
return;
|
||||
}
|
||||
p = free_particles;
|
||||
free_particles = p->next;
|
||||
p->next = ptype->particles;
|
||||
|
@ -2013,13 +2134,8 @@ float R_RocketTrail (vec3_t start, vec3_t end, int type, float lastdistance)
|
|||
|
||||
p->die = ptype->randdie*frandom();
|
||||
p->scale = ptype->scale+ptype->randscale*frandom();
|
||||
VectorCopy (vec3_origin, p->vel);
|
||||
p->alpha = ptype->alpha-p->die*(ptype->alpha/ptype->die)*ptype->alphachange;
|
||||
p->color = 0;
|
||||
p->nextemit = particletime + ptype->emitstart - p->die;
|
||||
|
||||
p->rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->alpha = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
|
||||
if (ptype->spawnmode == SM_TRACER)
|
||||
tcount = (int)(len * ptype->count);
|
||||
|
@ -2052,27 +2168,68 @@ float R_RocketTrail (vec3_t start, vec3_t end, int type, float lastdistance)
|
|||
p->rgb[1] += p->org[1]*ptype->rgbrand[1] + ptype->rgbchange[1]*p->die;
|
||||
p->rgb[2] += p->org[2]*ptype->rgbrand[2] + ptype->rgbchange[2]*p->die;
|
||||
|
||||
if (ptype->isbeam)
|
||||
{
|
||||
switch(ptype->spawnmode)
|
||||
{
|
||||
case SM_SPIRAL:
|
||||
{
|
||||
float tsin, tcos;
|
||||
|
||||
tcos = cos(len/50)*ptype->areaspread;
|
||||
tsin = sin(len/50)*ptype->areaspread;
|
||||
|
||||
p->org[0] = start[0] + right[0]*tcos + up[0]*tsin;
|
||||
p->org[1] = start[1] + right[1]*tcos + up[1]*tsin;
|
||||
p->org[2] = start[2] + right[2]*tcos + up[2]*tsin;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
p->org[0] = crandom();
|
||||
p->org[1] = crandom();
|
||||
p->org[2] = crandom();
|
||||
|
||||
p->org[0] = p->org[0]*ptype->areaspread + start[0];
|
||||
p->org[1] = p->org[1]*ptype->areaspread + start[1];
|
||||
p->org[2] = p->org[2]*ptype->areaspreadvert + start[2];
|
||||
break;
|
||||
}
|
||||
VectorCopy(ts->lastorg, p->u.b.org2);
|
||||
VectorCopy(ts->lastdir, p->u.b.lastdir);
|
||||
|
||||
VectorCopy(p->org, ts->lastorg);
|
||||
VectorSubtract(p->org, p->u.b.org2, ts->lastdir);
|
||||
VectorNormalize(ts->lastdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy (vec3_origin, p->u.p.vel);
|
||||
p->u.p.nextemit = particletime + ptype->emitstart - p->die;
|
||||
|
||||
p->u.p.rotationspeed = ptype->rotationmin + frandom()*ptype->rotationrand;
|
||||
p->u.p.angle = ptype->rotationstartmin + frandom()*ptype->rotationstartrand;
|
||||
|
||||
switch(ptype->spawnmode)
|
||||
{
|
||||
case SM_TRACER:
|
||||
if (tcount & 1)
|
||||
{
|
||||
p->vel[0] = vec[1]*ptype->offsetspread;
|
||||
p->vel[1] = -vec[0]*ptype->offsetspread;
|
||||
p->u.p.vel[0] = vec[1]*ptype->offsetspread;
|
||||
p->u.p.vel[1] = -vec[0]*ptype->offsetspread;
|
||||
p->org[0] = vec[1]*ptype->areaspread;
|
||||
p->org[1] = -vec[0]*ptype->areaspread;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->vel[0] = -vec[1]*ptype->offsetspread;
|
||||
p->vel[1] = vec[0]*ptype->offsetspread;
|
||||
p->u.p.vel[0] = -vec[1]*ptype->offsetspread;
|
||||
p->u.p.vel[1] = vec[0]*ptype->offsetspread;
|
||||
p->org[0] = -vec[1]*ptype->areaspread;
|
||||
p->org[1] = vec[0]*ptype->areaspread;
|
||||
}
|
||||
|
||||
p->vel[0] += vec[0]*veladd+crandom()*randvel;
|
||||
p->vel[1] += vec[1]*veladd+crandom()*randvel;
|
||||
p->vel[2] = vec[2]*veladd+crandom()*randvel;
|
||||
p->u.p.vel[0] += vec[0]*veladd+crandom()*randvel;
|
||||
p->u.p.vel[1] += vec[1]*veladd+crandom()*randvel;
|
||||
p->u.p.vel[2] = vec[2]*veladd+crandom()*randvel;
|
||||
|
||||
p->org[0] += start[0];
|
||||
p->org[1] += start[1];
|
||||
|
@ -2092,9 +2249,9 @@ float R_RocketTrail (vec3_t start, vec3_t end, int type, float lastdistance)
|
|||
tcos = cos(len/50)*ptype->offsetspread;
|
||||
tsin = sin(len/50)*ptype->offsetspread;
|
||||
|
||||
p->vel[0] = vec[0]*veladd+crandom()*randvel + right[0]*tcos + up[0]*tsin;
|
||||
p->vel[1] = vec[1]*veladd+crandom()*randvel + right[1]*tcos + up[1]*tsin;
|
||||
p->vel[2] = vec[2]*veladd+crandom()*randvel + right[2]*tcos + up[2]*tsin;
|
||||
p->u.p.vel[0] = vec[0]*veladd+crandom()*randvel + right[0]*tcos + up[0]*tsin;
|
||||
p->u.p.vel[1] = vec[1]*veladd+crandom()*randvel + right[1]*tcos + up[1]*tsin;
|
||||
p->u.p.vel[2] = vec[2]*veladd+crandom()*randvel + right[2]*tcos + up[2]*tsin;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -2102,22 +2259,24 @@ float R_RocketTrail (vec3_t start, vec3_t end, int type, float lastdistance)
|
|||
p->org[1] = crandom();
|
||||
p->org[2] = crandom();
|
||||
|
||||
p->vel[0] = vec[0]*veladd+crandom()*randvel + p->org[0]*ptype->offsetspread;
|
||||
p->vel[1] = vec[1]*veladd+crandom()*randvel + p->org[1]*ptype->offsetspread;
|
||||
p->vel[2] = vec[2]*veladd+crandom()*randvel + p->org[2]*ptype->offsetspreadvert;
|
||||
p->u.p.vel[0] = vec[0]*veladd+crandom()*randvel + p->org[0]*ptype->offsetspread;
|
||||
p->u.p.vel[1] = vec[1]*veladd+crandom()*randvel + p->org[1]*ptype->offsetspread;
|
||||
p->u.p.vel[2] = vec[2]*veladd+crandom()*randvel + p->org[2]*ptype->offsetspreadvert;
|
||||
|
||||
p->org[0] = p->org[0]*ptype->areaspread + start[0];
|
||||
p->org[1] = p->org[1]*ptype->areaspread + start[1];
|
||||
p->org[2] = p->org[2]*ptype->areaspreadvert + start[2];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
VectorMA (start, step, vec, start);
|
||||
|
||||
p->die = particletime + ptype->die - p->die;
|
||||
}
|
||||
|
||||
return len; //distance the trail actually moved.
|
||||
ts->lastdist = len;
|
||||
return; //distance the trail actually moved.
|
||||
}
|
||||
|
||||
void R_TorchEffect (vec3_t pos, int type)
|
||||
|
@ -2287,10 +2446,10 @@ void GL_DrawTexturedParticle(particle_t *p, part_type_t *type)
|
|||
p->rgb[2],
|
||||
p->alpha);
|
||||
|
||||
if (p->angle)
|
||||
if (p->u.p.angle)
|
||||
{
|
||||
x = sin(p->angle)*scale;
|
||||
y = cos(p->angle)*scale;
|
||||
x = sin(p->u.p.angle)*scale;
|
||||
y = cos(p->u.p.angle)*scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2315,12 +2474,6 @@ void GL_DrawTrifanParticle(particle_t *p, part_type_t *type)
|
|||
|
||||
if (lasttype != type)
|
||||
{
|
||||
if (type-part_type>=numparticletypes||type-part_type<0) //FIXME:! Work out why this is needed...
|
||||
{
|
||||
Con_Printf("Serious bug alert\n");
|
||||
return;
|
||||
}
|
||||
|
||||
lasttype = type;
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
if (type->blendmode == BM_ADD) //addative
|
||||
|
@ -2358,9 +2511,9 @@ void GL_DrawTrifanParticle(particle_t *p, part_type_t *type)
|
|||
0);
|
||||
for (i=7 ; i>=0 ; i--)
|
||||
{
|
||||
v[0] = p->org[0] - p->vel[0]*scale + vright[0]*cost[i%7]*p->scale + vup[0]*sint[i%7]*p->scale;
|
||||
v[1] = p->org[1] - p->vel[1]*scale + vright[1]*cost[i%7]*p->scale + vup[1]*sint[i%7]*p->scale;
|
||||
v[2] = p->org[2] - p->vel[2]*scale + vright[2]*cost[i%7]*p->scale + vup[2]*sint[i%7]*p->scale;
|
||||
v[0] = p->org[0] - p->u.p.vel[0]*scale + vright[0]*cost[i%7]*p->scale + vup[0]*sint[i%7]*p->scale;
|
||||
v[1] = p->org[1] - p->u.p.vel[1]*scale + vright[1]*cost[i%7]*p->scale + vup[1]*sint[i%7]*p->scale;
|
||||
v[2] = p->org[2] - p->u.p.vel[2]*scale + vright[2]*cost[i%7]*p->scale + vup[2]*sint[i%7]*p->scale;
|
||||
glVertex3fv (v);
|
||||
}
|
||||
glEnd ();
|
||||
|
@ -2371,11 +2524,6 @@ void GL_DrawSparkedParticle(particle_t *p, part_type_t *type)
|
|||
{
|
||||
if (lasttype != type)
|
||||
{
|
||||
if (type-part_type>=numparticletypes||type-part_type<0) //FIXME:! Work out why this is needed...
|
||||
{
|
||||
Con_Printf("Serious bug alert\n");
|
||||
return;
|
||||
}
|
||||
lasttype = type;
|
||||
glEnd();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
@ -2400,8 +2548,54 @@ void GL_DrawSparkedParticle(particle_t *p, part_type_t *type)
|
|||
p->rgb[1],
|
||||
p->rgb[2],
|
||||
0);
|
||||
glVertex3f (p->org[0]-p->vel[0]/10, p->org[1]-p->vel[1]/10, p->org[2]-p->vel[2]/10);
|
||||
glVertex3f (p->org[0]-p->u.p.vel[0]/10, p->org[1]-p->u.p.vel[1]/10, p->org[2]-p->u.p.vel[2]/10);
|
||||
|
||||
}
|
||||
void GL_DrawParticleBeam(particle_t *p, part_type_t *type)
|
||||
{
|
||||
vec3_t v, point;
|
||||
vec3_t fwd, cr;
|
||||
if (lasttype != type)
|
||||
{
|
||||
lasttype = type;
|
||||
glEnd();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
GL_Bind(type->texturenum);
|
||||
if (type->blendmode == BM_ADD) //addative
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
// else if (type->blendmode == BM_SUBTRACT) //subtractive
|
||||
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
else
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
glBegin(GL_QUADS);
|
||||
}
|
||||
glColor4f(p->rgb[0],
|
||||
p->rgb[1],
|
||||
p->rgb[2],
|
||||
p->alpha);
|
||||
// glBegin(GL_LINE_LOOP);
|
||||
VectorSubtract(p->org, p->u.b.org2, fwd);
|
||||
VectorNormalize(fwd);
|
||||
|
||||
VectorSubtract(r_refdef.vieworg, p->org, v);
|
||||
VectorNormalize(v);
|
||||
CrossProduct(fwd, v, cr);
|
||||
|
||||
VectorMA(p->org, -p->scale, cr, point);
|
||||
glVertex3fv(point);
|
||||
VectorMA(p->org, p->scale, cr, point);
|
||||
glVertex3fv(point);
|
||||
|
||||
VectorSubtract(r_refdef.vieworg, p->u.b.org2, v);
|
||||
VectorNormalize(v);
|
||||
CrossProduct(p->u.b.lastdir, v, cr);
|
||||
|
||||
VectorMA(p->u.b.org2, p->scale, cr, point);
|
||||
glVertex3fv(point);
|
||||
VectorMA(p->u.b.org2, -p->scale, cr, point);
|
||||
glVertex3fv(point);
|
||||
// glEnd();
|
||||
}
|
||||
#endif
|
||||
#ifdef SWQUAKE
|
||||
|
@ -2448,7 +2642,7 @@ void SWD_DrawParticleBlob(particle_t *p, part_type_t *type)
|
|||
D_DrawParticleTrans(p);
|
||||
}
|
||||
#endif
|
||||
void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void sparkparticles(particle_t*,part_type_t*))
|
||||
void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void sparkparticles(particle_t*,part_type_t*), void beamparticles(particle_t*,part_type_t*))
|
||||
{
|
||||
qboolean (*tr) (vec3_t start, vec3_t end, vec3_t impact, vec3_t normal);
|
||||
|
||||
|
@ -2506,8 +2700,7 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
|
|||
continue;
|
||||
}
|
||||
|
||||
grav = type->gravity*pframetime;
|
||||
VectorScale(type->friction, pframetime, friction);
|
||||
//kill off early ones.
|
||||
for ( ;; )
|
||||
{
|
||||
kill = type->particles;
|
||||
|
@ -2521,6 +2714,106 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
|
|||
break;
|
||||
}
|
||||
|
||||
if (type->isbeam)
|
||||
{ //beams do not:
|
||||
//a: emit other particles
|
||||
//b: move
|
||||
//c: bounce
|
||||
//d: stain
|
||||
//e: obay the laws of physics in any way, shape or form.
|
||||
//f: rotate
|
||||
//g: work in SW.
|
||||
|
||||
//They do:
|
||||
//1: change colour
|
||||
//2: change alpha
|
||||
//3: change scale
|
||||
//4: follow ramps
|
||||
//5: look better than a shitload of blobby particles.
|
||||
//6: die
|
||||
|
||||
//quirks:
|
||||
//q1: beams store point A in thier origin, and point B in thier velocity
|
||||
//q2: depth 'testing' evaluates from thier central point.
|
||||
|
||||
//g
|
||||
if (!beamparticles)
|
||||
{
|
||||
for (p=type->particles ; p ; p=p->next)
|
||||
for ( ;; )
|
||||
{
|
||||
kill = p->next;
|
||||
if (kill && kill->die < particletime)
|
||||
{
|
||||
p->next = kill->next;
|
||||
kill->next = free_particles;
|
||||
free_particles = kill;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
//6
|
||||
for (p=type->particles ; p ; p=p->next)
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
kill = p->next;
|
||||
if (kill && kill->die < particletime)
|
||||
{
|
||||
p->next = kill->next;
|
||||
kill->next = free_particles;
|
||||
free_particles = kill;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//4
|
||||
switch (type->rampmode)
|
||||
{
|
||||
case RAMP_ABSOLUTE:
|
||||
ramp = type->ramp + (int)(type->rampindexes * (type->die - (p->die - particletime)) / type->die);
|
||||
VectorCopy(ramp->rgb, p->rgb);
|
||||
p->alpha = ramp->alpha;
|
||||
p->scale = ramp->scale;
|
||||
break;
|
||||
case RAMP_DELTA: //particle ramps
|
||||
ramp = type->ramp + (int)(type->rampindexes * (type->die - (p->die - particletime)) / type->die);
|
||||
VectorMA(p->rgb, pframetime, ramp->rgb, p->rgb);
|
||||
p->alpha -= pframetime*ramp->alpha;
|
||||
p->scale += pframetime*ramp->scale;
|
||||
break;
|
||||
case RAMP_NONE: //particle changes acording to it's preset properties.
|
||||
//1
|
||||
if (particletime < (p->die-type->die+type->rgbchangetime))
|
||||
{
|
||||
p->rgb[0] += pframetime*type->rgbchange[0];
|
||||
p->rgb[1] += pframetime*type->rgbchange[1];
|
||||
p->rgb[2] += pframetime*type->rgbchange[2];
|
||||
}
|
||||
//2
|
||||
p->alpha -= pframetime*(type->alpha/type->die)*type->alphachange;
|
||||
//3
|
||||
p->scale += pframetime*type->scaledelta;
|
||||
}
|
||||
|
||||
//quirk 2
|
||||
stop[0] = (p->org[0] + p->u.b.org2[0])/2;
|
||||
stop[1] = (p->org[1] + p->u.b.org2[1])/2;
|
||||
stop[2] = (p->org[2] + p->u.b.org2[2])/2;
|
||||
//5
|
||||
RQ_AddDistReorder((void*)beamparticles, p, type, stop);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
grav = type->gravity*pframetime;
|
||||
VectorScale(type->friction, pframetime, friction);
|
||||
|
||||
for (p=type->particles ; p ; p=p->next)
|
||||
{
|
||||
for ( ;; )
|
||||
|
@ -2536,15 +2829,15 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
|
|||
break;
|
||||
}
|
||||
VectorCopy(p->org, oldorg);
|
||||
p->org[0] += p->vel[0]*pframetime;
|
||||
p->org[1] += p->vel[1]*pframetime;
|
||||
p->org[2] += p->vel[2]*pframetime;
|
||||
p->vel[0] -= friction[0]*p->vel[0];
|
||||
p->vel[1] -= friction[1]*p->vel[1];
|
||||
p->vel[2] -= friction[2]*p->vel[2];
|
||||
p->vel[2] -= grav;
|
||||
p->org[0] += p->u.p.vel[0]*pframetime;
|
||||
p->org[1] += p->u.p.vel[1]*pframetime;
|
||||
p->org[2] += p->u.p.vel[2]*pframetime;
|
||||
p->u.p.vel[0] -= friction[0]*p->u.p.vel[0];
|
||||
p->u.p.vel[1] -= friction[1]*p->u.p.vel[1];
|
||||
p->u.p.vel[2] -= friction[2]*p->u.p.vel[2];
|
||||
p->u.p.vel[2] -= grav;
|
||||
|
||||
p->angle += p->rotationspeed*pframetime;
|
||||
p->u.p.angle += p->u.p.rotationspeed*pframetime;
|
||||
|
||||
switch (type->rampmode)
|
||||
{
|
||||
|
@ -2575,10 +2868,10 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
|
|||
{
|
||||
if (type->emittime < 0)
|
||||
R_RocketTrail(oldorg, p->org, type->emit, 0);
|
||||
else if (p->nextemit < particletime)
|
||||
else if (p->u.p.nextemit < particletime)
|
||||
{
|
||||
p->nextemit = particletime + type->emittime + frandom()*type->emitrand;
|
||||
R_RunParticleEffectType(p->org, p->vel, 1, type->emit);
|
||||
p->u.p.nextemit = particletime + type->emittime + frandom()*type->emitrand;
|
||||
R_RunParticleEffectType(p->org, p->u.p.vel, 1, type->emit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2594,22 +2887,22 @@ void DrawParticleTypes (void texturedparticles(particle_t *,part_type_t*), void
|
|||
|
||||
if (type->cliptype == i)
|
||||
{ //bounce
|
||||
dist = DotProduct(p->vel, normal) * (-1-(rand()/(float)0x7fff)/2);
|
||||
dist = DotProduct(p->u.p.vel, normal) * (-1-(rand()/(float)0x7fff)/2);
|
||||
|
||||
VectorMA(p->vel, dist, normal, p->vel);
|
||||
VectorMA(p->u.p.vel, dist, normal, p->u.p.vel);
|
||||
VectorCopy(stop, p->org);
|
||||
p->vel[0] *= 0.8;
|
||||
p->vel[1] *= 0.8;
|
||||
p->vel[2] *= 0.8;
|
||||
p->u.p.vel[0] *= 0.8;
|
||||
p->u.p.vel[1] *= 0.8;
|
||||
p->u.p.vel[2] *= 0.8;
|
||||
|
||||
if (!*type->texname && Length(p->vel)<1000*pframetime)
|
||||
if (!*type->texname && Length(p->u.p.vel)<1000*pframetime)
|
||||
p->die = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->die = -1;
|
||||
VectorNormalize(p->vel);
|
||||
R_RunParticleEffectType(stop, p->vel, type->clipcount/part_type[type->cliptype].count, type->cliptype);
|
||||
VectorNormalize(p->u.p.vel);
|
||||
R_RunParticleEffectType(stop, p->u.p.vel, type->clipcount/part_type[type->cliptype].count, type->cliptype);
|
||||
}
|
||||
|
||||
continue;
|
||||
|
@ -2662,9 +2955,9 @@ void R_DrawParticles (void)
|
|||
glBegin(GL_QUADS);
|
||||
|
||||
if (gl_part_trifansparks.value)
|
||||
DrawParticleTypes(GL_DrawTexturedParticle, GL_DrawTrifanParticle);
|
||||
DrawParticleTypes(GL_DrawTexturedParticle, GL_DrawTrifanParticle, GL_DrawParticleBeam);
|
||||
else
|
||||
DrawParticleTypes(GL_DrawTexturedParticle, GL_DrawSparkedParticle);
|
||||
DrawParticleTypes(GL_DrawTexturedParticle, GL_DrawSparkedParticle, GL_DrawParticleBeam);
|
||||
|
||||
glEnd();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
@ -2677,7 +2970,7 @@ void R_DrawParticles (void)
|
|||
if (qrenderer == QR_SOFTWARE)
|
||||
{
|
||||
D_StartParticles();
|
||||
DrawParticleTypes(SWD_DrawParticleBlob, SWD_DrawParticleSpark);
|
||||
DrawParticleTypes(SWD_DrawParticleBlob, SWD_DrawParticleSpark, NULL);//SWD_DrawParticleBeam);
|
||||
D_EndParticles();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -192,7 +192,12 @@ 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);
|
||||
|
||||
float R_RocketTrail (vec3_t start, vec3_t end, int type, float olddistance);
|
||||
typedef struct {
|
||||
float lastdist;
|
||||
vec3_t lastorg; //use only if lastdist
|
||||
vec3_t lastdir; //use only if lastdist
|
||||
} 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);
|
||||
void R_RunParticleEffect2 (vec3_t org, vec3_t dmin, vec3_t dmax, int color, int effect, int count);
|
||||
void R_RunParticleEffect3 (vec3_t org, vec3_t box, int color, int effect, int count);
|
||||
|
|
|
@ -36,9 +36,6 @@ void S_StopAllSoundsC(void);
|
|||
|
||||
void S_UpdateCard(soundcardinfo_t *sc, vec3_t origin, vec3_t forward, vec3_t right, vec3_t up);
|
||||
|
||||
// QuakeWorld hack...
|
||||
#define viewentity playernum[0]+1
|
||||
|
||||
// =======================================================================
|
||||
// Internal sound data & structures
|
||||
// =======================================================================
|
||||
|
@ -83,6 +80,7 @@ cvar_t ambient_fade = {"ambient_fade", "100"};
|
|||
cvar_t snd_noextraupdate = {"snd_noextraupdate", "0"};
|
||||
cvar_t snd_show = {"snd_show", "0"};
|
||||
cvar_t snd_khz = {"snd_khz", "11"};
|
||||
cvar_t snd_inactive = {"snd_inactive", "0"}; //set if you want sound even when tabbed out.
|
||||
cvar_t _snd_mixahead = {"_snd_mixahead", "0.2", NULL, CVAR_ARCHIVE};
|
||||
cvar_t snd_leftisright = {"snd_leftisright", "0", NULL, CVAR_ARCHIVE};
|
||||
cvar_t snd_eax = {"snd_eax", "0"};
|
||||
|
@ -482,6 +480,8 @@ void S_Init (void)
|
|||
|
||||
Cvar_Register(&snd_capture, "Sound controls");
|
||||
|
||||
Cvar_Register(&snd_inactive, "Sound controls");
|
||||
|
||||
if (host_parms.memsize < 0x800000)
|
||||
{
|
||||
Cvar_Set (&loadas8bit, "1");
|
||||
|
@ -666,7 +666,7 @@ channel_t *SND_PickChannel(soundcardinfo_t *sc, int entnum, int entchannel)
|
|||
}
|
||||
|
||||
// don't let monster sounds override player sounds
|
||||
if (sc->channel[ch_idx].entnum == cl.viewentity && entnum != cl.viewentity && sc->channel[ch_idx].sfx)
|
||||
if (sc->channel[ch_idx].entnum == cl.playernum[0]+1 && entnum != cl.playernum[0]+1 && sc->channel[ch_idx].sfx)
|
||||
continue;
|
||||
|
||||
if (sc->channel[ch_idx].end < life_left)
|
||||
|
@ -699,7 +699,7 @@ void SND_Spatialize(soundcardinfo_t *sc, channel_t *ch)
|
|||
sfx_t *snd;
|
||||
|
||||
// anything coming from the view entity will allways be full volume
|
||||
if (ch->entnum == -1 || ch->entnum == (cl.viewentity?cl.viewentity:cl.playernum[0]+1))
|
||||
if (ch->entnum == -1 || ch->entnum == cl.playernum[0]+1)
|
||||
{
|
||||
ch->vol[0] = ch->master_vol;
|
||||
ch->vol[1] = ch->master_vol;
|
||||
|
@ -788,6 +788,9 @@ void SND_Spatialize(soundcardinfo_t *sc, channel_t *ch)
|
|||
ch->vol[5] = (int) (ch->master_vol * scale[5]);
|
||||
if (ch->vol[5] < 0)
|
||||
ch->vol[5] = 0;
|
||||
|
||||
if (ch->vol[0])
|
||||
Con_Printf("Spacialising\n");
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
@ -870,6 +873,8 @@ void S_StartSoundCard(soundcardinfo_t *sc, int entnum, int entchannel, sfx_t *sf
|
|||
void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
|
||||
{
|
||||
soundcardinfo_t *sc;
|
||||
|
||||
Con_Printf("Starting sound %s\n", sfx->name);
|
||||
if (!sfx || !*sfx->name) //no named sounds would need specific starting.
|
||||
return;
|
||||
|
||||
|
@ -1165,8 +1170,13 @@ void S_UpdateCard(soundcardinfo_t *sc, vec3_t origin, vec3_t forward, vec3_t rig
|
|||
channel_t *ch;
|
||||
channel_t *combine;
|
||||
|
||||
if (!sound_started || (snd_blocked > 0))
|
||||
if (!sound_started)
|
||||
return;
|
||||
if ((snd_blocked > 0))
|
||||
{
|
||||
if (!sc->inactive_sound)
|
||||
return;
|
||||
}
|
||||
|
||||
VectorCopy(origin, listener_origin);
|
||||
VectorCopy(forward, listener_forward);
|
||||
|
@ -1451,7 +1461,7 @@ void S_LocalSound (char *sound)
|
|||
Con_Printf ("S_LocalSound: can't cache %s\n", sound);
|
||||
return;
|
||||
}
|
||||
S_StartSound (cl.viewentity, -1, sfx, vec3_origin, 1, 1);
|
||||
S_StartSound (-1, -1, sfx, vec3_origin, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ int SNDDMA_Init(soundcardinfo_t *sc)
|
|||
if (!strcmp(ec->name, snddev))
|
||||
return 2;
|
||||
|
||||
sc->inactive_sound = true; //linux sound devices always play sound, even when we're not the active app...
|
||||
|
||||
// open the sound device, confirm capability to mmap, and get size of dma buffer
|
||||
|
||||
Q_strncpyz(sc->name, snddev, sizeof(sc->name));
|
||||
|
|
|
@ -587,6 +587,7 @@ void S_PaintChannels(soundcardinfo_t *sc, int endtime)
|
|||
continue;
|
||||
if (!ch->vol[0] && !ch->vol[1] && !ch->vol[2] && !ch->vol[3] && !ch->vol[4] && !ch->vol[5])
|
||||
continue;
|
||||
Con_Printf("Volume %i %i\n", ch->vol[0], ch->vol[1]);
|
||||
scache = S_LoadSound (ch->sfx);
|
||||
if (!scache)
|
||||
continue;
|
||||
|
|
|
@ -95,10 +95,12 @@ void S_BlockSound (void)
|
|||
|
||||
for (sc = sndcardinfo; sc; sc=sc->next)
|
||||
{
|
||||
if (sc->snd_iswave)
|
||||
if (sc->snd_iswave && !sc->inactive_sound)
|
||||
{
|
||||
if (snd_blocked == 1)
|
||||
waveOutReset (sc->hWaveOut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -421,7 +423,7 @@ Direct-Sound support
|
|||
*/
|
||||
sndinitstat SNDDMA_InitDirect (soundcardinfo_t *sc)
|
||||
{
|
||||
extern cvar_t snd_khz, snd_eax, snd_speakers;
|
||||
extern cvar_t snd_khz, snd_eax, snd_speakers, snd_inactive;
|
||||
DSBUFFERDESC dsbuf;
|
||||
DSBCAPS dsbcaps;
|
||||
DWORD dwSize, dwWrite;
|
||||
|
@ -613,7 +615,12 @@ sndinitstat SNDDMA_InitDirect (soundcardinfo_t *sc)
|
|||
// create the secondary buffer we'll actually work with
|
||||
memset (&dsbuf, 0, sizeof(dsbuf));
|
||||
dsbuf.dwSize = sizeof(DSBUFFERDESC);
|
||||
dsbuf.dwFlags = DSBCAPS_CTRLFREQUENCY | /*DSBCAPS_LOCSOFTWARE |*/ DSBCAPS_GLOBALFOCUS; //dmw 29 may, 2003 removed locsoftware
|
||||
dsbuf.dwFlags = DSBCAPS_CTRLFREQUENCY; //dmw 29 may, 2003 removed locsoftware
|
||||
if (snd_inactive.value)
|
||||
{
|
||||
dsbuf.dwFlags |= DSBCAPS_GLOBALFOCUS;
|
||||
sc->inactive_sound = true;
|
||||
}
|
||||
dsbuf.dwBufferBytes = SECONDARY_BUFFER_SIZE;
|
||||
dsbuf.lpwfxFormat = (WAVEFORMATEX *)&format;
|
||||
|
||||
|
@ -987,6 +994,8 @@ int SNDDMA_Init(soundcardinfo_t *sc)
|
|||
if (COM_CheckParm ("-wavonly"))
|
||||
wavonly = true;
|
||||
|
||||
sc->inactive_sound = false; //don't generate sound when the window is inactive.
|
||||
|
||||
#ifndef NODIRECTX
|
||||
sc->dsound_init =
|
||||
#endif
|
||||
|
|
|
@ -222,7 +222,7 @@ struct soundcardinfo_s { //windows has one defined AFTER directsound
|
|||
|
||||
|
||||
|
||||
|
||||
qboolean inactive_sound;
|
||||
|
||||
qboolean snd_isdirect;
|
||||
qboolean snd_iswave;
|
||||
|
|
|
@ -96,6 +96,7 @@ struct soundcardinfo_s {
|
|||
DWORD mmstarttime;
|
||||
DWORD gSndBufSize;
|
||||
|
||||
qboolean inactive_sound;
|
||||
#ifndef NODIRECTX
|
||||
qboolean snd_isdirect;
|
||||
#endif
|
||||
|
|
|
@ -177,9 +177,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
// defs common to client and server
|
||||
|
||||
#define GLQUAKE_VERSION 1.01
|
||||
#define VERSION 2.55
|
||||
#define LINUX_VERSION 0.98
|
||||
#define VERSION 2.56
|
||||
|
||||
//#define VERSION3PART //add the 3rd decimal point of a more precise version.
|
||||
|
||||
|
|
|
@ -3984,6 +3984,7 @@ void COM_Gamedir (char *dir)
|
|||
Cbuf_InsertText("cl_warncmd 1\n", RESTRICT_LOCAL);
|
||||
Cbuf_InsertText("exec frontend.cfg\n", RESTRICT_LOCAL);
|
||||
Cbuf_InsertText("exec config.cfg\n", RESTRICT_LOCAL);
|
||||
Cbuf_InsertText("exec fte.cfg\n", RESTRICT_LOCAL);
|
||||
Cbuf_InsertText("cl_warncmd 0\n", RESTRICT_LOCAL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,17 +53,25 @@ typedef struct particle_s
|
|||
float color;
|
||||
vec3_t rgb;
|
||||
float alpha;
|
||||
float angle;
|
||||
|
||||
// drivers never touch the following fields
|
||||
vec3_t vel;
|
||||
float rotationspeed;
|
||||
struct particle_s *next;
|
||||
float nextemit;
|
||||
float die;
|
||||
|
||||
float scale;
|
||||
|
||||
union {
|
||||
struct {
|
||||
vec3_t vel;
|
||||
float angle;
|
||||
float rotationspeed;
|
||||
float nextemit;
|
||||
} p; //point blob
|
||||
struct {
|
||||
vec3_t org2;
|
||||
vec3_t lastdir;
|
||||
} b; //beam
|
||||
} u;
|
||||
|
||||
// drivers never touch the following fields
|
||||
|
||||
struct particle_s *next;
|
||||
float die;
|
||||
} particle_t;
|
||||
|
||||
#define PARTICLE_Z_CLIP 8.0
|
||||
|
|
|
@ -288,14 +288,26 @@ void *BZF_Malloc(int size) //BZ_Malloc but allowed to fail - like straight mallo
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifdef NAMEDMALLOCS
|
||||
void *BZ_NamedRealloc(void *data, int newsize, char *file, int lineno)
|
||||
#else
|
||||
void *BZ_Realloc(void *data, int newsize)
|
||||
#endif
|
||||
{
|
||||
zone_t *oldzone;
|
||||
void *newdata;
|
||||
#ifdef NAMEDMALLOCS
|
||||
if (!data)
|
||||
return Z_MallocNamed(newsize, file, lineno);
|
||||
oldzone = ((zone_t *)((char *)data-MEMDEBUG))-1;
|
||||
newdata = Z_MallocNamed(newsize, file, lineno);
|
||||
#else
|
||||
if (!data)
|
||||
return Z_Malloc(newsize);
|
||||
oldzone = ((zone_t *)((char *)data-MEMDEBUG))-1;
|
||||
newdata = BZ_Malloc(newsize);
|
||||
#endif
|
||||
if (oldzone->size < newsize)
|
||||
{
|
||||
memcpy(newdata, data, oldzone->size);
|
||||
|
@ -320,6 +332,7 @@ void Zone_Print_f(void)
|
|||
int blocks = 0;
|
||||
int futurehide = false;
|
||||
int i;
|
||||
int minsize = 0;
|
||||
qbyte *sent;
|
||||
zone_t *zone;
|
||||
#if MEMDEBUG > 0
|
||||
|
@ -331,8 +344,10 @@ void Zone_Print_f(void)
|
|||
}
|
||||
else
|
||||
#endif
|
||||
if (*Cmd_Argv(1))
|
||||
if (*Cmd_Argv(1) == 'h')
|
||||
futurehide = true;
|
||||
else if (*Cmd_Argv(1))
|
||||
minsize = atoi(Cmd_Argv(1));
|
||||
for(zone = zone_head; zone; zone=zone->next)
|
||||
{
|
||||
blocks++;
|
||||
|
@ -363,7 +378,7 @@ void Zone_Print_f(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (zone->size >= minsize)
|
||||
#endif
|
||||
Con_Printf("%i-%s\n", zone->size, (char *)(zone+1) + zone->size+MEMDEBUG*2);
|
||||
if (futurehide)
|
||||
|
|
|
@ -107,6 +107,7 @@ int Z_Allocated(void);
|
|||
void *BZ_Malloc(int size);
|
||||
void *BZF_Malloc(int size);
|
||||
void *BZ_Realloc(void *ptr, int size);
|
||||
void *BZ_NamedRealloc(void *ptr, int size, char *, int);
|
||||
void BZ_Free(void *ptr);
|
||||
|
||||
#ifdef NAMEDMALLOCS
|
||||
|
@ -114,6 +115,8 @@ void BZ_Free(void *ptr);
|
|||
|
||||
|
||||
#define Z_Malloc(size) Z_MallocNamed(size, __FILE__, __LINE__)
|
||||
|
||||
#define BZ_Realloc(ptr, size) BZ_NamedRealloc(ptr, size, __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
void *Hunk_Alloc (int size); // returns 0 filled memory
|
||||
|
|
|
@ -87,7 +87,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteqw.exe" /pdbtype:sept
|
||||
# ADD LINK32 comctl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib ws32_2.lib /nologo /subsystem:windows /debug /machine:I386 /out:"../../fteqw.exe" /pdbtype:sept
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
|
||||
|
||||
|
@ -6535,6 +6535,10 @@ SOURCE=..\common\bothdefs.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\sw\d_ifacea.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\common\protocol.h
|
||||
# End Source File
|
||||
# End Group
|
||||
|
|
|
@ -27,6 +27,18 @@ Package=<4>
|
|||
|
||||
###############################################################################
|
||||
|
||||
Project: "irc"=..\..\PLUGINS\IRC\irc.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "qcc"=..\qclib\qcc.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
|
@ -39,6 +51,18 @@ Package=<4>
|
|||
|
||||
###############################################################################
|
||||
|
||||
Project: "serverb"=..\..\PLUGINS\serverb\serverb.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
|
|
|
@ -1468,21 +1468,6 @@ void GLDraw_ConsoleBackground (int lines)
|
|||
{
|
||||
GLDraw_AlphaPic (0, lines - vid.height, conback, (float)(1.2 * lines)/y);
|
||||
}
|
||||
/*
|
||||
// hack the version number directly into the pic
|
||||
// y = lines-186;
|
||||
y = lines-14;
|
||||
if (!cls.download) {
|
||||
#ifdef __linux__
|
||||
sprintf (ver, "LinuxGL (%4.2f) QuakeWorld", LINUX_VERSION);
|
||||
#else
|
||||
sprintf (ver, "GL (%4.2f) QuakeWorld", GLQUAKE_VERSION);
|
||||
#endif
|
||||
x = vid.conwidth - (strlen(ver)*8 + 11) - (vid.conwidth*8/320)*7;
|
||||
for (i=0 ; i<strlen(ver) ; i++)
|
||||
Draw_Character (x + i * 8, y, ver[i] | 0x80);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void GLDraw_EditorBackground (int lines)
|
||||
|
|
|
@ -1481,6 +1481,8 @@ void PPL_BaseEntTextures(void)
|
|||
|
||||
if (cl.viewentity[r_refdef.currentplayernum] && currententity->keynum == cl.viewentity[r_refdef.currentplayernum])
|
||||
continue;
|
||||
if (!Cam_DrawPlayer(0, currententity->keynum-1))
|
||||
continue;
|
||||
|
||||
if (!currententity->model)
|
||||
continue;
|
||||
|
|
|
@ -741,6 +741,7 @@ R_PolyBlend
|
|||
*/
|
||||
void R_PolyBlend (void)
|
||||
{
|
||||
extern qboolean gammaworks;
|
||||
if (!v_blend[3])
|
||||
return;
|
||||
|
||||
|
|
|
@ -2617,6 +2617,8 @@ void SV_Impulse_f (void)
|
|||
|
||||
pr_global_struct->time = sv.time;
|
||||
|
||||
memset (&svs.clients[i].edict->v, 0, pr_edict_size-svprogparms.edictsize);
|
||||
|
||||
svs.clients[i].edict->v.netname = PR_SetString(svprogfuncs, "Console");
|
||||
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
|
@ -2631,6 +2633,13 @@ void SV_Impulse_f (void)
|
|||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPreThink);
|
||||
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, svs.clients[i].edict->v.think);
|
||||
{
|
||||
char buffer[256] = "self.ishuman";
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
Con_Printf("Result: %s\n", svprogfuncs->EvaluateDebugString(svprogfuncs, buffer));
|
||||
}
|
||||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, svs.clients[i].edict);
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->PlayerPostThink);
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
|
|||
return 3;
|
||||
}
|
||||
|
||||
if (1)
|
||||
if (0)
|
||||
{
|
||||
ClipVelocity(ent->v.velocity, trace.plane.normal, ent->v.velocity, 1);
|
||||
break;
|
||||
|
|
|
@ -3916,6 +3916,20 @@ haveannothergo:
|
|||
|
||||
cl->lastcmd = newcmd;
|
||||
cl->lastcmd.buttons = 0; // avoid multiple fires on lag
|
||||
|
||||
if (msg_badread)
|
||||
{
|
||||
Con_Printf ("SV_ReadClientMessage: badread\n");
|
||||
SV_DropClient (cl);
|
||||
return;
|
||||
}
|
||||
c = MSG_ReadByte ();
|
||||
if (c != clc_move)
|
||||
{
|
||||
host_client = cl = split;
|
||||
sv_player = cl->edict;
|
||||
goto haveannothergo;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
SV_PreRunCmd();
|
||||
|
@ -4661,5 +4675,7 @@ void SV_ClientThink (void)
|
|||
}
|
||||
|
||||
SV_AirMove ();
|
||||
|
||||
Con_Printf("%f %f %f\n", sv_player->v.velocity[0], sv_player->v.velocity[1], sv_player->v.velocity[2]);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,12 +49,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define pt_org 0
|
||||
#define pt_color 12
|
||||
// drivers never touch the following fields
|
||||
#define pt_next 16
|
||||
/*#define pt_next 16
|
||||
#define pt_vel 20
|
||||
#define pt_ramp 32
|
||||
#define pt_die 36
|
||||
#define pt_type 40
|
||||
#define pt_size 44
|
||||
#define pt_size 44*/
|
||||
|
||||
#define PARTICLE_Z_CLIP 8.0
|
||||
|
||||
|
|
|
@ -752,7 +752,7 @@ void D_DrawSparkTrans32 (particle_t *pparticle) //draw a line in 3d space
|
|||
if (pparticle->alpha <= 0.0)
|
||||
return;
|
||||
|
||||
speed = Length(pparticle->vel);
|
||||
speed = Length(pparticle->u.p.vel);
|
||||
if ((speed) < 1)
|
||||
{
|
||||
D_2dPos(pparticle->org, &u1, &v1, &z1);
|
||||
|
@ -762,9 +762,9 @@ void D_DrawSparkTrans32 (particle_t *pparticle) //draw a line in 3d space
|
|||
{ //causes flickers with lower vels (due to bouncing in physics)
|
||||
if (speed < 50)
|
||||
speed *= 50/speed;
|
||||
VectorMA(pparticle->org, 5/(speed), pparticle->vel, delta);
|
||||
VectorMA(pparticle->org, 5/(speed), pparticle->u.p.vel, delta);
|
||||
D_2dPos(delta, &u1, &v1, &z1);
|
||||
VectorMA(pparticle->org, -5/(speed), pparticle->vel, delta);
|
||||
VectorMA(pparticle->org, -5/(speed), pparticle->u.p.vel, delta);
|
||||
D_2dPos(delta, &u2, &v2, &z2);
|
||||
}
|
||||
|
||||
|
@ -851,7 +851,7 @@ void D_DrawSparkTrans16 (particle_t *pparticle) //draw a line in 3d space, 8bpp
|
|||
if (pparticle->alpha <= 0.0)
|
||||
return;
|
||||
|
||||
speed = Length(pparticle->vel);
|
||||
speed = Length(pparticle->u.p.vel);
|
||||
if ((speed) < 1)
|
||||
{
|
||||
D_2dPos(pparticle->org, &u1, &v1, &z1);
|
||||
|
@ -861,9 +861,9 @@ void D_DrawSparkTrans16 (particle_t *pparticle) //draw a line in 3d space, 8bpp
|
|||
{ //causes flickers with lower vels (due to bouncing in physics)
|
||||
if (speed < 50)
|
||||
speed *= 50/speed;
|
||||
VectorMA(pparticle->org, 2.5/(speed), pparticle->vel, delta);
|
||||
VectorMA(pparticle->org, 2.5/(speed), pparticle->u.p.vel, delta);
|
||||
D_2dPos(delta, &u1, &v1, &z1);
|
||||
VectorMA(pparticle->org, -2.5/(speed), pparticle->vel, delta);
|
||||
VectorMA(pparticle->org, -2.5/(speed), pparticle->u.p.vel, delta);
|
||||
D_2dPos(delta, &u2, &v2, &z2);
|
||||
}
|
||||
|
||||
|
@ -955,7 +955,7 @@ void D_DrawSparkTrans (particle_t *pparticle) //draw a line in 3d space, 8bpp
|
|||
if (t_state & TT_ZERO)
|
||||
return;
|
||||
|
||||
speed = Length(pparticle->vel);
|
||||
speed = Length(pparticle->u.p.vel);
|
||||
if ((speed) < 1)
|
||||
{
|
||||
D_2dPos(pparticle->org, &u1, &v1, &z1);
|
||||
|
@ -965,9 +965,9 @@ void D_DrawSparkTrans (particle_t *pparticle) //draw a line in 3d space, 8bpp
|
|||
{ //causes flickers with lower vels (due to bouncing in physics)
|
||||
if (speed < 50)
|
||||
speed *= 50/speed;
|
||||
VectorMA(pparticle->org, 2.5/(speed), pparticle->vel, delta);
|
||||
VectorMA(pparticle->org, 2.5/(speed), pparticle->u.p.vel, delta);
|
||||
D_2dPos(delta, &u1, &v1, &z1);
|
||||
VectorMA(pparticle->org, -2.5/(speed), pparticle->vel, delta);
|
||||
VectorMA(pparticle->org, -2.5/(speed), pparticle->u.p.vel, delta);
|
||||
D_2dPos(delta, &u2, &v2, &z2);
|
||||
}
|
||||
|
||||
|
|
|
@ -1639,43 +1639,8 @@ void SWDraw_ConsoleBackground (int lines)
|
|||
|
||||
//sprintf (ver, "start commands with a \\ character %4.2f", VERSION);
|
||||
|
||||
if (cls.downloadmethod) //don't cover the downloading bit.
|
||||
{
|
||||
sprintf (ver, "%4.2f", VERSION);
|
||||
dest = conback->data + 320 + 320*186 - 11 - 8*strlen(ver);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r_pixbytes == 4)
|
||||
#ifdef DISTRIBUTION
|
||||
#if defined(__linux__)
|
||||
sprintf (ver, "rgb Linux (%4.2f) QuakeWorld %s %4.2f", LINUX_VERSION, DISTRIBUTION, VERSION);
|
||||
#else
|
||||
sprintf (ver, "rgb QuakeWorld %s %4.2f", DISTRIBUTION, VERSION);
|
||||
#endif
|
||||
#else
|
||||
#if defined(__linux__)
|
||||
sprintf (ver, "rgb Linux (%4.2f) QuakeWorld %4.2f", LINUX_VERSION, VERSION);
|
||||
#else
|
||||
sprintf (ver, "rgb QuakeWorld %4.2f", VERSION);
|
||||
#endif
|
||||
#endif
|
||||
else
|
||||
#ifdef DISTRIBUTION
|
||||
#if defined(__linux__)
|
||||
sprintf (ver, "Linux (%4.2f) QuakeWorld %s %4.2f", LINUX_VERSION, DISTRIBUTION, VERSION);
|
||||
#else
|
||||
sprintf (ver, "QuakeWorld %s %4.2f", DISTRIBUTION, VERSION);
|
||||
#endif
|
||||
#else
|
||||
#if defined(__linux__)
|
||||
sprintf (ver, "Linux (%4.2f) QuakeWorld %4.2f", LINUX_VERSION, VERSION);
|
||||
#else
|
||||
sprintf (ver, "QuakeWorld %4.2f", VERSION);
|
||||
#endif
|
||||
#endif
|
||||
dest = conback->data + 320 - (strlen(ver)*8 + 11) + 320*186;
|
||||
}
|
||||
|
||||
memcpy(saveback, conback->data + 320*186, 320*8);
|
||||
for (x=0 ; x<strlen(ver) ; x++)
|
||||
|
|
Loading…
Reference in a new issue