StelFader.hpp   StelFader.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _STELFADER_HPP_ #ifndef _STELFADER_HPP_
#define _STELFADER_HPP_ #define _STELFADER_HPP_
#include "config.h"
#include <QtGlobal> #include <QtGlobal>
//! @class StelFader //! @class StelFader
//! Manages a (usually smooth) transition between two states (typically ON/ OFF) in function of a counter //! Manages a (usually smooth) transition between two states (typically ON/ OFF) in function of a counter
//! It used for various purpose like smooth transitions between //! It used for various purpose like smooth transitions between
class StelFader class StelFader
{ {
public: public:
// Create and initialise // Create and initialise
StelFader(bool initialState, float minimumValue=0.f, float maximumVa lue=1.f) : state(initialState), minValue(minimumValue), maxValue(maximumVal ue) {;} StelFader(bool initialState, float minimumValue=0.f, float maximumVa lue=1.f) : state(initialState), minValue(minimumValue), maxValue(maximumVal ue) {;}
skipping to change at line 83 skipping to change at line 85
//! @class LinearFader //! @class LinearFader
//! Implementation of StelFader which implements a linear transition. //! Implementation of StelFader which implements a linear transition.
//! Please note that state is updated instantaneously, so if you need to dr aw something fading in //! Please note that state is updated instantaneously, so if you need to dr aw something fading in
//! and out, you need to check the interstate value (!=0) to know to draw w hen on AND during transitions. //! and out, you need to check the interstate value (!=0) to know to draw w hen on AND during transitions.
class LinearFader : public StelFader class LinearFader : public StelFader
{ {
public: public:
// Create and initialise to default // Create and initialise to default
LinearFader(int _duration=1000, float minimumValue=0.f, float maximu mValue=1.f, bool initialState=false) LinearFader(int _duration=1000, float minimumValue=0.f, float maximu mValue=1.f, bool initialState=false)
: StelFader(initialState, minimumValue, maximumValue) : StelFader(initialState, minimumValue, maximumValue)
, startValue(0.)
, targetValue(0.)
, counter(0)
{ {
isTransiting = false; isTransiting = false;
duration = _duration; duration = _duration;
interstate = state ? maxValue : minValue; interstate = state ? maxValue : minValue;
} }
~LinearFader() {;} ~LinearFader() {;}
// Increments the internal counter of deltaTime ticks // Increments the internal counter of deltaTime ticks
void update(int deltaTicks) void update(int deltaTicks)
 End of changes. 2 change blocks. 
0 lines changed or deleted 5 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/