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 () const
 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 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 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.
virtual void shouldResetItem (bool resetItem)
 When this animation is playing as an action should a new animation be chosen for the item as soon as this one completes based on the item's activity? This is true by default, but setting it to false allows scripts to chose precisely the new animation to play, and to start it in the same frame as this one is removed.
virtual void resetItem ()
 Remove this action animation for the item and select a new animation based on the item's current activity.
virtual bool isDone () const
 Is this animation done playing.

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

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 58 of file anim.h.


Member Enumeration Documentation

Enumerator:
kActionUsagePassive 
kActionUsageActive 

Definition at line 69 of file anim.h.

Enumerator:
kActorActivityIdle 
kActorActivityWalk 
kActorActivityTalk 
kActorActivityRun 
kActorActivityIdleAction 

Definition at line 80 of file anim.h.

Enumerator:
kAnimImages 
kAnimProp 
kAnimVideo 
kAnimSkeleton 

Definition at line 62 of file anim.h.

Enumerator:
kUIUsageInventory 
kUIUsageUseCursorPassive 
kUIUsageUseCursorActive 

Definition at line 74 of file anim.h.


Constructor & Destructor Documentation

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

Definition at line 73 of file anim.cpp.

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

Definition at line 70 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 94 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 55 of file anim.cpp.

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

Obtain the purpose of this anim.

Definition at line 90 of file anim.cpp.

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

Get current displayed frame.

Definition at line 98 of file anim.h.

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 122 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 137 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 133 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 105 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 115 of file anim.cpp.

bool Stark::Resources::Anim::isDone (  )  const [virtual]

Is this animation done playing.

Only valid for animations started with playAsAction.

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

Definition at line 128 of file anim.cpp.

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

Check is the animation is being used by an item.

Definition at line 101 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 110 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 82 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 97 of file anim.cpp.

void Stark::Resources::Anim::resetItem (  )  [virtual]

Remove this action animation for the item and select a new animation based on the item's current activity.

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

Definition at line 124 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 87 of file anim.cpp.

void Stark::Resources::Anim::shouldResetItem ( bool  resetItem  )  [virtual]

When this animation is playing as an action should a new animation be chosen for the item as soon as this one completes based on the item's activity? This is true by default, but setting it to false allows scripts to chose precisely the new animation to play, and to start it in the same frame as this one is removed.

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

Definition at line 120 of file anim.cpp.


Member Data Documentation

Definition at line 166 of file anim.h.

Definition at line 167 of file anim.h.

Definition at line 168 of file anim.h.

Definition at line 169 of file anim.h.

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

Definition at line 60 of file anim.h.


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


Generated on Sat Jul 20 2019 05:03:33 for ResidualVM by doxygen 1.7.1
curved edge   curved edge