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