Improved UITheme load.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2017-08-06 01:21:49 -03:00
parent 95715c60f5
commit 0481f869d2
16 changed files with 149 additions and 291 deletions

View File

@@ -44,11 +44,16 @@ class EE_API Image {
*/
static bool getInfo( const std::string& path, int * width, int * height, int * channels );
/** @return True if the file is a valid image
/** @return True if the file is a valid image ( reads the file header to know if the file is an image file format supported )
* @param path the image path
*/
static bool isImage( const std::string& path );
/** @return If the path or file name has a supported image file extension
* @param path the image path or file name
*/
static bool isImageExtension( const std::string& path );
/** @return The last failure image loading/info reason */
static std::string getLastFailureReason();

View File

@@ -18,6 +18,8 @@ class EE_API UISkin {
static const char * getSkinStateName( const Uint32& State );
static bool isStateName( const std::string& State );
UISkin( const std::string& name, const Uint32& Type );
virtual ~UISkin();

View File

@@ -16,6 +16,8 @@ class EE_API UISkinComplex : public UISkin {
static std::string getSideSuffix( const Uint32& Side );
static bool isSideSuffix( const std::string& suffix );
enum UISkinComplexSides {
Left = 0,
Right,

View File

@@ -27,11 +27,11 @@ class EE_API UITheme : protected ResourceManager<UISkin> {
static UITheme * loadFromTextureAtlas( UITheme * tTheme, Graphics::TextureAtlas * getTextureAtlas );
static UITheme * loadFromFile( UITheme * tTheme, const std::string& Path, const std::string ImgExt = "png" );
static UITheme * loadFromFile( UITheme * tTheme, const std::string& Path );
static UITheme * loadFromTextureAtlas( Graphics::TextureAtlas * getTextureAtlas, const std::string& Name, const std::string NameAbbr );
static UITheme * loadFromFile( const std::string& Path, const std::string& Name, const std::string& NameAbbr, const std::string ImgExt = "png" );
static UITheme * loadFromFile( const std::string& Path, const std::string& Name, const std::string& NameAbbr );
void addThemeElement( const std::string& Element );
@@ -84,14 +84,8 @@ class EE_API UITheme : protected ResourceManager<UISkin> {
std::string mAbbr;
Graphics::TextureAtlas *mTextureAtlas;
UITooltipStyleConfig mFontStyleConfig;
std::list<std::string> mUIElements;
std::list<std::string> mUIIcons;
void getTextureAtlas( Graphics::TextureAtlas * SG );
static bool searchFilesOfElement( Graphics::TextureAtlas * SG, const std::string& Path, std::string Element, Uint32& IsComplex, const std::string ImgExt );
static bool searchFilesInAtlas( Graphics::TextureAtlas * SG, std::string Element, Uint32& IsComplex );
void setTextureAtlas( Graphics::TextureAtlas * SG );
};
}}