EPOC::Animation Class Reference

#include <Animation.h>

Inheritance diagram for EPOC::Animation:

Inheritance graph
[legend]
Collaboration diagram for EPOC::Animation:

Collaboration graph
[legend]

List of all members.

Public Types

enum  ANIMATION_TYPE {
  kANIMATION_TYPE_UNKNOWN, kANIMATION_TYPE_NORMAL, kANIMATION_TYPE_REVERSE, kANIMATION_TYPE_LOOP,
  kANIMATION_TYPE_PINGPONG, kANIMATION_TYPE_MANUAL
}
enum  ANIMATION_FRAMEMODE { kANIMATION_FRAMEMODE_UNKNOWN, kANIMATION_FRAMEMODE_NORMAL, kANIMATION_FRAMEMODE_LIMITS }

Public Member Functions

 Animation ()
virtual ~Animation ()
virtual bool Update (float fTimeDelta)
virtual void Reset ()
void SetLoops (unsigned int nLoops)
unsigned int GetLoops ()
void SetFrameRate (float fFrameRate)
float GetFrameRate ()
void SetAnimationType (ANIMATION_TYPE nAnimationType)
ANIMATION_TYPE GetAnimationType ()
void SetFrameMode (ANIMATION_FRAMEMODE nFrameMode)
ANIMATION_FRAMEMODE GetFrameMode ()
void SetRemoveWhenDone (bool bRemoveStatus)
bool IsRemoveWhenDoneEnabled ()
bool IsDone ()
void SetFrameLimitStart (int nFrame)
int GetFrameLimitStart ()
void SetFrameLimitEnd (unsigned int nFrame)
unsigned int GetFrameLimitEnd ()

Protected Member Functions

void StepFrame ()
bool CheckFrame ()

Protected Attributes

bool m_bRemoveDone
 Flag telling wether the animation should return from false when the end is reached or not.
bool m_bDone
 Flag telling wether the animations has reached the end or not.
bool m_bReverse
 Flag telling if the animation is animating in reverse or not.
unsigned int m_nLoops
 The number of times to loop the animation.
unsigned int m_nFrameLimitStart
 The start frame of the frame limit.
unsigned int m_nFrameLimitEnd
 The end frame of the frame limit.
float m_fFrameTimer
 Counter used to calculate when to present the next frame.
float m_fFrameRate
 The frame rate of the animation.
ANIMATION_TYPE m_nAnimationType
 The animation type used by the animation.
ANIMATION_FRAMEMODE m_nFrameMode
 The frame mode used by the animation.


Detailed Description

Animation class This class add the functionality to use an image with many frames as an animation

Member Enumeration Documentation

enum EPOC::Animation::ANIMATION_TYPE

Enumeration of animation types

See also:
GetAnimationType()

SetAnimationType()

Enumerator:
kANIMATION_TYPE_UNKNOWN 
kANIMATION_TYPE_NORMAL 
kANIMATION_TYPE_REVERSE 
kANIMATION_TYPE_LOOP 
kANIMATION_TYPE_PINGPONG 
kANIMATION_TYPE_MANUAL 

enum EPOC::Animation::ANIMATION_FRAMEMODE

Enumeration of animation frame modes

See also:
GetFrameMode()

SetFrameMode()

Enumerator:
kANIMATION_FRAMEMODE_UNKNOWN 
kANIMATION_FRAMEMODE_NORMAL 
kANIMATION_FRAMEMODE_LIMITS 


Constructor & Destructor Documentation

Animation::Animation (  ) 

Contructor Resets all members to the default values

Animation::~Animation (  )  [virtual]

Destructor


Member Function Documentation

bool Animation::Update ( float  fTimeDelta  )  [virtual]

Updates the animation

Remarks:
This function is called once per frame internally by EpGraphicsManager if the animation is create from it.
Parameters:
fTimeDelta the time that has passed since last update, measured in milliseconds
Returns:
true if the update succeeded and false if it didn't

Reimplemented from EPOC::BaseObject.

void Animation::Reset (  )  [virtual]

Resets the animation and it's data

void EPOC::Animation::SetLoops ( unsigned int  nLoops  )  [inline]

Sets the number of times to loop the animation

Parameters:
nLoops The number of times to loop the animation. 0 = Play animation once, 1 or greater = Loop animation N times
See also:
GetLoops()

unsigned int EPOC::Animation::GetLoops (  )  [inline]

Returns the number of times to loop the animation

Returns:
The number of times to loop the animation
See also:
SetLoops()

void EPOC::Animation::SetFrameRate ( float  fFrameRate  )  [inline]

Sets the framerate of the animation. The frame rate is described in frames per second

