Patch and description by ensiform (#5043):

This patch moves cg_particles.c out of cg_marks.c to the actual file that was
already there but not used.  By default WOLF_PARTICLES definition is commented
out if someone wants to use the old cg_particles.c changes.  cg_particles.c has
been added to the makefile and msvc projects.
This commit is contained in:
Thilo Schulz 2011-06-16 21:58:46 +00:00
parent 16d2ab5f8b
commit 77d764c457
6 changed files with 99 additions and 1983 deletions

View file

@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "cg_local.h"
//#define WOLF_PARTICLES
#define BLOODRED 2
#define EMISIVEFADE 3
#define GREY75 4
@ -91,6 +93,21 @@ typedef enum
#define MAX_SHADER_ANIMS 32
#define MAX_SHADER_ANIM_FRAMES 64
#ifndef WOLF_PARTICLES
static char *shaderAnimNames[MAX_SHADER_ANIMS] = {
"explode1",
NULL
};
static qhandle_t shaderAnims[MAX_SHADER_ANIMS][MAX_SHADER_ANIM_FRAMES];
static int shaderAnimCounts[MAX_SHADER_ANIMS] = {
23
};
static float shaderAnimSTRatio[MAX_SHADER_ANIMS] = {
1.0f
};
static int numShaderAnims;
// done.
#else
static char *shaderAnimNames[MAX_SHADER_ANIMS] = {
"explode1",
"blacksmokeanim",
@ -117,11 +134,14 @@ static float shaderAnimSTRatio[MAX_SHADER_ANIMS] = {
1.0f,
1.0f,
};
static int numShaderAnims;
// done.
#endif
#define PARTICLE_GRAVITY 40
#ifdef WOLF_PARTICLES
#define MAX_PARTICLES 1024 * 8
#else
#define WOLF_PARTICLES 1024
cparticle_t *active_particles, *free_particles;
cparticle_t particles[MAX_PARTICLES];
@ -331,7 +351,11 @@ void CG_AddParticleToScene (cparticle_t *p, vec3_t org, float alpha)
vec3_t rr, ru;
vec3_t rotate_ang;
#ifdef WOLF_PARTICLES
VectorSet (color, 1.0, 1.0, 1.0);
#else
VectorSet (color, 1.0, 1.0, 0.5);
#endif
time = cg.time - p->time;
time2 = p->endtime - p->time;
ratio = time / time2;
@ -1267,7 +1291,11 @@ void CG_ParticleExplosion (char *animStr, vec3_t origin, vec3_t vel, int duratio
p->next = active_particles;
active_particles = p;
p->time = cg.time;
#ifdef WOLF_PARTICLES
p->alpha = 1.0;
#lese
p->alpha = 0.5;
#endif
p->alphavel = 0;
if (duration < 0) {