Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

CFrameAnimation< TAnimation > Class Template Reference

Frame Animation class. More...

#include <FrameAnimation.h>

Inheritance diagram for CFrameAnimation< TAnimation >:

CAnimation CXMLResource CResource CEntity List of all members.

Public Member Functions

virtual int Create (UINT uiFrameCount, UINT uiDataCount)
TAnimation * GetFrame (UINT uiFrameIndex)
void SetLooping (bool bLooping)
bool GetLooping ()
void SetLoopCount (UINT uiLoopCount)
UINT GetFrameCount ()
UINT GetLoopCount ()
UINT GetLoop ()
TAnimation * GetCurrentFrame ()
UINT GetFrameIndex ()
virtual void SetFrameTime (double fTime)
virtual int Animate (double fTimePerFrame=-1)
virtual int Pause (double fPauseTime=INFINITE)
virtual int Resume (double fTimeToWait=0)
virtual int Stop ()
virtual int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
virtual void Destroy ()
virtual bool IsOfType (eEntityType eType)

Protected Attributes

UINT * m_uipDataIndex
UINT m_uiFrameCount
UINT m_uiLoopsCount
UINT m_uiCurrentLoop
UINT m_uiCurrentFrame
double m_fLastTime
bool m_bLoop
TAnimation ** m_pAnimationData
UINT m_uiDataCount
bool m_bAnimationComplete
bool m_bPaused
CTimer m_Timer

Detailed Description

template<class TAnimation>
class CFrameAnimation< TAnimation >

Frame Animation class.

This class provides an templated interface for the frame animation.

Definition at line 12 of file FrameAnimation.h.


Member Function Documentation

template<class TAnimation>
virtual int CFrameAnimation< TAnimation >::Animate double  fTimePerFrame = -1  )  [inline, virtual]
 

Method details:

Parameters:
fTimePerFrame - Time to use per frame
Returns:
1 if animation is still running, 0 otherwise

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 154 of file FrameAnimation.h.

template<class TAnimation>
virtual int CFrameAnimation< TAnimation >::Create UINT  uiFrameCount,
UINT  uiDataCount
[inline, virtual]
 

Method details:

Parameters:
uiFrameCount - Number of frames for the animation
uiDataCount - Number of items for the animation
Returns:
1 if created succesfully, 0 otherwise

Reimplemented in CTextureFrameAnimation.

Definition at line 43 of file FrameAnimation.h.

Referenced by CTextureFrameAnimation::Create().

template<class TAnimation>
virtual void CFrameAnimation< TAnimation >::Destroy  )  [inline, virtual]
 

Method details: Clean-up method

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 241 of file FrameAnimation.h.

Referenced by CTextureFrameAnimation::Destroy().

template<class TAnimation>
TAnimation* CFrameAnimation< TAnimation >::GetCurrentFrame  )  [inline]
 

Method details:

Returns:
Pointer to current frame
Definition at line 128 of file FrameAnimation.h.

Referenced by CGUIButton::Draw().

template<class TAnimation>
TAnimation* CFrameAnimation< TAnimation >::GetFrame UINT  uiFrameIndex  )  [inline]
 

Method details:

Parameters:
uiFrameIndex - Frame index to return frame by
Returns:
Pointer to templated animation
Definition at line 69 of file FrameAnimation.h.

Referenced by CFrameAnimation< tRect >::GetCurrentFrame().

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::GetFrameCount  )  [inline]
 

Method details:

Returns:
Number of frames in the animation
Definition at line 104 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::GetFrameIndex  )  [inline]
 

Method details:

Returns:
Index of current frame
Definition at line 136 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::GetLoop  )  [inline]
 

Method details:

Returns:
Current running loop index
Definition at line 120 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::GetLoopCount  )  [inline]
 

Method details:

Returns:
Number of loops in the animation
Definition at line 112 of file FrameAnimation.h.

template<class TAnimation>
bool CFrameAnimation< TAnimation >::GetLooping  )  [inline]
 

Method details:

Returns:
True if looping is enabled, false otherwise
Definition at line 88 of file FrameAnimation.h.

