Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
Anim2D Class Reference

#include <Anim2D.h>

Inherits MemoryPoolObject, and Snapshot.

Public Member Functions

 Anim2D (Anim2DTemplate *animTemplate, Anim2DCollection *collectionSystem)
 
UnsignedShort getCurrentFrame (void) const
 get our current frame #
 
void setCurrentFrame (UnsignedShort frame)
 set the current frame #
 
void randomizeCurrentFrame (void)
 randomize the current frame #
 
void reset (void)
 reset the current frame to the "start"
 
void setStatus (UnsignedByte statusBits)
 set status bit(s)
 
void clearStatus (UnsignedByte statusBits)
 clear status bit(s)
 
UnsignedByte getStatus (void) const
 return status bits(s)
 
void setAlpha (Real alpha)
 set alpha value
 
Real getAlpha (void) const
 return the current alpha value
 
void setMinFrame (UnsignedShort frame)
 
void setMaxFrame (UnsignedShort frame)
 
UnsignedInt getCurrentFrameWidth (void) const
 return natural width of image in the current frame
 
UnsignedInt getCurrentFrameHeight (void) const
 return natural height of image in the current frame
 
const Anim2DTemplategetAnimTemplate (void) const
 return our template
 
void draw (Int x, Int y)
 draw iamge at location using natural width/height
 
void draw (Int x, Int y, Int width, Int height)
 draw image at location using forced width/height
 
- Public Member Functions inherited from MemoryPoolObject
void deleteInstance ()
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 run the "light" crc check on this data structure
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
void tryNextFrame (void)
 we've just drawn ... try to update our frame if necessary
 
- Protected Member Functions inherited from MemoryPoolObject
virtual ~MemoryPoolObject ()
 
void * operator new (size_t s)
 
void operator delete (void *p)
 
virtual MemoryPoolgetObjectMemoryPool ()=0
 

Protected Attributes

UnsignedShort m_currentFrame
 current frame of our animation
 
UnsignedInt m_lastUpdateFrame
 last frame we updated on
 
Anim2DTemplatem_template
 pointer back to the template that defines this animation
 
UnsignedByte m_status
 status bits (see Anim2DStatus)
 
UnsignedShort m_minFrame
 min animation frame used inclusively.
 
UnsignedShort m_maxFrame
 max animation frame used inclusively.
 
UnsignedInt m_framesBetweenUpdates
 duration between each frame.
 
Real m_alpha
 
Anim2DCollectionm_collectionSystem
 system collection (if any) we're registered with
 
Anim2Dm_collectionSystemNext
 system instance tracking list
 
Anim2Dm_collectionSystemPrev
 system instance tracking list
 

Friends

class Anim2DCollection
 

Detailed Description

Definition at line 133 of file Anim2D.h.

Constructor & Destructor Documentation

◆ Anim2D()

Anim2D::Anim2D ( Anim2DTemplate * animTemplate,
Anim2DCollection * collectionSystem )

Definition at line 303 of file Anim2D.cpp.

Member Function Documentation

◆ clearStatus()

void Anim2D::clearStatus ( UnsignedByte statusBits)

clear status bit(s)

Clear status bit

Definition at line 587 of file Anim2D.cpp.

◆ crc()

virtual void Anim2D::crc ( Xfer * xfer)
inlineprotectedvirtual

run the "light" crc check on this data structure

Implements Snapshot.

Definition at line 171 of file Anim2D.h.

◆ draw() [1/2]

void Anim2D::draw ( Int x,
Int y )

draw iamge at location using natural width/height

Draw an Anim2D using the natural width and height of the image data

Definition at line 626 of file Anim2D.cpp.

◆ draw() [2/2]

void Anim2D::draw ( Int x,
Int y,
Int width,
Int height )

draw image at location using forced width/height

Drawing an Anim2D using a forced width and height

Definition at line 656 of file Anim2D.cpp.

◆ getAlpha()

Real Anim2D::getAlpha ( void ) const
inline

return the current alpha value

Definition at line 154 of file Anim2D.h.

◆ getAnimTemplate()

const Anim2DTemplate * Anim2D::getAnimTemplate ( void ) const
inline

return our template

Definition at line 163 of file Anim2D.h.

◆ getCurrentFrame()

UnsignedShort Anim2D::getCurrentFrame ( void ) const
inline

get our current frame #

Definition at line 146 of file Anim2D.h.

◆ getCurrentFrameHeight()

UnsignedInt Anim2D::getCurrentFrameHeight ( void ) const

