Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

AnimationState Class Reference

#include <CSAnimation.h>


Detailed Description

a phase is a sequence of pictures. Same pictures can occur at different stages during an animation. Example: pictures a1, a2, a3, a4 (pictures actually belonging to animation phases a1, a2, a1, a2, a3, a1, a2, a3, a4 The phases defines "sequences" of pictures during one animation.

the states hold all variable parts needed for printing the animation on screen putting these in a state class, enables us to reuse the memory expensive animation class!

Definition at line 115 of file CSAnimation.h.

Public Member Functions

 AnimationState ()
virtual ~AnimationState ()

Data Fields

float mXPos
 current x position on screen

float mYPos
 current y position on screen

int mSpeedX
 current x speed, pixels per frame

int mSpeedY
 current y speed, pixels per frame

unsigned int mAdjustSpeed
float mAnimationRateCounter
 "speed" of anaimtion

signed int mCurrentPhase
 current "active" phaseNo

unsigned int mCurrentPicture
bool mForward
 in animation sequence going ++ or --

bool mFinished
 if a NOT_REPEATABLE animation,

CSPicturemPicture
CSPicturemDisplayPicture
CSDisplayParams mDisplayParams
 position on screen and in world of the current mDisplaypicture


Constructor & Destructor Documentation

AnimationState::AnimationState  )  [inline]
 

Definition at line 149 of file CSAnimation.h.

References ANIMATION_SPEED, mAdjustSpeed, mAnimationRateCounter, mCurrentPicture, mDisplayParams, mDisplayPicture, mSpeedX, mSpeedY, CSDisplayParams::mXDisplayStart, CSDisplayParams::mXPos, CSDisplayParams::mXWorldStart, CSDisplayParams::mYDisplayStart, CSDisplayParams::mYPos, and CSDisplayParams::mYWorldStart.

00150         {
00151             mXPos = 0;
00152             mYPos = 0;
00153             mSpeedX = ANIMATION_SPEED;
00154             mSpeedY = ANIMATION_SPEED;
00155             mAdjustSpeed = 0;
00156             mAnimationRateCounter = 0;
00157             mCurrentPhase = 0;
00158             mCurrentPicture = 0;
00159             mForward = true;
00160             mFinished = false;
00161             mPicture = 0;
00162             mDisplayPicture = 0;
00163 
00164             mDisplayParams.mXDisplayStart = 0;
00165             mDisplayParams.mYDisplayStart = 0;
00166             mDisplayParams.mXWorldStart = 0;
00167             mDisplayParams.mYWorldStart = 0;
00168             mDisplayParams.mXPos = 0;
00169             mDisplayParams.mYPos = 0;
00170         }

virtual AnimationState::~AnimationState  )  [inline, virtual]
 

Definition at line 171 of file CSAnimation.h.

00171 {}


Field Documentation

float AnimationState::mXPos
 

current x position on screen

Definition at line 118 of file CSAnimation.h.

Referenced by CSAnimation::buildState(), CSTile::getX(), CSAnimation::next(), CSAnimation::resetState(), CSSprite::setPosition(), CSTile::setX(), and CSAnimation::startAnimation().

float AnimationState::mYPos
 

current y position on screen

Definition at line 119 of file CSAnimation.h.

Referenced by CSAnimation::buildState(), CSTile::getY(), CSAnimation::next(), CSAnimation::resetState(), CSSprite::setPosition(), CSTile::setY(), and CSAnimation::startAnimation().

int AnimationState::mSpeedX
 

current x speed, pixels per frame

Definition at line 120 of file CSAnimation.h.

Referenced by CSAnimation::adjustSpeed(), AnimationState(), CSAnimation::next(), CSAnimation::resetSpeed(), CSAnimation::resetState(), and CSAnimation::setSpeedX().

int AnimationState::mSpeedY
 

current y speed, pixels per frame

Definition at line 121 of file CSAnimation.h.

