- ParticleFadeOutAffector::setFadeOutTime can no longer be set to invalid values

- ParticleFadeOutAffector uses now throughout u32 for fadeOutTime (found by greenya)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3439 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2010-11-16 23:45:45 +00:00
parent 90c021e123
commit 43fa6a674f
4 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,9 @@
Changes in 1.8 (??.0?.2010)
- ParticleFadeOutAffector::setFadeOutTime can no longer be set to invalid values
- ParticleFadeOutAffector uses now throughout u32 for fadeOutTime (found by greenya)
- Add missing access function CParticleSystemSceneNode::getAffectors() (seen by B@z)
- Add missing setters/getters for particle emitters (seen by B@z)

View File

@ -20,14 +20,14 @@ public:
//! Sets the targetColor, i.e. the color the particles will interpolate to over time.
virtual void setTargetColor( const video::SColor& targetColor ) = 0;
//! Sets the amount of time it takes for each particle to fade out.
virtual void setFadeOutTime( f32 fadeOutTime ) = 0;
//! Sets the time in milliseconds it takes for each particle to fade out (minimal 1 ms)
virtual void setFadeOutTime( u32 fadeOutTime ) = 0;
//! Gets the targetColor, i.e. the color the particles will interpolate to over time.
virtual const video::SColor& getTargetColor() const = 0;
//! Gets the amount of time it takes for each particle to fade out.
virtual f32 getFadeOutTime() const = 0;
//! Gets the time in milliseconds it takes for each particle to fade out.
virtual u32 getFadeOutTime() const = 0;
//! Get emitter type
virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_FADE_OUT; }

View File

@ -36,7 +36,7 @@ void CParticleFadeOutAffector::affect(u32 now, SParticle* particlearray, u32 cou
{
if (particlearray[i].endTime - now < FadeOutTime)
{
d = (particlearray[i].endTime - now) / FadeOutTime;
d = (particlearray[i].endTime - now) / FadeOutTime; // FadeOutTime probably f32 to save casts here (just guessing)
particlearray[i].color = particlearray[i].startColor.getInterpolated(
TargetColor, d);
}

View File

@ -28,22 +28,22 @@ public:
virtual void setTargetColor( const video::SColor& targetColor ) { TargetColor = targetColor; }
//! Sets the amount of time it takes for each particle to fade out.
virtual void setFadeOutTime( f32 fadeOutTime ) { FadeOutTime = fadeOutTime; }
virtual void setFadeOutTime( u32 fadeOutTime ) { FadeOutTime = fadeOutTime ? static_cast<f32>(fadeOutTime) : 1.0f; }
//! Sets the targetColor, i.e. the color the particles will interpolate
//! to over time.
virtual const video::SColor& getTargetColor() const { return TargetColor; }
//! Sets the amount of time it takes for each particle to fade out.
virtual f32 getFadeOutTime() const { return FadeOutTime; }
virtual u32 getFadeOutTime() const { return static_cast<u32>(FadeOutTime); }
//! Writes attributes of the object.
//! Implement this to expose the attributes of your scene node animator for
//! Implement this to expose the attributes of your scene node animator for
//! scripting languages, editors, debuggers or xml serialization purposes.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
//! Reads attributes of the object.
//! Implement this to set the attributes of your scene node animator for
//! Implement this to set the attributes of your scene node animator for
//! scripting languages, editors, debuggers or xml deserialization purposes.
//! \param startIndex: start index where to start reading attributes.
//! \return: returns last index of an attribute read by this affector