return natural height of image in the current frame

Return the "natural" height of the image for our current frame

Definition at line 612 of file Anim2D.cpp.

◆ getCurrentFrameWidth()

UnsignedInt Anim2D::getCurrentFrameWidth ( void ) const

return natural width of image in the current frame

Return the "natural" width of the image for our current frame

Definition at line 598 of file Anim2D.cpp.

◆ getStatus()

UnsignedByte Anim2D::getStatus ( void ) const
inline

return status bits(s)

Definition at line 152 of file Anim2D.h.

◆ loadPostProcess()

virtual void Anim2D::loadPostProcess ( void )
inlineprotectedvirtual

post process phase for loading save games. All save systems have their xfer run using XferLoad mode, and then all systems each have their post process run

Implements Snapshot.

Definition at line 173 of file Anim2D.h.

◆ randomizeCurrentFrame()

void Anim2D::randomizeCurrentFrame ( void )

randomize the current frame #

Randomize the current frame

Definition at line 390 of file Anim2D.cpp.

◆ reset()

void Anim2D::reset ( void )

reset the current frame to the "start"

Reset this animation instance to the "start" of the animation

Definition at line 404 of file Anim2D.cpp.

◆ setAlpha()

void Anim2D::setAlpha ( Real alpha)
inline

set alpha value

Definition at line 153 of file Anim2D.h.

◆ setCurrentFrame()

void Anim2D::setCurrentFrame ( UnsignedShort frame)

set the current frame #

Set the current animation frame

Definition at line 363 of file Anim2D.cpp.

◆ setMaxFrame()

void Anim2D::setMaxFrame ( UnsignedShort frame)
inline

Definition at line 158 of file Anim2D.h.

◆ setMinFrame()

void Anim2D::setMinFrame ( UnsignedShort frame)
inline

Definition at line 157 of file Anim2D.h.

◆ setStatus()

void Anim2D::setStatus ( UnsignedByte statusBits)

set status bit(s)

Set status bit

Definition at line 576 of file Anim2D.cpp.

◆ tryNextFrame()

void Anim2D::tryNextFrame ( void )
protected

we've just drawn ... try to update our frame if necessary

This is called after we are drawn ... if sufficient time has passed since our last frame update we will update our current frame

Definition at line 441 of file Anim2D.cpp.

◆ xfer()

void Anim2D::xfer ( Xfer * xfer)
protectedvirtual

Xfer Method Version Info: 1: Initial version

Implements Snapshot.

Definition at line 686 of file Anim2D.cpp.

Friends And Related Symbol Documentation

◆ Anim2DCollection

friend class Anim2DCollection
friend

Definition at line 137 of file Anim2D.h.

Member Data Documentation

◆ m_alpha

Real Anim2D::m_alpha
protected

Definition at line 184 of file Anim2D.h.

◆ m_collectionSystem

Anim2DCollection* Anim2D::m_collectionSystem
protected

system collection (if any) we're registered with

Definition at line 186 of file Anim2D.h.

◆ m_collectionSystemNext

Anim2D* Anim2D::m_collectionSystemNext
protected

system instance tracking list

Definition at line 187 of file Anim2D.h.

◆ m_collectionSystemPrev

Anim2D* Anim2D::m_collectionSystemPrev
protected

system instance tracking list

Definition at line 188 of file Anim2D.h.

◆ m_currentFrame

UnsignedShort Anim2D::m_currentFrame
protected

current frame of our animation

Definition at line 177 of file Anim2D.h.

◆ m_framesBetweenUpdates

UnsignedInt Anim2D::m_framesBetweenUpdates
protected

duration between each frame.

Definition at line 183 of file Anim2D.h.

◆ m_lastUpdateFrame

UnsignedInt Anim2D::m_lastUpdateFrame
protected

last frame we updated on

Definition at line 178 of file Anim2D.h.

◆ m_maxFrame

UnsignedShort Anim2D::m_maxFrame
protected

max animation frame used inclusively.

Definition at line 182 of file Anim2D.h.

◆ m_minFrame

UnsignedShort Anim2D::m_minFrame
protected

min animation frame used inclusively.

Definition at line 181 of file Anim2D.h.

◆ m_status

UnsignedByte Anim2D::m_status
protected

status bits (see Anim2DStatus)

Definition at line 180 of file Anim2D.h.

◆ m_template

Anim2DTemplate* Anim2D::m_template
protected

pointer back to the template that defines this animation

Definition at line 179 of file Anim2D.h.


The documentation for this class was generated from the following files: