ScummVM API documentation
Alcachofa::AnimationBase Class Reference

#include <graphics.h>

Inheritance diagram for Alcachofa::AnimationBase:
Alcachofa::Animation Alcachofa::Font

Protected Member Functions

 AnimationBase (Common::String fileName, AnimationFolder folder=AnimationFolder::Animations)
 
void load ()
 
void loadMissingAnimation ()
 
void freeImages ()
 
Graphics::ManagedSurfacereadImage (Common::SeekableReadStream &stream) const
 
Common::Point imageSize (int32 imageI) const
 
bool isLoaded () const
 

Static Protected Member Functions

static void fullBlend (const Graphics::ManagedSurface &source, Graphics::ManagedSurface &destination, int offsetX, int offsetY)
 

Protected Attributes

Common::String _fileName
 
AnimationFolder _folder
 
bool _isLoaded = false
 
uint32 _totalDuration = 0
 
int32 _spriteIndexMapping [kMaxSpriteIDs] = { 0 }
 
Common::Array< uint32 > _spriteOffsets
 index offset per sprite and animation frame
 
Common::Array< uint32 > _spriteBases
 base index per sprite
 
Common::Array< AnimationFrame_frames
 
Common::Array< Graphics::ManagedSurface * > _images
 will contain nullptr for fake images
 
Common::Array< Common::Point_imageOffsets
 

Static Protected Attributes

static constexpr const uint kMaxSpriteIDs = 256
 

Detailed Description

An animation contains one or more sprites which change their position and image during playback.

Internally there is a single list of images. Every sprite ID is mapped to an index (via _spriteIndexMapping) which points to:

  1. The fixed image base for that sprite
  2. The image offset for that sprite for the current frame Image indices are unfortunately one-based

As fonts are handled very differently they are split into a second class


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