xbmc
Public Member Functions | Static Public Member Functions | List of all members
CTextureBundle Class Reference

Public Member Functions

 CTextureBundle (bool useXBT)
 
void SetThemeBundle (bool themeBundle)
 
bool HasFile (const std::string &Filename)
 
std::vector< std::string > GetTexturesFromPath (const std::string &path)
 
bool LoadTexture (const std::string &filename, std::unique_ptr< CTexture > &texture, int &width, int &height)
 Load texture from bundle. More...
 
bool LoadAnim (const std::string &filename, std::vector< std::pair< std::unique_ptr< CTexture >, int >> &textures, int &width, int &height, int &nLoops)
 Load animation from bundle. More...
 
void Close ()
 

Static Public Member Functions

static std::string Normalize (std::string name)
 

Member Function Documentation

◆ LoadAnim()

bool CTextureBundle::LoadAnim ( const std::string &  filename,
std::vector< std::pair< std::unique_ptr< CTexture >, int >> &  textures,
int &  width,
int &  height,
int &  nLoops 
)

Load animation from bundle.

Parameters
[in]filenamename of the animation to load
[out]texturevector of frames. Each frame is pair of a texture and the duration the frame
[out]widthwidth of the loaded textures
[out]heightheight of the loaded textures
Returns
true if animation was loaded
Todo:
With c++17 this should be changed to return a std::optional that's wrapping a struct containing the output values. Same for CTextureBundleXBT::LoadAnim.

◆ LoadTexture()

bool CTextureBundle::LoadTexture ( const std::string &  filename,
std::unique_ptr< CTexture > &  texture,
int &  width,
int &  height 
)

Load texture from bundle.

Parameters
[in]filenamename of the texture to load
[out]textureholds the pointer to the texture after successful loading
[out]widthwidth of the loaded texture
[out]heightheight of the loaded texture
Returns
true if texture was loaded
Todo:
With c++17 this should be changed to return a std::optional that's wrapping a struct containing the output values. Same for CTextureBundleXBT::LoadTexture.

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