Commit 43fa6a67 authored by cutealien's avatar cutealien

- 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
parent 90c021e1
Changes in 1.8 (??.0?.2010) 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 access function CParticleSystemSceneNode::getAffectors() (seen by B@z)
- Add missing setters/getters for particle emitters (seen by B@z) - Add missing setters/getters for particle emitters (seen by B@z)
......
...@@ -20,14 +20,14 @@ public: ...@@ -20,14 +20,14 @@ public:
//! Sets the targetColor, i.e. the color the particles will interpolate to over time. //! Sets the targetColor, i.e. the color the particles will interpolate to over time.
virtual void setTargetColor( const video::SColor& targetColor ) = 0; virtual void setTargetColor( const video::SColor& targetColor ) = 0;
//! Sets the amount of time it takes for each particle to fade out. //! Sets the time in milliseconds it takes for each particle to fade out (minimal 1 ms)
virtual void setFadeOutTime( f32 fadeOutTime ) = 0; virtual void setFadeOutTime( u32 fadeOutTime ) = 0;
//! Gets the targetColor, i.e. the color the particles will interpolate to over time. //! Gets the targetColor, i.e. the color the particles will interpolate to over time.
virtual const video::SColor& getTargetColor() const = 0; virtual const video::SColor& getTargetColor() const = 0;
//! Gets the amount of time it takes for each particle to fade out. //! Gets the time in milliseconds it takes for each particle to fade out.
virtual f32 getFadeOutTime() const = 0; virtual u32 getFadeOutTime() const = 0;
//! Get emitter type //! Get emitter type
virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_FADE_OUT; } virtual E_PARTICLE_AFFECTOR_TYPE getType() const { return EPAT_FADE_OUT; }
......
...@@ -36,7 +36,7 @@ void CParticleFadeOutAffector::affect(u32 now, SParticle* particlearray, u32 cou ...@@ -36,7 +36,7 @@ void CParticleFadeOutAffector::affect(u32 now, SParticle* particlearray, u32 cou
{ {
if (particlearray[i].endTime - now < FadeOutTime) 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( particlearray[i].color = particlearray[i].startColor.getInterpolated(
TargetColor, d); TargetColor, d);
} }
......
...@@ -28,22 +28,22 @@ public: ...@@ -28,22 +28,22 @@ public:
virtual void setTargetColor( const video::SColor& targetColor ) { TargetColor = targetColor; } virtual void setTargetColor( const video::SColor& targetColor ) { TargetColor = targetColor; }
//! Sets the amount of time it takes for each particle to fade out. //! 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 //! Sets the targetColor, i.e. the color the particles will interpolate
//! to over time. //! to over time.
virtual const video::SColor& getTargetColor() const { return TargetColor; } virtual const video::SColor& getTargetColor() const { return TargetColor; }
//! Sets the amount of time it takes for each particle to fade out. //! 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. //! 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. //! scripting languages, editors, debuggers or xml serialization purposes.
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
//! Reads attributes of the object. //! 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. //! scripting languages, editors, debuggers or xml deserialization purposes.
//! \param startIndex: start index where to start reading attributes. //! \param startIndex: start index where to start reading attributes.
//! \return: returns last index of an attribute read by this affector //! \return: returns last index of an attribute read by this affector
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment