diff --git a/include/eepp/graphics/ctextureatlasloader.hpp b/include/eepp/graphics/ctextureatlasloader.hpp index 00963ed0a..f2edfeda3 100644 --- a/include/eepp/graphics/ctextureatlasloader.hpp +++ b/include/eepp/graphics/ctextureatlasloader.hpp @@ -26,6 +26,8 @@ class EE_API cTextureAtlasLoader { cTextureAtlasLoader( cPack * Pack, const std::string& FilePackPath, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + cTextureAtlasLoader( cIOStream& IOS, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + ~cTextureAtlasLoader(); void Update(); diff --git a/include/eepp/graphics/ctextureatlasmanager.hpp b/include/eepp/graphics/ctextureatlasmanager.hpp index 17818c86b..70e3bfe42 100644 --- a/include/eepp/graphics/ctextureatlasmanager.hpp +++ b/include/eepp/graphics/ctextureatlasmanager.hpp @@ -15,6 +15,14 @@ class EE_API cTextureAtlasManager : public tResourceManager { virtual ~cTextureAtlasManager(); + cTextureAtlas * Load( const std::string& TextureAtlasPath ); + + cTextureAtlas * LoadFromStream( cIOStream& IOS ); + + cTextureAtlas * LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ); + + cTextureAtlas * LoadFromPack( cPack * Pack, const std::string& FilePackPath ); + cSubTexture * GetSubTextureByName( const std::string& Name ); cSubTexture * GetSubTextureById( const Uint32& Id ); diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index c277487c1..b360440fe 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/src/eepp/graphics/ctextureatlasloader.cpp b/src/eepp/graphics/ctextureatlasloader.cpp index b2e9eeda8..02fd54c6e 100644 --- a/src/eepp/graphics/ctextureatlasloader.cpp +++ b/src/eepp/graphics/ctextureatlasloader.cpp @@ -61,6 +61,18 @@ cTextureAtlasLoader::cTextureAtlasLoader( cPack * Pack, const std::string& FileP LoadFromPack( Pack, FilePackPath ); } +cTextureAtlasLoader::cTextureAtlasLoader( cIOStream& IOS, const bool& Threaded, GLLoadCallback LoadCallback ) : + mThreaded( Threaded ), + mLoaded(false), + mPack(NULL), + mSkipResourceLoad(false), + mIsLoading(false), + mTextureAtlas(NULL), + mLoadCallback( LoadCallback ) +{ + LoadFromStream( IOS ); +} + cTextureAtlasLoader::~cTextureAtlasLoader() { } diff --git a/src/eepp/graphics/ctextureatlasmanager.cpp b/src/eepp/graphics/ctextureatlasmanager.cpp index dfa37914d..0ea1938e6 100644 --- a/src/eepp/graphics/ctextureatlasmanager.cpp +++ b/src/eepp/graphics/ctextureatlasmanager.cpp @@ -1,6 +1,6 @@ #include #include - +#include namespace EE { namespace Graphics { SINGLETON_DECLARE_IMPLEMENTATION(cTextureAtlasManager) @@ -15,6 +15,30 @@ cTextureAtlasManager::cTextureAtlasManager() : cTextureAtlasManager::~cTextureAtlasManager() { } +cTextureAtlas * cTextureAtlasManager::Load( const std::string& TextureAtlasPath ) { + cTextureAtlasLoader loader( TextureAtlasPath ); + + return loader.GetTextureAtlas(); +} + +cTextureAtlas * cTextureAtlasManager::LoadFromStream( cIOStream& IOS ) { + cTextureAtlasLoader loader( IOS ); + + return loader.GetTextureAtlas(); +} + +cTextureAtlas * cTextureAtlasManager::LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ) { + cTextureAtlasLoader loader( Data, DataSize, TextureAtlasName ); + + return loader.GetTextureAtlas(); +} + +cTextureAtlas * cTextureAtlasManager::LoadFromPack( cPack * Pack, const std::string& FilePackPath ) { + cTextureAtlasLoader loader( Pack, FilePackPath ); + + return loader.GetTextureAtlas(); +} + cSubTexture * cTextureAtlasManager::GetSubTextureByName( const std::string& Name ) { cSubTexture * tSubTexture = GetSubTextureById( String::Hash( Name ) );