ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Animation base class. More...

#include <anim.h>

Inheritance diagram for Stark::Resources::Anim:
Collaboration diagram for Stark::Resources::Anim:

List of all members.

Public Types

enum  SubType { kAnimImages = 1, kAnimProp = 2, kAnimVideo = 3, kAnimSkeleton = 4 }
enum  ActionUsage { kActionUsagePassive = 1, kActionUsageActive = 2 }
enum  UIUsage { kUIUsageInventory = 1, kUIUsageUseCursorPassive = 4, kUIUsageUseCursorActive = 5 }
enum  ActorActivity {
  kActorActivityIdle = 1, kActorActivityWalk = 2, kActorActivityTalk = 3, kActorActivityRun = 6,
  kActorActivityIdleAction = 10
}

Public Member Functions

 Anim (Object *parent, byte subType, uint16 index, const Common::String &name)
 ~Anim () override
void readData (Formats::XRCReadStream *stream) override
 Deserialize the resource static data and initial state.
uint32 getCurrentFrame ()
 Get current displayed frame.
virtual void selectFrame (uint32 frameIndex)
 Sets the animation frame to be displayed.
virtual VisualgetVisual ()=0
 Obtain the Visual to be used to render the animation.
virtual void applyToItem (Item *item)
 Associate the animation to an Item.
virtual void removeFromItem (Item *item)
 Dissociate the animation from an item.
bool isInUse ()
 Check is the animation is being used by an item.
uint32 getActivity () const
 Obtain the purpose of this anim.
virtual int getPointHotspotIndex (const Common::Point &point) const
 Return the hotspot index for a point given in relative coordinates.
virtual Common::Point getHotspotPosition (uint index) const
 Get the hotspot position for a given index of a pat-table.
virtual uint32 getDuration () const
 Get the animation typical duration in milliseconds.
virtual void playAsAction (ItemVisual *item)
 Play the animation as an action for an item.
virtual bool isAtTime (uint32 time) const
 Checks if the elapsed time since the animation start is greater than a specified duration.
virtual uint32 getRemainingTime () const
 Get the duration in milliseconds before the animation loops ends.
virtual uint32 getMovementSpeed () const
 Get the anim movement speed in units per seconds.
virtual uint32 getIdleActionFrequency () const
 Get the chance the animation has to play among other idle actions from the same anim hierarchy.

Static Public Member Functions

static Objectconstruct (Object *parent, byte subType, uint16 index, const Common::String &name)
 Anim factory.

Static Public Attributes

static const Type::ResourceType TYPE = Type::kAnim

Protected Member Functions

virtual void printData () override

Protected Attributes

uint32 _activity
uint32 _currentFrame
uint32 _numFrames
int32 _refCount

Detailed Description

Animation base class.

Animations provide a time dependent visual state to Items

Definition at line 54 of file anim.h.


Member Enumeration Documentation

Enumerator:
kActionUsagePassive 
kActionUsageActive 

Definition at line 65 of file anim.h.

Enumerator:
kActorActivityIdle 
kActorActivityWalk 
kActorActivityTalk 
kActorActivityRun 
kActorActivityIdleAction 

Definition at line 76 of file anim.h.

Enumerator:
kAnimImages 
kAnimProp 
kAnimVideo 
kAnimSkeleton 

Definition at line 58 of file anim.h.

Enumerator:
kUIUsageInventory 
kUIUsageUseCursorPassive 
kUIUsageUseCursorActive 

Definition at line 70 of file anim.h.


Constructor & Destructor Documentation

Stark::Resources::Anim::Anim ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
)

Definition at line 69 of file anim.cpp.

Stark::Resources::Anim::~Anim (  )  [override]

Definition at line 66 of file anim.cpp.


Member Function Documentation

void Stark::Resources::Anim::applyToItem ( Item item  )  [virtual]

Associate the animation to an Item.

Reimplemented in Stark::Resources::AnimSkeleton.

Definition at line 90 of file anim.cpp.

Object * Stark::Resources::Anim::construct ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
) [static]

Anim factory.

Definition at line 51 of file anim.cpp.