Parameters:
fFrameRate The number of frames per second of the animation
See also:
GetFrameRate()

float EPOC::Animation::GetFrameRate (  )  [inline]

Returns the framerate of the animation. The frame rate is described in frames per second

Parameters:
fFrameRate The number of frames per second of the animation
See also:
GetFrameRate()

void EPOC::Animation::SetAnimationType ( ANIMATION_TYPE  nAnimationType  )  [inline]

Sets the type of the animation

Parameters:
m_nAnimationType The animation type to be used by the animation
See also:
GetAnimationType()

ANIMATION_TYPE

ANIMATION_TYPE EPOC::Animation::GetAnimationType (  )  [inline]

Returns the type of the animation

Returns:
The animation type used by the animation
See also:
GetAnimationType()

ANIMATION_TYPE

void EPOC::Animation::SetFrameMode ( ANIMATION_FRAMEMODE  nFrameMode  )  [inline]

Sets the frame mode used by the animation

Remarks:
Frame modes is used when an animation contains several animations to limit between wich frames the animation is animated.
Parameters:
nFrameMode The frame mode to be used by the animation
See also:
GetAnimationType()

ANIMATION_FRAMEMODE

ANIMATION_FRAMEMODE EPOC::Animation::GetFrameMode (  )  [inline]

Returns the frame mode to be used by the animation

Parameters:
nMode The frame mode to be used by the animation
See also:
SetFrameMode()

ANIMATION_FRAMEMODE

void EPOC::Animation::SetRemoveWhenDone ( bool  bRemoveStatus  )  [inline]

Sets a flag that tells the animation to return false from the update method when the animation has reched the end. When this happens EPOC will delete the animation.

Remarks:
This flag should be used carefully. You should only use it for the fire-and-forget type of animations i.e. effects like explosions and so forth.
Parameters:
bRemoveStatus True or false
See also:
IsRemoveWhenDoneEnabled()

bool EPOC::Animation::IsRemoveWhenDoneEnabled (  )  [inline]

Returns wether the animation is flagged to be removed at the end of the animation or not

Returns:
True or false
See also:
SetRemoveWhenDone()

bool EPOC::Animation::IsDone (  )  [inline]

Returns wether the animation has reached the end of the animation

Returns:
True or false

void EPOC::Animation::SetFrameLimitStart ( int  nFrame  )  [inline]

Sets the start frame of the frame limit

See also:
SetFrameMode()

GetFrameMode()

EP_ANIMATION_FRAMEMODE

int EPOC::Animation::GetFrameLimitStart (  )  [inline]

Returns the start frame of the frame limit

See also:
SetFrameMode()

GetFrameMode()

EP_ANIMATION_FRAMEMODE

Returns:
The start frame of the frame limits

void EPOC::Animation::SetFrameLimitEnd ( unsigned int  nFrame  )  [inline]

Sets the end frame of the frame limit

See also:
SetFrameMode()

GetFrameMode()

EP_ANIMATION_FRAMEMODE

unsigned int EPOC::Animation::GetFrameLimitEnd (  )  [inline]

Returns the end frame of the frame limit

See also:
SetFrameMode()

GetFrameMode()

EP_ANIMATION_FRAMEMODE

Returns:
The end frame of the frame limits

void Animation::StepFrame (  )  [protected]

Updates the current frame counter. This is done different based on the animation type

bool Animation::CheckFrame (  )  [protected]

Updates and limits the frame counter and checks wether the animation has finished (inluding loops)

Returns:
True if animation is finished, false if it hasn't


Member Data Documentation

bool EPOC::Animation::m_bRemoveDone [protected]

Flag telling wether the animation should return from false when the end is reached or not.

bool EPOC::Animation::m_bDone [protected]

Flag telling wether the animations has reached the end or not.

bool EPOC::Animation::m_bReverse [protected]

Flag telling if the animation is animating in reverse or not.

unsigned int EPOC::Animation::m_nLoops [protected]

The number of times to loop the animation.

unsigned int EPOC::Animation::m_nFrameLimitStart [protected]

The start frame of the frame limit.

unsigned int EPOC::Animation::m_nFrameLimitEnd [protected]

The end frame of the frame limit.

float EPOC::Animation::m_fFrameTimer [protected]

Counter used to calculate when to present the next frame.

float EPOC::Animation::m_fFrameRate [protected]

The frame rate of the animation.

ANIMATION_TYPE EPOC::Animation::m_nAnimationType [protected]

The animation type used by the animation.

ANIMATION_FRAMEMODE EPOC::Animation::m_nFrameMode [protected]

The frame mode used by the animation.


The documentation for this class was generated from the following files:
Generated on Tue Feb 12 08:26:00 2008 for EPOC by  doxygen 1.5.4