diff options
author | David Walter Seikel | 2014-01-13 19:47:58 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-01-13 19:47:58 +1000 |
commit | f9158592e1478b2013afc7041d9ed041cf2d2f4a (patch) | |
tree | b16e389d7988700e21b4c9741044cefa536dcbae /libraries/irrlicht-1.8/source/Irrlicht/CParticleFadeOutAffector.cpp | |
parent | Libraries readme updated with change markers and more of the Irrlicht changes. (diff) | |
download | SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.zip SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.tar.gz SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.tar.bz2 SledjHamr-f9158592e1478b2013afc7041d9ed041cf2d2f4a.tar.xz |
Update Irrlicht to 1.8.1. Include actual change markers this time. lol
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CParticleFadeOutAffector.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CParticleFadeOutAffector.cpp b/libraries/irrlicht-1.8/source/Irrlicht/CParticleFadeOutAffector.cpp deleted file mode 100644 index 1d94b58..0000000 --- a/libraries/irrlicht-1.8/source/Irrlicht/CParticleFadeOutAffector.cpp +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | ||
2 | // This file is part of the "Irrlicht Engine". | ||
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | ||
4 | |||
5 | #include "CParticleFadeOutAffector.h" | ||
6 | #include "IAttributes.h" | ||
7 | #include "os.h" | ||
8 | |||
9 | namespace irr | ||
10 | { | ||
11 | namespace scene | ||
12 | { | ||
13 | |||
14 | //! constructor | ||
15 | CParticleFadeOutAffector::CParticleFadeOutAffector( | ||
16 | const video::SColor& targetColor, u32 fadeOutTime) | ||
17 | : IParticleFadeOutAffector(), TargetColor(targetColor) | ||
18 | { | ||
19 | |||
20 | #ifdef _DEBUG | ||
21 | setDebugName("CParticleFadeOutAffector"); | ||
22 | #endif | ||
23 | |||
24 | FadeOutTime = fadeOutTime ? static_cast<f32>(fadeOutTime) : 1.0f; | ||
25 | } | ||
26 | |||
27 | |||
28 | //! Affects an array of particles. | ||
29 | void CParticleFadeOutAffector::affect(u32 now, SParticle* particlearray, u32 count) | ||
30 | { | ||
31 | if (!Enabled) | ||
32 | return; | ||
33 | f32 d; | ||
34 | |||
35 | for (u32 i=0; i<count; ++i) | ||
36 | { | ||
37 | if (particlearray[i].endTime - now < FadeOutTime) | ||
38 | { | ||
39 | d = (particlearray[i].endTime - now) / FadeOutTime; // FadeOutTime probably f32 to save casts here (just guessing) | ||
40 | particlearray[i].color = particlearray[i].startColor.getInterpolated( | ||
41 | TargetColor, d); | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | |||
46 | |||
47 | //! Writes attributes of the object. | ||
48 | //! Implement this to expose the attributes of your scene node animator for | ||
49 | //! scripting languages, editors, debuggers or xml serialization purposes. | ||
50 | void CParticleFadeOutAffector::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const | ||
51 | { | ||
52 | out->addColor("TargetColor", TargetColor); | ||
53 | out->addFloat("FadeOutTime", FadeOutTime); | ||
54 | } | ||
55 | |||
56 | //! Reads attributes of the object. | ||
57 | //! Implement this to set the attributes of your scene node animator for | ||
58 | //! scripting languages, editors, debuggers or xml deserialization purposes. | ||
59 | //! \param startIndex: start index where to start reading attributes. | ||
60 | //! \return: returns last index of an attribute read by this affector | ||
61 | void CParticleFadeOutAffector::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) | ||
62 | { | ||
63 | TargetColor = in->getAttributeAsColor("TargetColor"); | ||
64 | FadeOutTime = in->getAttributeAsFloat("FadeOutTime"); | ||
65 | } | ||
66 | |||
67 | |||
68 | } // end namespace scene | ||
69 | } // end namespace irr | ||
70 | |||