template<class TAnimation>
virtual bool CFrameAnimation< TAnimation >::IsOfType eEntityType  eType  )  [inline, virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 249 of file FrameAnimation.h.

Referenced by CTextureFrameAnimation::IsOfType().

template<class TAnimation>
virtual int CFrameAnimation< TAnimation >::LoadXML TiXmlNode pDataNode,
CString  strFilename
[inline, virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that holds data for the animation
strFilename - String containing filename where the data for the animation is stored

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 227 of file FrameAnimation.h.

Referenced by CTextureFrameAnimation::LoadXML().

template<class TAnimation>
virtual int CFrameAnimation< TAnimation >::Pause double  fPauseTime = INFINITE  )  [inline, virtual]
 

Method details:

Parameters:
fPauseTime - Pause for infinite amount of time or one specified by user
Returns:
1 If animation is paused, 0 otherwise

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 196 of file FrameAnimation.h.

template<class TAnimation>
virtual int CFrameAnimation< TAnimation >::Resume double  fTimeToWait = 0  )  [inline, virtual]
 

Method details:

Parameters:
fTimeToWait - Time to wait before resuming the animation
Returns:
1 If it is still waiting, 0 otherwise

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 206 of file FrameAnimation.h.

template<class TAnimation>
virtual int CFrameAnimation< TAnimation >::SaveXML TiXmlNode pDataNode,
CString  strFilename
[inline, virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that will be the parent hold the data for this animation
strFilename - String containing filename where the data for the animation is stored

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 236 of file FrameAnimation.h.

template<class TAnimation>
virtual void CFrameAnimation< TAnimation >::SetFrameTime double  fTime  )  [inline, virtual]
 

Method details:

Parameters:
fTime - time for current frame
Definition at line 144 of file FrameAnimation.h.

template<class TAnimation>
void CFrameAnimation< TAnimation >::SetLoopCount UINT  uiLoopCount  )  [inline]
 

Method details:

Parameters:
uiLoopCount - Number of loops to repeat the animation
Definition at line 96 of file FrameAnimation.h.

template<class TAnimation>
void CFrameAnimation< TAnimation >::SetLooping bool  bLooping  )  [inline]
 

Method details:

Parameters:
bLooping - Turn on looping for the animation
Definition at line 80 of file FrameAnimation.h.

template<class TAnimation>
virtual int CFrameAnimation< TAnimation >::Stop  )  [inline, virtual]
 

Method details:

Returns:
1 If animation has been stopped, 0 otherwise

Reimplemented from CAnimation.

Reimplemented in CTextureFrameAnimation.

Definition at line 215 of file FrameAnimation.h.


Member Data Documentation

template<class TAnimation>
bool CFrameAnimation< TAnimation >::m_bAnimationComplete [protected]
 

This is a variable that indicates whether an animation has been completed. Definition at line 269 of file FrameAnimation.h.

template<class TAnimation>
bool CFrameAnimation< TAnimation >::m_bLoop [protected]
 

This variable stores the boolean value that determines if it has to loop thru the animation. Definition at line 266 of file FrameAnimation.h.

template<class TAnimation>
bool CFrameAnimation< TAnimation >::m_bPaused [protected]
 

The animation is paused when it is set to true Definition at line 270 of file FrameAnimation.h.

template<class TAnimation>
double CFrameAnimation< TAnimation >::m_fLastTime [protected]
 

The last time the animation has been called successfully. Definition at line 264 of file FrameAnimation.h.

template<class TAnimation>
TAnimation** CFrameAnimation< TAnimation >::m_pAnimationData [protected]
 

These variables (n) store the data pointers used in each frame Definition at line 267 of file FrameAnimation.h.

template<class TAnimation>
CTimer CFrameAnimation< TAnimation >::m_Timer [protected]
 

A local timer Definition at line 272 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::m_uiCurrentFrame [protected]
 

Current frame value for the animation. Definition at line 263 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::m_uiCurrentLoop [protected]
 

Current loop index. Definition at line 262 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::m_uiDataCount [protected]
 

This variable stores a number of data entries from m_piDataIndices Definition at line 268 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::m_uiFrameCount [protected]
 

Number of frames in this animation. Definition at line 260 of file FrameAnimation.h.

template<class TAnimation>
UINT CFrameAnimation< TAnimation >::m_uiLoopsCount [protected]
 

Number of loops this animation has to run thru. Definition at line 261 of file FrameAnimation.h.

template<class TAnimation>
UINT* CFrameAnimation< TAnimation >::m_uipDataIndex [protected]
 

A list of data indices for each frame Definition at line 259 of file FrameAnimation.h.


The documentation for this class was generated from the following file:
Generated on Sun Jul 17 21:34:29 2005 for OpenGL GUI by doxygen 1.3.8