From 0fa8e3bd716052a97f2e1438f83f77330168fed4 Mon Sep 17 00:00:00 2001 From: georges <> Date: Thu, 8 Feb 2001 20:11:39 +0000 Subject: [PATCH] fix user_alpha --- panda/src/particlesystem/spriteParticleRenderer.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/panda/src/particlesystem/spriteParticleRenderer.cxx b/panda/src/particlesystem/spriteParticleRenderer.cxx index dfd5bedb66..f4078e1a5a 100644 --- a/panda/src/particlesystem/spriteParticleRenderer.cxx +++ b/panda/src/particlesystem/spriteParticleRenderer.cxx @@ -226,13 +226,18 @@ render(vector< PT(PhysicsObject) >& po_vector, int ttl_particles) { // put the current color into the array Colorf c = _color; - if (!(get_alpha_mode() == PR_ALPHA_NONE)) { + int alphamode=get_alpha_mode(); + if (alphamode != PR_ALPHA_NONE) { float t = cur_particle->get_parameterized_age(); - if (get_alpha_mode() == PR_ALPHA_OUT) + if (alphamode == PR_ALPHA_OUT) c[3] = 1.0f - t; - else if (get_alpha_mode() == PR_ALPHA_IN) + else if (alphamode == PR_ALPHA_IN) c[3] = t; + else { + assert(alphamode == PR_ALPHA_USER); + c[3] = get_user_alpha(); + } } *cur_color++ = c;