FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::Atlas Class Reference

#include <atlasloader.h>

+ Collaboration diagram for FIFE::Atlas:

Public Member Functions

 Atlas (const std::string &name)
 
 ~Atlas ()
 
size_t getImageCount () const
 Returns the number of subimages that belongs to this atlas. More...
 
ImagePtrgetPackedImage ()
 Returns an (packed) Image for this atlas. More...
 
ImagePtr getImage (const std::string &id)
 Return an Image of given id. More...
 
ImagePtr getImage (uint32_t index)
 Return an Image of given (serial) index in atlas. More...
 
bool addImage (const std::string &imagename, const AtlasData &data)
 Adds new information about subimage that belongs to this atlas. More...
 
void setPackedImage (const ImagePtr &image)
 Sets the image for atlas to use it for rendering. More...
 
const std::string & getName () const
 

Protected Types

typedef std::map< std::string, AtlasDataSubimageMap
 

Protected Attributes

SubimageMap m_subimages
 
ImagePtr m_image
 
std::string m_name
 

Detailed Description

Definition at line 51 of file atlasloader.h.

Member Typedef Documentation

typedef std::map<std::string, AtlasData> FIFE::Atlas::SubimageMap
protected

Definition at line 87 of file atlasloader.h.

Constructor & Destructor Documentation

FIFE::Atlas::Atlas ( const std::string &  name)
inline

Definition at line 53 of file atlasloader.h.

FIFE::Atlas::~Atlas ( )
inline

Definition at line 55 of file atlasloader.h.

References FIFE::AtlasData::image.

Member Function Documentation

bool FIFE::Atlas::addImage ( const std::string &  imagename,
const AtlasData data 
)

Adds new information about subimage that belongs to this atlas.

Remarks
This is essential function in parsing atlas files.
Returns
True, when image of given name hasn't been added before.

Definition at line 76 of file atlasloader.cpp.

References m_subimages.

ImagePtr FIFE::Atlas::getImage ( const std::string &  id)

Return an Image of given id.

Definition at line 60 of file atlasloader.cpp.

References m_subimages.

ImagePtr FIFE::Atlas::getImage ( uint32_t  index)

Return an Image of given (serial) index in atlas.

Definition at line 67 of file atlasloader.cpp.

References getImageCount(), and m_subimages.

size_t FIFE::Atlas::getImageCount ( ) const

Returns the number of subimages that belongs to this atlas.

Definition at line 52 of file atlasloader.cpp.

References m_subimages.

Referenced by getImage().

+ Here is the caller graph for this function:

const std::string & FIFE::Atlas::getName ( ) const

Definition at line 84 of file atlasloader.cpp.

References m_name.

ImagePtr & FIFE::Atlas::getPackedImage ( )

Returns an (packed) Image for this atlas.

Definition at line 56 of file atlasloader.cpp.

References m_image.

void FIFE::Atlas::setPackedImage ( const ImagePtr image)

Sets the image for atlas to use it for rendering.

Remarks
Should only be used during loading stage

Definition at line 80 of file atlasloader.cpp.

References m_image.

Member Data Documentation

ImagePtr FIFE::Atlas::m_image
protected

Definition at line 89 of file atlasloader.h.

Referenced by getPackedImage(), and setPackedImage().

std::string FIFE::Atlas::m_name
protected

Definition at line 92 of file atlasloader.h.

Referenced by getName().

SubimageMap FIFE::Atlas::m_subimages
protected

Definition at line 88 of file atlasloader.h.

Referenced by addImage(), getImage(), and getImageCount().


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