From: FutureBoyNil <fut...@us...> - 2009-11-07 22:37:45
|
Update of /cvsroot/sphere/sphere/source/particle_engine In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22375 Modified Files: ParticleRenderer.cpp Log Message: Another way of testing for out-of-range blendmodes Index: ParticleRenderer.cpp =================================================================== RCS file: /cvsroot/sphere/sphere/source/particle_engine/ParticleRenderer.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ParticleRenderer.cpp 11 Mar 2009 19:30:05 -0000 1.3 --- ParticleRenderer.cpp 7 Nov 2009 22:37:27 -0000 1.4 *************** *** 25,36 **** ParticleRenderer::SetBlendMode(CImage32::BlendMode blendmode) { ! switch (blendmode) ! { ! case CImage32::BLEND: m_BlendMode = CImage32::BLEND; break; ! case CImage32::ADD: m_BlendMode = CImage32::ADD; break; ! case CImage32::SUBTRACT: m_BlendMode = CImage32::SUBTRACT; break; ! case CImage32::MULTIPLY: m_BlendMode = CImage32::MULTIPLY; break; ! } ! } --- 25,29 ---- ParticleRenderer::SetBlendMode(CImage32::BlendMode blendmode) { ! m_BlendMode = blendmode; } *************** *** 39,43 **** ParticleRenderer::SetBlendMode(int blendmode) { ! switch (blendmode) { case CImage32::BLEND: m_BlendMode = CImage32::BLEND; break; --- 32,39 ---- ParticleRenderer::SetBlendMode(int blendmode) { ! if(blendmode >=0 && blendmode < CImage32::NUM_BLENDS) ! m_BlendMode = (CImage32::BlendMode)blendmode; ! /* ! switch (blendmode) { case CImage32::BLEND: m_BlendMode = CImage32::BLEND; break; *************** *** 46,50 **** case CImage32::MULTIPLY: m_BlendMode = CImage32::MULTIPLY; break; } ! } --- 42,46 ---- case CImage32::MULTIPLY: m_BlendMode = CImage32::MULTIPLY; break; } ! */ } |