#include <CSAnimation.h>
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, | |
CSPicture * | mPicture |
CSPicture * | mDisplayPicture |
CSDisplayParams | mDisplayParams |
position on screen and in world of the current mDisplaypicture |
|
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 } |
|
Definition at line 171 of file CSAnimation.h.
00171 {} |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
Definition at line 122 of file CSAnimation.h. Referenced by CSAnimation::adjustSpeed(), AnimationState(), and CSAnimation::next(). |
|
"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(). |
|
current "active" phaseNo
Definition at line 124 of file CSAnimation.h. Referenced by CSAnimation::buildState(), CSAnimation::next(), CSAnimation::resetState(), CSAnimation::startAnimation(), and CSAnimation::startNextAnimation(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |