summaryrefslogtreecommitdiff
path: root/src/particle
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-06 21:03:19 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-06 21:03:19 +0300
commitf970dbd2e2c2548114ef86dc7d6b3046791c6612 (patch)
tree340ee8d7fe2aefb5278b3b821764628bfa73a7de /src/particle
parent04536a4cbb0908cf7d732c1db29a7dd1f5f32f2a (diff)
downloadplus-f970dbd2e2c2548114ef86dc7d6b3046791c6612.tar.gz
plus-f970dbd2e2c2548114ef86dc7d6b3046791c6612.tar.bz2
plus-f970dbd2e2c2548114ef86dc7d6b3046791c6612.tar.xz
plus-f970dbd2e2c2548114ef86dc7d6b3046791c6612.zip
Add noexcept into particle.
Diffstat (limited to 'src/particle')
-rw-r--r--src/particle/particle.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/particle/particle.h b/src/particle/particle.h
index 537719f6b..9c2cb1a09 100644
--- a/src/particle/particle.h
+++ b/src/particle/particle.h
@@ -160,58 +160,60 @@ class Particle notfinal : public Actor
/**
* Sets the time in game ticks until the particle is destroyed.
*/
- void setLifetime(const int lifetime) restrict2
+ void setLifetime(const int lifetime) restrict2 noexcept
{ mLifetimeLeft = lifetime; mLifetimePast = 0; }
/**
* Sets the age of the pixel in game ticks where the particle has
* faded in completely.
*/
- void setFadeOut(const int fadeOut) restrict2
+ void setFadeOut(const int fadeOut) restrict2 noexcept
{ mFadeOut = fadeOut; }
/**
* Sets the remaining particle lifetime where the particle starts to
* fade out.
*/
- void setFadeIn(const int fadeIn) restrict2
+ void setFadeIn(const int fadeIn) restrict2 noexcept
{ mFadeIn = fadeIn; }
/**
* Sets the current velocity in 3 dimensional space.
*/
- void setVelocity(const float x, const float y, const float z) restrict2
+ void setVelocity(const float x,
+ const float y,
+ const float z) restrict2 noexcept
{ mVelocity.x = x; mVelocity.y = y; mVelocity.z = z; }
/**
* Sets the downward acceleration.
*/
- void setGravity(const float gravity) restrict2
+ void setGravity(const float gravity) restrict2 noexcept
{ mGravity = gravity; }
/**
* Sets the ammount of random vector changes
*/
- void setRandomness(const int r) restrict2
+ void setRandomness(const int r) restrict2 noexcept
{ mRandomness = r; }
/**
* Sets the ammount of velocity particles retain after
* hitting the ground.
*/
- void setBounce(const float bouncieness) restrict2
+ void setBounce(const float bouncieness) restrict2 noexcept
{ mBounce = bouncieness; }
/**
* Sets the flag if the particle is supposed to be moved by its parent
*/
- void setFollow(const bool follow) restrict2
+ void setFollow(const bool follow) restrict2 noexcept
{ mFollow = follow; }
/**
* Gets the flag if the particle is supposed to be moved by its parent
*/
- bool doesFollow() const restrict2 A_WARN_UNUSED
+ bool doesFollow() const restrict2 noexcept A_WARN_UNUSED
{ return mFollow; }
/**
@@ -220,7 +222,7 @@ class Particle notfinal : public Actor
*/
void setDestination(Particle *restrict const target,
const float accel,
- const float moment) restrict2
+ const float moment) restrict2 noexcept
{ mTarget = target; mAcceleration = accel; mMomentum = moment; }
/**
@@ -237,10 +239,10 @@ class Particle notfinal : public Actor
*/
void adjustEmitterSize(const int w, const int h) restrict2;
- void setAllowSizeAdjust(const bool adjust) restrict2
+ void setAllowSizeAdjust(const bool adjust) restrict2 noexcept
{ mAllowSizeAdjust = adjust; }
- bool isAlive() const restrict2 A_WARN_UNUSED
+ bool isAlive() const restrict2 noexcept A_WARN_UNUSED
{ return mAlive == AliveStatus::ALIVE; }
void prepareToDie() restrict2;
@@ -248,20 +250,20 @@ class Particle notfinal : public Actor
/**
* Determines whether the particle and its children are all dead
*/
- bool isExtinct() const restrict2 A_WARN_UNUSED
+ bool isExtinct() const restrict2 noexcept A_WARN_UNUSED
{ return !isAlive() && mChildParticles.empty(); }
/**
* Manually marks the particle for deletion.
*/
- void kill() restrict2
+ void kill() restrict2 noexcept
{ mAlive = AliveStatus::DEAD_OTHER; mAutoDelete = true; }
/**
* After calling this function the particle will only request
* deletion when kill() is called
*/
- void disableAutoDelete() restrict2
+ void disableAutoDelete() restrict2 noexcept
{ mAutoDelete = false; }
/** We consider particles (at least for now) to be one layer-sprites */