From 3925d9c41709dece19fe60c0e4bb111247f1886e Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 26 Oct 2008 15:41:57 +0000 Subject: Merged revisions 4302,4338,4360-4362,4526,4528,4534,4547 via svnmerge from https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/branches/0.0 ........ r4302 | crush_tmw | 2008-05-28 18:51:26 +0200 (Wed, 28 May 2008) | 1 line Changed the way particle emitter skip is handled to make linear and circular emitters work with particleEmitterSkip enabled. ........ r4338 | crush_tmw | 2008-06-05 20:41:39 +0200 (Thu, 05 Jun 2008) | 1 line Lowered default particle detail level. ........ r4360 | crush_tmw | 2008-06-23 16:44:20 +0200 (Mon, 23 Jun 2008) | 1 line Implemented "alpha" particle property. ........ r4361 | crush_tmw | 2008-06-23 22:20:05 +0200 (Mon, 23 Jun 2008) | 1 line Forgot changelog with last commit. ........ r4362 | crush_tmw | 2008-06-24 14:29:33 +0200 (Tue, 24 Jun 2008) | 1 line Added particle property "follow-parent" which makes the particle move when its parent particle is moved. ........ r4526 | crush_tmw | 2008-08-24 20:52:00 +0200 (Sun, 24 Aug 2008) | 1 line Added new particle emitter property "output-pause" which allows to define a fixed (or random) interval between two outputs. ........ r4528 | crush_tmw | 2008-08-24 20:58:39 +0200 (Sun, 24 Aug 2008) | 1 line fix for an error in the last commit ........ r4534 | b_lindeijer | 2008-08-27 20:48:13 +0200 (Wed, 27 Aug 2008) | 3 lines Renamed "randomnes" to "randomness", so that it won't show up as part of Fate's patch. ........ r4547 | crush_tmw | 2008-08-29 00:44:43 +0200 (Fri, 29 Aug 2008) | 1 line Added output-pause to copy constructor of particle emitters. ........ --- src/particle.h | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'src/particle.h') diff --git a/src/particle.h b/src/particle.h index 1859fe62..7b46a641 100644 --- a/src/particle.h +++ b/src/particle.h @@ -162,6 +162,10 @@ class Particle : public Sprite moveBy(float x, float y, float z) { mPos.x += x; mPos.y += y; mPos.z += z; } + void + moveBy (Vector change) + { mPos += change; } + /** * Sets the time in game ticks until the particle is destroyed. */ @@ -185,6 +189,13 @@ class Particle : public Sprite setFadeIn(int fadeIn) { mFadeIn = fadeIn; } + /** + * Sets the alpha value of the particle + */ + void + setAlpha(float alpha) + { mAlpha = alpha; } + /** * Sets the sprite iterator of the particle on the current map to make * it easier to remove the particle from the map when it is destroyed. @@ -218,8 +229,8 @@ class Particle : public Sprite * Sets the ammount of random vector changes */ void - setRandomnes(int r) - { mRandomnes = r; } + setRandomness(int r) + { mRandomness = r; } /** * Sets the ammount of velocity particles retain after @@ -229,6 +240,20 @@ class Particle : public Sprite setBounce(float bouncieness) { mBounce = bouncieness; } + /** + * Sets the flag if the particle is supposed to be moved by its parent + */ + void + setFollow(bool follow) + { mFollow = follow; } + + /** + * Gets the flag if the particle is supposed to be moved by its parent + */ + bool + doesFollow() + { return mFollow; } + /** * Makes the particle move toward another particle with a * given acceleration and momentum @@ -267,6 +292,7 @@ class Particle : public Sprite int mLifetimePast; /**< Age of the particle in game ticks*/ int mFadeOut; /**< Lifetime in game ticks left where fading out begins*/ int mFadeIn; /**< Age in game ticks where fading in is finished*/ + float mAlpha; /**< Opacity of the graphical representation of the particle */ private: // generic properties @@ -279,8 +305,9 @@ class Particle : public Sprite // dynamic particle Vector mVelocity; /**< Speed in pixels per game-tick. */ float mGravity; /**< Downward acceleration in pixels per game-tick. */ - int mRandomnes; /**< Ammount of random vector change */ + int mRandomness; /**< Ammount of random vector change */ float mBounce; /**< How much the particle bounces off when hitting the ground */ + bool mFollow; /**< is this particle moved when its parent particle moves? */ // follow-point particles Particle *mTarget; /**< The particle that attracts this particle*/ -- cgit v1.2.3-60-g2f50