FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
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

◆ SubimageMap

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

Definition at line 87 of file atlasloader.h.

Constructor & Destructor Documentation

◆ Atlas()

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

Definition at line 53 of file atlasloader.h.

◆ ~Atlas()

FIFE::Atlas::~Atlas ( )
inline

Definition at line 55 of file atlasloader.h.

References FIFE::AtlasData::image.

Member Function Documentation

◆ addImage()

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.

◆ getImage() [1/2]

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.

◆ getImage() [2/2]

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.

◆ getImageCount()

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:

◆ getName()

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

Definition at line 84 of file atlasloader.cpp.

References m_name.

◆ getPackedImage()

ImagePtr & FIFE::Atlas::getPackedImage ( )

Returns an (packed) Image for this atlas.

Definition at line 56 of file atlasloader.cpp.

References m_image.

◆ setPackedImage()

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

◆ m_image

ImagePtr FIFE::Atlas::m_image
protected

Definition at line 89 of file atlasloader.h.

Referenced by getPackedImage(), and setPackedImage().

◆ m_name

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

Definition at line 92 of file atlasloader.h.

Referenced by getName().

◆ m_subimages

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: