Browse Source

Moved particle callbacks to Unity above the original particle effect code, so that if the "no more particles" return branch is taken, the effect will still be forwarded to Unity. Fixes missing particle effects in some scenes.

readme
Nico de Poel 5 years ago
parent
commit
79b47065c7
  1. 22
      engine/Quake/r_part.c

22
engine/Quake/r_part.c

@ -361,6 +361,8 @@ R_ParticleExplosion
*/ */
void R_ParticleExplosion (vec3_t org) void R_ParticleExplosion (vec3_t org)
{ {
UQ_Game_ParticleExplosion(org);
#ifdef USE_OPENGL #ifdef USE_OPENGL
int i, j; int i, j;
particle_t *p; particle_t *p;
@ -397,8 +399,6 @@ void R_ParticleExplosion (vec3_t org)
} }
} }
#endif #endif
UQ_Game_ParticleExplosion(org);
} }
/* /*
@ -489,6 +489,11 @@ R_RunParticleEffect
*/ */
void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count) void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
{ {
if (count == 1024)
UQ_Game_ParticleExplosion(org);
else
UQ_Game_RunParticleEffect(org, dir, color, count);
#ifdef USE_OPENGL #ifdef USE_OPENGL
int i, j; int i, j;
particle_t *p; particle_t *p;
@ -539,11 +544,6 @@ void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count)
} }
} }
#endif #endif
if (count == 1024)
UQ_Game_ParticleExplosion(org);
else
UQ_Game_RunParticleEffect(org, dir, color, count);
} }
/* /*
@ -553,6 +553,8 @@ R_LavaSplash
*/ */
void R_LavaSplash (vec3_t org) void R_LavaSplash (vec3_t org)
{ {
UQ_Game_LavaSplash(org);
#ifdef USE_OPENGL #ifdef USE_OPENGL
int i, j, k; int i, j, k;
particle_t *p; particle_t *p;
@ -587,8 +589,6 @@ void R_LavaSplash (vec3_t org)
VectorScale (dir, vel, p->vel); VectorScale (dir, vel, p->vel);
} }
#endif #endif
UQ_Game_LavaSplash(org);
} }
/* /*
@ -598,6 +598,8 @@ R_TeleportSplash
*/ */
void R_TeleportSplash (vec3_t org) void R_TeleportSplash (vec3_t org)
{ {
UQ_Game_TeleportSplash(org);
#ifdef USE_OPENGL #ifdef USE_OPENGL
int i, j, k; int i, j, k;
particle_t *p; particle_t *p;
@ -632,8 +634,6 @@ void R_TeleportSplash (vec3_t org)
VectorScale (dir, vel, p->vel); VectorScale (dir, vel, p->vel);
} }
#endif #endif
UQ_Game_TeleportSplash(org);
} }
/* /*

Loading…
Cancel
Save