uint32 Stark::Resources::Anim::getActivity (  )  const

Obtain the purpose of this anim.

Definition at line 86 of file anim.cpp.

uint32 Stark::Resources::Anim::getCurrentFrame (  )  [inline]

Get current displayed frame.

Definition at line 94 of file anim.h.

uint32 Stark::Resources::Anim::getDuration (  )  const [virtual]

Get the animation typical duration in milliseconds.

Reimplemented in Stark::Resources::AnimVideo, and Stark::Resources::AnimSkeleton.

Definition at line 106 of file anim.cpp.

virtual Common::Point Stark::Resources::Anim::getHotspotPosition ( uint  index  )  const [inline, virtual]

Get the hotspot position for a given index of a pat-table.

Reimplemented in Stark::Resources::AnimImages.

Definition at line 118 of file anim.h.

uint32 Stark::Resources::Anim::getIdleActionFrequency (  )  const [virtual]

Get the chance the animation has to play among other idle actions from the same anim hierarchy.

Reimplemented in Stark::Resources::AnimSkeleton.

Definition at line 130 of file anim.cpp.

uint32 Stark::Resources::Anim::getMovementSpeed (  )  const [virtual]

Get the anim movement speed in units per seconds.

Reimplemented in Stark::Resources::AnimProp, and Stark::Resources::AnimSkeleton.

Definition at line 126 of file anim.cpp.

int Stark::Resources::Anim::getPointHotspotIndex ( const Common::Point point  )  const [virtual]

Return the hotspot index for a point given in relative coordinates.

Reimplemented in Stark::Resources::AnimImages.

Definition at line 101 of file anim.cpp.

uint32 Stark::Resources::Anim::getRemainingTime (  )  const [virtual]

Get the duration in milliseconds before the animation loops ends.

Reimplemented in Stark::Resources::AnimSkeleton.

Definition at line 121 of file anim.cpp.

virtual Visual* Stark::Resources::Anim::getVisual (  )  [pure virtual]
bool Stark::Resources::Anim::isAtTime ( uint32  time  )  const [virtual]

Checks if the elapsed time since the animation start is greater than a specified duration.

Reimplemented in Stark::Resources::AnimVideo, and Stark::Resources::AnimSkeleton.

Definition at line 116 of file anim.cpp.

bool Stark::Resources::Anim::isInUse (  ) 

Check is the animation is being used by an item.

Definition at line 97 of file anim.cpp.

void Stark::Resources::Anim::playAsAction ( ItemVisual item  )  [virtual]

Play the animation as an action for an item.

This sets up a callback to the item for when the animation completes.

Reimplemented in Stark::Resources::AnimVideo, and Stark::Resources::AnimSkeleton.

Definition at line 111 of file anim.cpp.

void Stark::Resources::Anim::printData (  )  [override, protected, virtual]
void Stark::Resources::Anim::readData ( Formats::XRCReadStream stream  )  [override, virtual]

Deserialize the resource static data and initial state.

Reimplemented from Stark::Resources::Object.

Reimplemented in Stark::Resources::AnimImages, Stark::Resources::AnimProp, Stark::Resources::AnimVideo, and Stark::Resources::AnimSkeleton.

Definition at line 78 of file anim.cpp.

void Stark::Resources::Anim::removeFromItem ( Item item  )  [virtual]

Dissociate the animation from an item.

Reimplemented in Stark::Resources::AnimSkeleton.

Definition at line 93 of file anim.cpp.

void Stark::Resources::Anim::selectFrame ( uint32  frameIndex  )  [virtual]

Sets the animation frame to be displayed.

Reimplemented in Stark::Resources::AnimImages.

Definition at line 83 of file anim.cpp.


Member Data Documentation

Definition at line 145 of file anim.h.

Definition at line 146 of file anim.h.

Definition at line 147 of file anim.h.

Definition at line 148 of file anim.h.

const Type::ResourceType Stark::Resources::Anim::TYPE = Type::kAnim [static]

Definition at line 56 of file anim.h.


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


Generated on Sat Jan 19 2019 05:07:48 for ResidualVM by doxygen 1.7.1
curved edge   curved edge