ScummVM API documentation
MM::Shared::Xeen::SpriteResource Class Reference
Inheritance diagram for MM::Shared::Xeen::SpriteResource:
MM::Xeen::SpriteResource

Classes

struct  IndexEntry
 

Public Member Functions

 SpriteResource (const Common::Path &filename)
 
 SpriteResource (const SpriteResource &src)
 
SpriteResourceoperator= (const SpriteResource &src)
 
void load (const Common::Path &filename)
 
void clear ()
 
void draw (XSurface &dest, int frame, const Common::Point &destPos, uint flags=0, int scale=0) const
 
void draw (XSurface &dest, int frame) const
 
void draw (Graphics::ManagedSurface *dest, int frame, const Common::Point &destPos) const
 
Common::Point getFrameSize (int frame) const
 
size_t size () const
 
bool empty () const
 

Static Public Member Functions

static void setClippedBottom (int y)
 

Protected Member Functions

void load (Common::SeekableReadStream &f)
 
void draw (XSurface &dest, int frame, const Common::Point &destPos, const Common::Rect &bounds, uint flags=0, int scale=0) const
 
void copy (const SpriteResource &src)
 

Protected Attributes

Common::Array< IndexEntry_index
 
size_t _filesize
 
byte * _data
 
Common::Path _filename
 

Static Protected Attributes

static int _clippedBottom
 

Member Function Documentation

◆ load() [1/2]

void MM::Shared::Xeen::SpriteResource::load ( Common::SeekableReadStream f)
protected

Load a sprite resource from a stream

◆ draw() [1/4]

void MM::Shared::Xeen::SpriteResource::draw ( XSurface dest,
int  frame,
const Common::Point destPos,
const Common::Rect bounds,
uint  flags = 0,
int  scale = 0 
) const
protected

Draw the sprite onto the given surface

◆ copy()

void MM::Shared::Xeen::SpriteResource::copy ( const SpriteResource src)
protected

Deep copy assuming that the current instance is clean

◆ operator=()

SpriteResource& MM::Shared::Xeen::SpriteResource::operator= ( const SpriteResource src)

Copy operator for duplicating a sprite resource

◆ load() [2/2]

void MM::Shared::Xeen::SpriteResource::load ( const Common::Path filename)

Load a sprite resource from a given file

◆ clear()

void MM::Shared::Xeen::SpriteResource::clear ( )

Clears the sprite resource

◆ draw() [2/4]

void MM::Shared::Xeen::SpriteResource::draw ( XSurface dest,
int  frame,
const Common::Point destPos,
uint  flags = 0,
int  scale = 0 
) const

Draw a sprite onto a surface

Parameters
destDestination surface
frameFrame number
destPosDestination position
flagsFlags
scaleScale: 0=No scale, SCALE_ENLARGE=Enlarge it 1..15 -> reduces the sprite: the higher, the smaller it'll be

◆ draw() [3/4]

void MM::Shared::Xeen::SpriteResource::draw ( XSurface dest,
int  frame 
) const

Draw the sprite onto the given surface

Parameters
destDestination surface
frameFrame number

◆ draw() [4/4]

void MM::Shared::Xeen::SpriteResource::draw ( Graphics::ManagedSurface dest,
int  frame,
const Common::Point destPos 
) const

Draw the sprite onto a given surface

◆ getFrameSize()

Common::Point MM::Shared::Xeen::SpriteResource::getFrameSize ( int  frame) const

Gets the size of a sprite

◆ size()

size_t MM::Shared::Xeen::SpriteResource::size ( ) const
inline

Returns the number of frames the sprite resource has

◆ empty()

bool MM::Shared::Xeen::SpriteResource::empty ( ) const
inline

Returns true if the sprite resource is empty (ie. nothing is loaded)

◆ setClippedBottom()

static void MM::Shared::Xeen::SpriteResource::setClippedBottom ( int  y)
inlinestatic

Set the bottom Y position where sprites are clipped if SPRFLAG_BOTTOM_CLIPPED is applied


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