mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-01 05:30:58 +00:00
cl_newfx.c neu durchformatiert und die Kommentare geprüft
This commit is contained in:
parent
e4fcb87983
commit
3b220229ec
1 changed files with 189 additions and 272 deletions
|
@ -1,23 +1,22 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 1997-2001 Id Software, Inc.
|
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||||
|
*
|
||||||
This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
modify it under the terms of the GNU General Public License
|
* the terms of the GNU General Public License as published by the Free
|
||||||
as published by the Free Software Foundation; either version 2
|
* Software Foundation; either version 2 of the License, or (at your option)
|
||||||
of the License, or (at your option) any later version.
|
* any later version.
|
||||||
|
*
|
||||||
This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
See the GNU General Public License for more details.
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License along with
|
||||||
along with this program; if not, write to the Free Software
|
* this program; if not, write to the Free Software Foundation, Inc., 59
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
// cl_newfx.c -- MORE entity effects parsing and management
|
|
||||||
|
|
||||||
#include "header/client.h"
|
#include "header/client.h"
|
||||||
|
|
||||||
|
@ -28,31 +27,26 @@ extern cvar_t *vid_ref;
|
||||||
|
|
||||||
extern void MakeNormalVectors (vec3_t forward, vec3_t right, vec3_t up);
|
extern void MakeNormalVectors (vec3_t forward, vec3_t right, vec3_t up);
|
||||||
|
|
||||||
/*
|
void vectoangles2 (vec3_t value1, vec3_t angles) {
|
||||||
======
|
|
||||||
vectoangles2 - this is duplicated in the game DLL, but I need it here.
|
|
||||||
======
|
|
||||||
*/
|
|
||||||
void vectoangles2 (vec3_t value1, vec3_t angles)
|
|
||||||
{
|
|
||||||
float forward;
|
float forward;
|
||||||
float yaw, pitch;
|
float yaw, pitch;
|
||||||
|
|
||||||
if (value1[1] == 0 && value1[0] == 0)
|
if (value1[1] == 0 && value1[0] == 0) {
|
||||||
{
|
|
||||||
yaw = 0;
|
yaw = 0;
|
||||||
|
|
||||||
if (value1[2] > 0)
|
if (value1[2] > 0)
|
||||||
pitch = 90;
|
pitch = 90;
|
||||||
|
|
||||||
else
|
else
|
||||||
pitch = 270;
|
pitch = 270;
|
||||||
}
|
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
// PMM - fixed to correct for pitch of 0
|
|
||||||
if (value1[0])
|
if (value1[0])
|
||||||
yaw = ((float)atan2(value1[1], value1[0]) * 180 / M_PI);
|
yaw = ((float)atan2(value1[1], value1[0]) * 180 / M_PI);
|
||||||
|
|
||||||
else if (value1[1] > 0)
|
else if (value1[1] > 0)
|
||||||
yaw = 90;
|
yaw = 90;
|
||||||
|
|
||||||
else
|
else
|
||||||
yaw = 270;
|
yaw = 270;
|
||||||
|
|
||||||
|
@ -61,6 +55,7 @@ void vectoangles2 (vec3_t value1, vec3_t angles)
|
||||||
|
|
||||||
forward = (float)sqrt (value1[0]*value1[0] + value1[1]*value1[1]);
|
forward = (float)sqrt (value1[0]*value1[0] + value1[1]*value1[1]);
|
||||||
pitch = ((float)atan2(value1[2], forward) * 180 / M_PI);
|
pitch = ((float)atan2(value1[2], forward) * 180 / M_PI);
|
||||||
|
|
||||||
if (pitch < 0)
|
if (pitch < 0)
|
||||||
pitch += 360;
|
pitch += 360;
|
||||||
}
|
}
|
||||||
|
@ -70,10 +65,7 @@ void vectoangles2 (vec3_t value1, vec3_t angles)
|
||||||
angles[ROLL] = 0;
|
angles[ROLL] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============
|
void CL_Flashlight (int ent, vec3_t pos) {
|
||||||
//=============
|
|
||||||
void CL_Flashlight (int ent, vec3_t pos)
|
|
||||||
{
|
|
||||||
cdlight_t *dl;
|
cdlight_t *dl;
|
||||||
|
|
||||||
dl = CL_AllocDlight (ent);
|
dl = CL_AllocDlight (ent);
|
||||||
|
@ -86,17 +78,10 @@ void CL_Flashlight (int ent, vec3_t pos)
|
||||||
dl->color[2] = 1;
|
dl->color[2] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CL_ColorFlash (vec3_t pos, int ent, float intensity, float r, float g, float b) {
|
||||||
======
|
|
||||||
CL_ColorFlash - flash of light
|
|
||||||
======
|
|
||||||
*/
|
|
||||||
void CL_ColorFlash (vec3_t pos, int ent, float intensity, float r, float g, float b)
|
|
||||||
{
|
|
||||||
cdlight_t *dl;
|
cdlight_t *dl;
|
||||||
|
|
||||||
if((vidref_val == VIDREF_SOFT) && ((r < 0) || (g<0) || (b<0)))
|
if((vidref_val == VIDREF_SOFT) && ((r < 0) || (g<0) || (b<0))) {
|
||||||
{
|
|
||||||
intensity = -intensity;
|
intensity = -intensity;
|
||||||
r = -r;
|
r = -r;
|
||||||
g = -g;
|
g = -g;
|
||||||
|
@ -113,13 +98,7 @@ void CL_ColorFlash (vec3_t pos, int ent, float intensity, float r, float g, floa
|
||||||
dl->color[2] = b;
|
dl->color[2] = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CL_DebugTrail (vec3_t start, vec3_t end) {
|
||||||
======
|
|
||||||
CL_DebugTrail
|
|
||||||
======
|
|
||||||
*/
|
|
||||||
void CL_DebugTrail (vec3_t start, vec3_t end)
|
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
float len;
|
float len;
|
||||||
|
@ -137,11 +116,12 @@ void CL_DebugTrail (vec3_t start, vec3_t end)
|
||||||
VectorScale (vec, dec, vec);
|
VectorScale (vec, dec, vec);
|
||||||
VectorCopy (start, move);
|
VectorCopy (start, move);
|
||||||
|
|
||||||
while (len > 0)
|
while (len > 0) {
|
||||||
{
|
|
||||||
len -= dec;
|
len -= dec;
|
||||||
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -159,13 +139,7 @@ void CL_DebugTrail (vec3_t start, vec3_t end)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CL_SmokeTrail (vec3_t start, vec3_t end, int colorStart, int colorRun, int spacing) {
|
||||||
===============
|
|
||||||
CL_SmokeTrail
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_SmokeTrail (vec3_t start, vec3_t end, int colorStart, int colorRun, int spacing)
|
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
float len, time;
|
float len, time;
|
||||||
|
@ -180,37 +154,36 @@ void CL_SmokeTrail (vec3_t start, vec3_t end, int colorStart, int colorRun, int
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
// FIXME: this is a really silly way to have a loop
|
while (len > 0) {
|
||||||
while (len > 0)
|
|
||||||
{
|
|
||||||
len -= spacing;
|
len -= spacing;
|
||||||
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1+frand()*0.5f);
|
p->alphavel = -1.0f / (1+frand()*0.5f);
|
||||||
p->color = colorStart + (float)(rand() % colorRun);
|
p->color = colorStart + (float)(rand() % colorRun);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = move[j] + crand()*3;
|
p->org[j] = move[j] + crand()*3;
|
||||||
p->accel[j] = 0;
|
p->accel[j] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->vel[2] = 20 + crand()*5;
|
p->vel[2] = 20 + crand()*5;
|
||||||
|
|
||||||
VectorAdd (move, vec, move);
|
VectorAdd (move, vec, move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_ForceWall (vec3_t start, vec3_t end, int color8)
|
void CL_ForceWall (vec3_t start, vec3_t end, int color8) {
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
int j;
|
int j;
|
||||||
|
@ -226,71 +199,66 @@ void CL_ForceWall (vec3_t start, vec3_t end, int color8)
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
// FIXME: this is a really silly way to have a loop
|
while (len > 0) {
|
||||||
while (len > 0)
|
|
||||||
{
|
|
||||||
len -= 4;
|
len -= 4;
|
||||||
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (frand() > 0.3)
|
if (frand() > 0.3) {
|
||||||
{
|
p = free_particles;
|
||||||
p = free_particles;
|
free_particles = p->next;
|
||||||
free_particles = p->next;
|
p->next = active_particles;
|
||||||
p->next = active_particles;
|
active_particles = p;
|
||||||
active_particles = p;
|
VectorClear (p->accel);
|
||||||
VectorClear (p->accel);
|
|
||||||
|
p->time = time;
|
||||||
p->time = time;
|
|
||||||
|
p->alpha = 1.0;
|
||||||
p->alpha = 1.0;
|
p->alphavel = -1.0f / (3.0+frand()*0.5f);
|
||||||
p->alphavel = -1.0f / (3.0+frand()*0.5f);
|
p->color = color8;
|
||||||
p->color = color8;
|
|
||||||
for (j=0 ; j<3 ; j++)
|
for (j=0 ; j<3 ; j++) {
|
||||||
{
|
p->org[j] = move[j] + crand()*3;
|
||||||
p->org[j] = move[j] + crand()*3;
|
p->accel[j] = 0;
|
||||||
p->accel[j] = 0;
|
}
|
||||||
}
|
|
||||||
p->vel[0] = 0;
|
p->vel[0] = 0;
|
||||||
p->vel[1] = 0;
|
p->vel[1] = 0;
|
||||||
p->vel[2] = -40 - (crand()*10);
|
p->vel[2] = -40 - (crand()*10);
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorAdd (move, vec, move);
|
VectorAdd (move, vec, move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CL_GenericParticleEffect (vec3_t org, vec3_t dir, int color, int count, int numcolors, int dirspread, float alphavel) {
|
||||||
===============
|
|
||||||
CL_GenericParticleEffect
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_GenericParticleEffect (vec3_t org, vec3_t dir, int color, int count, int numcolors, int dirspread, float alphavel)
|
|
||||||
{
|
|
||||||
int i, j;
|
int i, j;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
float d;
|
float d;
|
||||||
float time;
|
float time;
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for (i=0 ; i<count ; i++)
|
for (i=0 ; i<count ; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
if (numcolors > 1)
|
if (numcolors > 1)
|
||||||
p->color = color + (rand() & numcolors);
|
p->color = color + (rand() & numcolors);
|
||||||
|
|
||||||
else
|
else
|
||||||
p->color = color;
|
p->color = color;
|
||||||
|
|
||||||
d = (float)(rand() & dirspread);
|
d = (float)(rand() & dirspread);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = org[j] + ((rand()&7)-4) + d*dir[j];
|
p->org[j] = org[j] + ((rand()&7)-4) + d*dir[j];
|
||||||
p->vel[j] = crand()*20;
|
p->vel[j] = crand()*20;
|
||||||
}
|
}
|
||||||
|
@ -304,13 +272,9 @@ void CL_GenericParticleEffect (vec3_t org, vec3_t dir, int color, int count, int
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
* CL_BubbleTrail2 (lets you control the # of bubbles by setting the distance between the spawns)
|
||||||
CL_BubbleTrail2 (lets you control the # of bubbles by setting the distance between the spawns)
|
*/
|
||||||
|
void CL_BubbleTrail2 (vec3_t start, vec3_t end, int dist) {
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_BubbleTrail2 (vec3_t start, vec3_t end, int dist)
|
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
float len, time;
|
float len, time;
|
||||||
|
@ -326,11 +290,10 @@ void CL_BubbleTrail2 (vec3_t start, vec3_t end, int dist)
|
||||||
|
|
||||||
VectorScale (vec, dist, vec);
|
VectorScale (vec, dist, vec);
|
||||||
|
|
||||||
for (i=0 ; i<len ; i+=dist)
|
for (i=0 ; i<len ; i+=dist) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -342,19 +305,19 @@ void CL_BubbleTrail2 (vec3_t start, vec3_t end, int dist)
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (1+frand()*0.1f);
|
p->alphavel = -1.0f / (1+frand()*0.1f);
|
||||||
p->color = 4 + (rand()&7);
|
p->color = 4 + (rand()&7);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = move[j] + crand()*2;
|
p->org[j] = move[j] + crand()*2;
|
||||||
p->vel[j] = crand()*10;
|
p->vel[j] = crand()*10;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->org[2] -= 4;
|
p->org[2] -= 4;
|
||||||
p->vel[2] += 20;
|
p->vel[2] += 20;
|
||||||
VectorAdd (move, vec, move);
|
VectorAdd (move, vec, move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_Heatbeam (vec3_t start, vec3_t forward)
|
void CL_Heatbeam (vec3_t start, vec3_t forward) {
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
float len;
|
float len;
|
||||||
|
@ -378,32 +341,29 @@ void CL_Heatbeam (vec3_t start, vec3_t forward)
|
||||||
VectorSubtract (end, start, vec);
|
VectorSubtract (end, start, vec);
|
||||||
len = VectorNormalize (vec);
|
len = VectorNormalize (vec);
|
||||||
|
|
||||||
// FIXME - pmm - these might end up using old values?
|
|
||||||
VectorCopy (cl.v_right, right);
|
VectorCopy (cl.v_right, right);
|
||||||
VectorCopy (cl.v_up, up);
|
VectorCopy (cl.v_up, up);
|
||||||
if (vidref_val == VIDREF_GL)
|
|
||||||
{ // GL mode
|
if (vidref_val == VIDREF_GL) {
|
||||||
VectorMA (move, -0.5, right, move);
|
VectorMA (move, -0.5, right, move);
|
||||||
VectorMA (move, -0.5, up, move);
|
VectorMA (move, -0.5, up, move);
|
||||||
}
|
}
|
||||||
// otherwise assume SOFT
|
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
ltime = (float) cl.time/1000.0f;
|
ltime = (float) cl.time/1000.0f;
|
||||||
start_pt = (float)fmod(ltime*96.0f,step);
|
start_pt = (float)fmod(ltime*96.0f,step);
|
||||||
VectorMA (move, start_pt, vec, move);
|
VectorMA (move, start_pt, vec, move);
|
||||||
|
|
||||||
VectorScale (vec, step, vec);
|
VectorScale (vec, step, vec);
|
||||||
|
|
||||||
rstep = M_PI/10.0f;
|
rstep = M_PI/10.0f;
|
||||||
for (i=start_pt ; i<len ; i+=step)
|
|
||||||
{
|
for (i=start_pt ; i<len ; i+=step) {
|
||||||
if (i>step*5) // don't bother after the 5th ring
|
if (i>step*5) /* don't bother after the 5th ring */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for (rot = 0; rot < M_PI*2; rot += rstep)
|
for (rot = 0; rot < M_PI*2; rot += rstep) {
|
||||||
{
|
|
||||||
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
@ -412,47 +372,41 @@ void CL_Heatbeam (vec3_t start, vec3_t forward)
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
variance = 0.5;
|
variance = 0.5;
|
||||||
c = (float)cos(rot)*variance;
|
c = (float)cos(rot)*variance;
|
||||||
s = (float)sin(rot)*variance;
|
s = (float)sin(rot)*variance;
|
||||||
|
|
||||||
// trim it so it looks like it's starting at the origin
|
/* trim it so it looks like it's starting at the origin */
|
||||||
if (i < 10)
|
if (i < 10) {
|
||||||
{
|
|
||||||
VectorScale (right, c*(i/10.0f), dir);
|
VectorScale (right, c*(i/10.0f), dir);
|
||||||
VectorMA (dir, s*(i/10.0f), up, dir);
|
VectorMA (dir, s*(i/10.0f), up, dir);
|
||||||
}
|
|
||||||
else
|
} else {
|
||||||
{
|
|
||||||
VectorScale (right, c, dir);
|
VectorScale (right, c, dir);
|
||||||
VectorMA (dir, s, up, dir);
|
VectorMA (dir, s, up, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
p->alpha = 0.5;
|
p->alpha = 0.5;
|
||||||
p->alphavel = -1000.0;
|
p->alphavel = -1000.0;
|
||||||
p->color = 223 - (rand()&7);
|
p->color = 223 - (rand()&7);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = move[j] + dir[j]*3;
|
p->org[j] = move[j] + dir[j]*3;
|
||||||
p->vel[j] = 0;
|
p->vel[j] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorAdd (move, vec, move);
|
VectorAdd (move, vec, move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
*Puffs with velocity along direction, with some randomness thrown in
|
||||||
CL_ParticleSteamEffect
|
*/
|
||||||
|
void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude) {
|
||||||
Puffs with velocity along direction, with some randomness thrown in
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude)
|
|
||||||
{
|
|
||||||
int i, j;
|
int i, j;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
float d, time;
|
float d, time;
|
||||||
|
@ -461,10 +415,10 @@ void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int m
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
MakeNormalVectors (dir, r, u);
|
MakeNormalVectors (dir, r, u);
|
||||||
|
|
||||||
for (i=0 ; i<count ; i++)
|
for (i=0 ; i<count ; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -472,10 +426,11 @@ void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int m
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = color + (rand()&7);
|
p->color = color + (rand()&7);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = org[j] + magnitude*0.1f*crand();
|
p->org[j] = org[j] + magnitude*0.1f*crand();
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorScale (dir, magnitude, p->vel);
|
VectorScale (dir, magnitude, p->vel);
|
||||||
d = crand()*magnitude/3;
|
d = crand()*magnitude/3;
|
||||||
VectorMA (p->vel, d, r, p->vel);
|
VectorMA (p->vel, d, r, p->vel);
|
||||||
|
@ -490,8 +445,7 @@ void CL_ParticleSteamEffect (vec3_t org, vec3_t dir, int color, int count, int m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_ParticleSteamEffect2 (cl_sustain_t *self)
|
void CL_ParticleSteamEffect2 (cl_sustain_t *self) {
|
||||||
{
|
|
||||||
int i, j;
|
int i, j;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
float d;
|
float d;
|
||||||
|
@ -501,10 +455,10 @@ void CL_ParticleSteamEffect2 (cl_sustain_t *self)
|
||||||
VectorCopy (self->dir, dir);
|
VectorCopy (self->dir, dir);
|
||||||
MakeNormalVectors (dir, r, u);
|
MakeNormalVectors (dir, r, u);
|
||||||
|
|
||||||
for (i=0 ; i<self->count ; i++)
|
for (i=0 ; i<self->count ; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -513,10 +467,10 @@ void CL_ParticleSteamEffect2 (cl_sustain_t *self)
|
||||||
p->time = cl.time;
|
p->time = cl.time;
|
||||||
p->color = self->color + (rand()&7);
|
p->color = self->color + (rand()&7);
|
||||||
|
|
||||||
for (j=0 ; j<3 ; j++)
|
for (j=0 ; j<3 ; j++) {
|
||||||
{
|
|
||||||
p->org[j] = self->org[j] + self->magnitude*0.1*crand();
|
p->org[j] = self->org[j] + self->magnitude*0.1*crand();
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorScale (dir, self->magnitude, p->vel);
|
VectorScale (dir, self->magnitude, p->vel);
|
||||||
d = crand()*self->magnitude/3;
|
d = crand()*self->magnitude/3;
|
||||||
VectorMA (p->vel, d, r, p->vel);
|
VectorMA (p->vel, d, r, p->vel);
|
||||||
|
@ -529,16 +483,11 @@ void CL_ParticleSteamEffect2 (cl_sustain_t *self)
|
||||||
|
|
||||||
p->alphavel = -1.0 / (0.5 + frand()*0.3);
|
p->alphavel = -1.0 / (0.5 + frand()*0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
self->nextthink += self->thinkinterval;
|
self->nextthink += self->thinkinterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CL_TrackerTrail (vec3_t start, vec3_t end, int particleColor) {
|
||||||
===============
|
|
||||||
CL_TrackerTrail
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_TrackerTrail (vec3_t start, vec3_t end, int particleColor)
|
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
vec3_t forward,right,up,angle_dir;
|
vec3_t forward,right,up,angle_dir;
|
||||||
|
@ -561,19 +510,18 @@ void CL_TrackerTrail (vec3_t start, vec3_t end, int particleColor)
|
||||||
dec = 3;
|
dec = 3;
|
||||||
VectorScale (vec, 3, vec);
|
VectorScale (vec, 3, vec);
|
||||||
|
|
||||||
// FIXME: this is a really silly way to have a loop
|
while (len > 0) {
|
||||||
while (len > 0)
|
|
||||||
{
|
|
||||||
len -= dec;
|
len -= dec;
|
||||||
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
|
@ -581,19 +529,19 @@ void CL_TrackerTrail (vec3_t start, vec3_t end, int particleColor)
|
||||||
p->color = particleColor;
|
p->color = particleColor;
|
||||||
dist = DotProduct(move, forward);
|
dist = DotProduct(move, forward);
|
||||||
VectorMA(move, 8 * cos(dist), up, p->org);
|
VectorMA(move, 8 * cos(dist), up, p->org);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->vel[j] = 0;
|
p->vel[j] = 0;
|
||||||
p->accel[j] = 0;
|
p->accel[j] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->vel[2] = 5;
|
p->vel[2] = 5;
|
||||||
|
|
||||||
VectorAdd (move, vec, move);
|
VectorAdd (move, vec, move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_Tracker_Shell(vec3_t origin)
|
void CL_Tracker_Shell(vec3_t origin) {
|
||||||
{
|
|
||||||
vec3_t dir;
|
vec3_t dir;
|
||||||
int i;
|
int i;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
|
@ -601,16 +549,16 @@ void CL_Tracker_Shell(vec3_t origin)
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for(i=0;i<300;i++)
|
for(i=0; i<300; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
|
@ -620,13 +568,12 @@ void CL_Tracker_Shell(vec3_t origin)
|
||||||
dir[1] = crand();
|
dir[1] = crand();
|
||||||
dir[2] = crand();
|
dir[2] = crand();
|
||||||
VectorNormalize(dir);
|
VectorNormalize(dir);
|
||||||
|
|
||||||
VectorMA(origin, 40, dir, p->org);
|
VectorMA(origin, 40, dir, p->org);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_MonsterPlasma_Shell(vec3_t origin)
|
void CL_MonsterPlasma_Shell(vec3_t origin) {
|
||||||
{
|
|
||||||
vec3_t dir;
|
vec3_t dir;
|
||||||
int i;
|
int i;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
|
@ -634,16 +581,16 @@ void CL_MonsterPlasma_Shell(vec3_t origin)
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for(i=0;i<40;i++)
|
for(i=0; i<40; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
|
@ -653,13 +600,12 @@ void CL_MonsterPlasma_Shell(vec3_t origin)
|
||||||
dir[1] = crand();
|
dir[1] = crand();
|
||||||
dir[2] = crand();
|
dir[2] = crand();
|
||||||
VectorNormalize(dir);
|
VectorNormalize(dir);
|
||||||
|
|
||||||
VectorMA(origin, 10, dir, p->org);
|
VectorMA(origin, 10, dir, p->org);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_Widowbeamout (cl_sustain_t *self)
|
void CL_Widowbeamout (cl_sustain_t *self) {
|
||||||
{
|
|
||||||
vec3_t dir;
|
vec3_t dir;
|
||||||
int i;
|
int i;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
|
@ -670,16 +616,16 @@ void CL_Widowbeamout (cl_sustain_t *self)
|
||||||
ratio = 1.0f - (((float)self->endtime - (float)cl.time)/2100.0f);
|
ratio = 1.0f - (((float)self->endtime - (float)cl.time)/2100.0f);
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for(i=0;i<300;i++)
|
for(i=0; i<300; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
|
@ -689,13 +635,12 @@ void CL_Widowbeamout (cl_sustain_t *self)
|
||||||
dir[1] = crand();
|
dir[1] = crand();
|
||||||
dir[2] = crand();
|
dir[2] = crand();
|
||||||
VectorNormalize(dir);
|
VectorNormalize(dir);
|
||||||
|
|
||||||
VectorMA(self->org, (45.0 * ratio), dir, p->org);
|
VectorMA(self->org, (45.0 * ratio), dir, p->org);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_Nukeblast (cl_sustain_t *self)
|
void CL_Nukeblast (cl_sustain_t *self) {
|
||||||
{
|
|
||||||
vec3_t dir;
|
vec3_t dir;
|
||||||
int i;
|
int i;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
|
@ -706,16 +651,16 @@ void CL_Nukeblast (cl_sustain_t *self)
|
||||||
ratio = 1.0f - (((float)self->endtime - (float)cl.time)/1000.0f);
|
ratio = 1.0f - (((float)self->endtime - (float)cl.time)/1000.0f);
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for(i=0;i<700;i++)
|
for(i=0; i<700; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
|
@ -725,13 +670,12 @@ void CL_Nukeblast (cl_sustain_t *self)
|
||||||
dir[1] = crand();
|
dir[1] = crand();
|
||||||
dir[2] = crand();
|
dir[2] = crand();
|
||||||
VectorNormalize(dir);
|
VectorNormalize(dir);
|
||||||
|
|
||||||
VectorMA(self->org, (200.0 * ratio), dir, p->org);
|
VectorMA(self->org, (200.0 * ratio), dir, p->org);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_WidowSplash (vec3_t org)
|
void CL_WidowSplash (vec3_t org) {
|
||||||
{
|
|
||||||
static int colortable[4] = {2*8,13*8,21*8,18*8};
|
static int colortable[4] = {2*8,13*8,21*8,18*8};
|
||||||
int i;
|
int i;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
|
@ -740,10 +684,10 @@ void CL_WidowSplash (vec3_t org)
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for (i=0 ; i<256 ; i++)
|
for (i=0 ; i<256 ; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -766,8 +710,7 @@ void CL_WidowSplash (vec3_t org)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_Tracker_Explode(vec3_t origin)
|
void CL_Tracker_Explode(vec3_t origin) {
|
||||||
{
|
|
||||||
vec3_t dir, backdir;
|
vec3_t dir, backdir;
|
||||||
int i;
|
int i;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
|
@ -775,16 +718,16 @@ void CL_Tracker_Explode(vec3_t origin)
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for(i=0;i<300;i++)
|
for(i=0; i<300; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
|
@ -795,21 +738,14 @@ void CL_Tracker_Explode(vec3_t origin)
|
||||||
dir[2] = crand();
|
dir[2] = crand();
|
||||||
VectorNormalize(dir);
|
VectorNormalize(dir);
|
||||||
VectorScale(dir, -1, backdir);
|
VectorScale(dir, -1, backdir);
|
||||||
|
|
||||||
VectorMA(origin, 64, dir, p->org);
|
VectorMA(origin, 64, dir, p->org);
|
||||||
VectorScale(backdir, 64, p->vel);
|
VectorScale(backdir, 64, p->vel);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CL_TagTrail (vec3_t start, vec3_t end, int color) {
|
||||||
===============
|
|
||||||
CL_TagTrail
|
|
||||||
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_TagTrail (vec3_t start, vec3_t end, int color)
|
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
float len;
|
float len;
|
||||||
|
@ -827,25 +763,25 @@ void CL_TagTrail (vec3_t start, vec3_t end, int color)
|
||||||
dec = 5;
|
dec = 5;
|
||||||
VectorScale (vec, 5, vec);
|
VectorScale (vec, 5, vec);
|
||||||
|
|
||||||
while (len >= 0)
|
while (len >= 0) {
|
||||||
{
|
|
||||||
len -= dec;
|
len -= dec;
|
||||||
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (0.8f+frand()*0.2f);
|
p->alphavel = -1.0f / (0.8f+frand()*0.2f);
|
||||||
p->color = color;
|
p->color = color;
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = move[j] + crand()*16;
|
p->org[j] = move[j] + crand()*16;
|
||||||
p->vel[j] = crand()*5;
|
p->vel[j] = crand()*5;
|
||||||
p->accel[j] = 0;
|
p->accel[j] = 0;
|
||||||
|
@ -855,13 +791,7 @@ void CL_TagTrail (vec3_t start, vec3_t end, int color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void CL_ColorExplosionParticles (vec3_t org, int color, int run) {
|
||||||
===============
|
|
||||||
CL_ColorExplosionParticles
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_ColorExplosionParticles (vec3_t org, int color, int run)
|
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
|
@ -869,10 +799,10 @@ void CL_ColorExplosionParticles (vec3_t org, int color, int run)
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
for (i=0 ; i<128 ; i++)
|
for (i=0 ; i<128 ; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -880,8 +810,8 @@ void CL_ColorExplosionParticles (vec3_t org, int color, int run)
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = color + (rand() % run);
|
p->color = color + (rand() % run);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = org[j] + ((rand()%32)-16);
|
p->org[j] = org[j] + ((rand()%32)-16);
|
||||||
p->vel[j] = (rand()%256)-128;
|
p->vel[j] = (rand()%256)-128;
|
||||||
}
|
}
|
||||||
|
@ -895,12 +825,9 @@ void CL_ColorExplosionParticles (vec3_t org, int color, int run)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
* Like the steam effect, but unaffected by gravity
|
||||||
CL_ParticleSmokeEffect - like the steam effect, but unaffected by gravity
|
*/
|
||||||
===============
|
void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude) {
|
||||||
*/
|
|
||||||
void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int magnitude)
|
|
||||||
{
|
|
||||||
int i, j;
|
int i, j;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
float d;
|
float d;
|
||||||
|
@ -911,10 +838,10 @@ void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int m
|
||||||
|
|
||||||
MakeNormalVectors (dir, r, u);
|
MakeNormalVectors (dir, r, u);
|
||||||
|
|
||||||
for (i=0 ; i<count ; i++)
|
for (i=0 ; i<count ; i++) {
|
||||||
{
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -922,10 +849,11 @@ void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int m
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = color + (rand()&7);
|
p->color = color + (rand()&7);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = org[j] + magnitude*0.1f*crand();
|
p->org[j] = org[j] + magnitude*0.1f*crand();
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorScale (dir, magnitude, p->vel);
|
VectorScale (dir, magnitude, p->vel);
|
||||||
d = crand()*magnitude/3;
|
d = crand()*magnitude/3;
|
||||||
VectorMA (p->vel, d, r, p->vel);
|
VectorMA (p->vel, d, r, p->vel);
|
||||||
|
@ -940,27 +868,23 @@ void CL_ParticleSmokeEffect (vec3_t org, vec3_t dir, int color, int count, int m
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
* Wall impact puffs (Green)
|
||||||
CL_BlasterParticles2
|
*/
|
||||||
|
void CL_BlasterParticles2 (vec3_t org, vec3_t dir, unsigned int color) {
|
||||||
Wall impact puffs (Green)
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_BlasterParticles2 (vec3_t org, vec3_t dir, unsigned int color)
|
|
||||||
{
|
|
||||||
int i, j;
|
int i, j;
|
||||||
cparticle_t *p;
|
cparticle_t *p;
|
||||||
float d;
|
float d;
|
||||||
int count;
|
int count;
|
||||||
float time;
|
float time;
|
||||||
|
|
||||||
time = (float)cl.time;
|
time = (float)cl.time;
|
||||||
|
|
||||||
count = 40;
|
count = 40;
|
||||||
for (i=0 ; i<count ; i++)
|
|
||||||
{
|
for (i=0 ; i<count ; i++) {
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
|
@ -969,8 +893,8 @@ void CL_BlasterParticles2 (vec3_t org, vec3_t dir, unsigned int color)
|
||||||
p->time = time;
|
p->time = time;
|
||||||
p->color = color + (rand()&7);
|
p->color = color + (rand()&7);
|
||||||
d = (float)(rand()&15);
|
d = (float)(rand()&15);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = org[j] + ((rand()&7)-4) + d*dir[j];
|
p->org[j] = org[j] + ((rand()&7)-4) + d*dir[j];
|
||||||
p->vel[j] = dir[j] * 30 + crand()*40;
|
p->vel[j] = dir[j] * 30 + crand()*40;
|
||||||
}
|
}
|
||||||
|
@ -984,14 +908,9 @@ void CL_BlasterParticles2 (vec3_t org, vec3_t dir, unsigned int color)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
* Green!
|
||||||
CL_BlasterTrail2
|
*/
|
||||||
|
void CL_BlasterTrail2 (vec3_t start, vec3_t end) {
|
||||||
Green!
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CL_BlasterTrail2 (vec3_t start, vec3_t end)
|
|
||||||
{
|
|
||||||
vec3_t move;
|
vec3_t move;
|
||||||
vec3_t vec;
|
vec3_t vec;
|
||||||
float len;
|
float len;
|
||||||
|
@ -1009,25 +928,24 @@ void CL_BlasterTrail2 (vec3_t start, vec3_t end)
|
||||||
dec = 5;
|
dec = 5;
|
||||||
VectorScale (vec, 5, vec);
|
VectorScale (vec, 5, vec);
|
||||||
|
|
||||||
// FIXME: this is a really silly way to have a loop
|
while (len > 0) {
|
||||||
while (len > 0)
|
|
||||||
{
|
|
||||||
len -= dec;
|
len -= dec;
|
||||||
|
|
||||||
if (!free_particles)
|
if (!free_particles)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = free_particles;
|
p = free_particles;
|
||||||
free_particles = p->next;
|
free_particles = p->next;
|
||||||
p->next = active_particles;
|
p->next = active_particles;
|
||||||
active_particles = p;
|
active_particles = p;
|
||||||
VectorClear (p->accel);
|
VectorClear (p->accel);
|
||||||
|
|
||||||
p->time = time;
|
p->time = time;
|
||||||
|
|
||||||
p->alpha = 1.0;
|
p->alpha = 1.0;
|
||||||
p->alphavel = -1.0f / (float)(0.3f+frand()*0.2f);
|
p->alphavel = -1.0f / (float)(0.3f+frand()*0.2f);
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
for (j=0 ; j<3 ; j++) {
|
||||||
p->org[j] = move[j] + crand();
|
p->org[j] = move[j] + crand();
|
||||||
p->vel[j] = crand()*5;
|
p->vel[j] = crand()*5;
|
||||||
p->accel[j] = 0;
|
p->accel[j] = 0;
|
||||||
|
@ -1036,4 +954,3 @@ void CL_BlasterTrail2 (vec3_t start, vec3_t end)
|
||||||
VectorAdd (move, vec, move);
|
VectorAdd (move, vec, move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue