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

CTextureFrameAnimation Class Reference

Texture Frame Animation class. More...

#include <TextureFrameAnimation.h>

Inheritance diagram for CTextureFrameAnimation:

CFrameAnimation< tRect > CAnimation CXMLResource CResource CEntity List of all members.

Public Member Functions

int Create (UINT FrameCount, UINT DataCount)
virtual int Animate (double fTimePerFrame)
virtual int Pause (double fPauseTime=INFINITE)
virtual int Resume (double fTimeToWait=0)
virtual int Stop ()
virtual void Destroy ()
virtual int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
void SetTexture (UINT uiFrame, UINT uiTexIndex, CTexture *pTexture=NULL)
void SetFrameRect (UINT uiFrameIndex, tRect &Rect)
CTextureGetTexture ()
virtual bool IsOfType (eEntityType eType)

Protected Member Functions

int SaveFrame (TiXmlNode *pDataNode, UINT uiIndex)

Protected Attributes

CTexture ** m_pTextures

Detailed Description

Texture Frame Animation class.

This class is an implementation of the CFrameAnimation class that uses textures to provide means of animated texture(s).

Definition at line 13 of file TextureFrameAnimation.h.


Member Function Documentation

int CTextureFrameAnimation::Animate double  fTimePerFrame  )  [virtual]
 

Method details:

Parameters:
fTimePerFrame - Amount of time for the frame to wait before advancing to next
Returns:
1 If animation is complete, 0 otherwise

Reimplemented from CFrameAnimation< tRect >.

Definition at line 35 of file TextureFrameAnimation.cpp.

Referenced by CGUIButton::Draw().

int CTextureFrameAnimation::Create UINT  uiFrameCount,
UINT  uiDataCount
[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 from CFrameAnimation< tRect >.

Definition at line 20 of file TextureFrameAnimation.cpp.

References CFrameAnimation< TAnimation >::Create(), and m_pTextures.

Referenced by LoadXML().

void CTextureFrameAnimation::Destroy  )  [virtual]
 

Method details: Clean-up method

Reimplemented from CFrameAnimation< tRect >.

Definition at line 229 of file TextureFrameAnimation.cpp.

References CFrameAnimation< TAnimation >::Destroy().

CTexture * CTextureFrameAnimation::GetTexture  ) 
 

Method details:

Returns:
Pointer to texture for current frame
Definition at line 190 of file TextureFrameAnimation.cpp.

References CFrameAnimation< tRect >::GetFrameIndex(), and m_pTextures.

Referenced by CGUIButton::Draw().

bool CTextureFrameAnimation::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CFrameAnimation< tRect >.

Definition at line 240 of file TextureFrameAnimation.cpp.

References CFrameAnimation< TAnimation >::IsOfType().

int CTextureFrameAnimation::LoadXML TiXmlNode pDataNode,
CString  strFilename
[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 CFrameAnimation< tRect >.

Definition at line 66 of file TextureFrameAnimation.cpp.

References TiXmlElement::Attribute(), Create(), TiXmlNode::FirstChild(), CSingleton< CTextureManager >::GetSingleton(), TiXmlNode::IterateChildren(), CTextureManager::LoadResource(), CFrameAnimation< TAnimation >::LoadXML(), m_pTextures, TiXmlNode::pcValue(), and TiXmlNode::ToElement().

int CTextureFrameAnimation::Pause double  fPauseTime = INFINITE  )  [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 CFrameAnimation< tRect >.

Definition at line 41 of file TextureFrameAnimation.cpp.

int CTextureFrameAnimation::Resume double  fTimeToWait = 0  )  [virtual]
 

Method details:

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

Reimplemented from CFrameAnimation< tRect >.

Definition at line 47 of file TextureFrameAnimation.cpp.

int CTextureFrameAnimation::SaveFrame TiXmlNode pDataNode,
UINT  uiIndex
[protected]
 

Method details:

Parameters:
pDataNode - Pointer to animation XML node
uiIndex - index of the frame to save
Returns:
1 if saved succesfully, 0 otherwise
Definition at line 195 of file TextureFrameAnimation.cpp.

References CEntity::GetName(), m_pTextures, TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

Referenced by SaveXML().

int CTextureFrameAnimation::SaveXML TiXmlNode pDataNode,
CString  strFilename
[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 CFrameAnimation< tRect >.

Definition at line 142 of file TextureFrameAnimation.cpp.

References CFrameAnimation< tRect >::GetLoopCount(), CEntity::GetName(), TiXmlNode::InsertEndChild(), TiXmlDocument::SaveFile(), SaveFrame(), TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

void CTextureFrameAnimation::SetFrameRect UINT  uiFrameIndex,
tRect &  Rect
 

Method details:

Parameters:
uiFrameIndex - Index of the frame
Rect - New frame rectangle
Definition at line 60 of file TextureFrameAnimation.cpp.

void CTextureFrameAnimation::SetTexture UINT  uiFrame,
UINT  uiTexIndex,
CTexture pTexture = NULL
 

Method details:

Parameters:
uiFrame - Index of the frame to set texture for
uiTexIndex - Index of data that will contain pointer to the texture
pTexture - Pointer to texture in texture manager
Definition at line 215 of file TextureFrameAnimation.cpp.

References m_pTextures.

int CTextureFrameAnimation::Stop  )  [virtual]
 

Method details:

Returns:
1 If animation has been stopped, 0 otherwise

Reimplemented from CFrameAnimation< tRect >.

Definition at line 53 of file TextureFrameAnimation.cpp.


Member Data Documentation

CTexture** CTextureFrameAnimation::m_pTextures [protected]
 

An array of pointers to textures Definition at line 87 of file TextureFrameAnimation.h.

Referenced by Create(), GetTexture(), LoadXML(), SaveFrame(), and SetTexture().


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