Referenced by CSAnimation::adjustSpeed(), AnimationState(), CSAnimation::next(), CSAnimation::resetSpeed(), CSAnimation::resetState(), and CSAnimation::setSpeedY().

unsigned int AnimationState::mAdjustSpeed
 

Definition at line 122 of file CSAnimation.h.

Referenced by CSAnimation::adjustSpeed(), AnimationState(), and CSAnimation::next().

float AnimationState::mAnimationRateCounter
 

"speed" of anaimtion

Definition at line 123 of file CSAnimation.h.

Referenced by AnimationState(), CSAnimation::buildState(), CSAnimation::next(), CSAnimation::resetState(), CSAnimation::startAnimation(), and CSAnimation::startNextAnimation().

signed int AnimationState::mCurrentPhase
 

current "active" phaseNo

Definition at line 124 of file CSAnimation.h.

Referenced by CSAnimation::buildState(), CSAnimation::next(), CSAnimation::resetState(), CSAnimation::startAnimation(), and CSAnimation::startNextAnimation().

unsigned int AnimationState::mCurrentPicture
 

current active pictureNo, corresponse to < picture selected by active phase

Definition at line 125 of file CSAnimation.h.

Referenced by AnimationState(), CSAnimation::buildState(), CSAnimation::next(), CSAnimation::resetState(), CSAnimation::startAnimation(), and CSAnimation::startNextAnimation().

bool AnimationState::mForward
 

in animation sequence going ++ or --

Definition at line 127 of file CSAnimation.h.

Referenced by CSAnimation::buildState(), CSAnimation::next(), CSAnimation::resetState(), CSAnimation::startAnimation(), and CSAnimation::startNextAnimation().

bool AnimationState::mFinished
 

if a NOT_REPEATABLE animation,

Definition at line 128 of file CSAnimation.h.

Referenced by CSAnimation::buildState(), CSAnimation::next(), CSAnimation::resetState(), CSAnimation::startAnimation(), and CSAnimation::startNextAnimation().

CSPicture* AnimationState::mPicture
 

currenct active CSPicture, corresponse to < picture selected by active phase < this need not be the picture to be displayed < this round, since update and display < are two different methods < the mDisplayPicture will be set during < update to display the picture that belongs to < the "current" frame < at the end of the update method the < the current picture of the state < can differ, because the update can < sets the picture to the NEXT picture < (animation counter reaches 0, next frame < will be selected, but the old frame < should still be displayed) < !NOT TO BE FREED!

Definition at line 129 of file CSAnimation.h.

Referenced by CSAnimation::buildState(), CSSprite::checkCollision(), CSSprite::checkCollisionPixels(), CSAnimation::getScaledAnimation(), CSTileMap::getScaledMap(), CSAnimation::next(), CSAnimation::resetState(), CSAnimation::startAnimation(), and CSAnimation::startNextAnimation().

CSPicture* AnimationState::mDisplayPicture
 

picture that will be displayed when calling display() < !NOT TO BE FREED!

Definition at line 145 of file CSAnimation.h.

Referenced by AnimationState(), CSSprite::checkCollision(), CSSprite::checkCollisionPixels(), CSAnimation::display(), CSSprite::getCollidingTiles(), CSAnimation::next(), and CSAnimation::startAnimation().

CSDisplayParams AnimationState::mDisplayParams
 

position on screen and in world of the current mDisplaypicture

Definition at line 147 of file CSAnimation.h.

Referenced by CSTileMap::addScaledSprites(), AnimationState(), CSSprite::checkCollision(), CSSprite::checkCollisionPixels(), CSAnimation::display(), CSSprite::getCollidingTiles(), CSSprite::getDisplayXLower(), CSSprite::getDisplayYLower(), CSSprite::getXPos(), CSSprite::getYPos(), CSTile::next(), CSSprite::next(), CSAnimation::next(), CSSprite::setDisplayOffset(), CSSprite::setPosition(), CSSprite::setWorldPosition(), and CSAnimation::startAnimation().


Generated on Wed Jul 14 00:43:45 2004 for CSLib by doxygen 1.3.6