diff --git a/include/eepp/graphics/ctextureatlasloader.hpp b/include/eepp/graphics/ctextureatlasloader.hpp index a977f5c48..f72a70ff8 100644 --- a/include/eepp/graphics/ctextureatlasloader.hpp +++ b/include/eepp/graphics/ctextureatlasloader.hpp @@ -58,14 +58,11 @@ class EE_API cTextureAtlasLoader { cTextureAtlas * GetTextureAtlas() const; void SetLoadCallback( GLLoadCallback LoadCallback ); - - std::string AppPath() const; protected: cResourceLoader mRL; std::string mTextureGroupPath; bool mThreaded; bool mLoaded; - std::string mAppPath; cPack * mPack; bool mSkipResourceLoad; bool mIsLoading; diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 17ebf4cbb..39219a829 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/gaming/cmap.cpp b/src/eepp/gaming/cmap.cpp index f995e2fac..b2699ffc5 100644 --- a/src/eepp/gaming/cmap.cpp +++ b/src/eepp/gaming/cmap.cpp @@ -785,7 +785,7 @@ bool cMap::LoadFromStream( cIOStream& IOS ) { if ( NULL == cTextureAtlasManager::instance()->GetByName( sgname ) ) { cTextureAtlasLoader * tgl = eeNew( cTextureAtlasLoader, () ); - tgl->Load( tgl->AppPath() + TextureAtlases[i] ); + tgl->Load( Sys::GetProcessPath() + TextureAtlases[i] ); eeSAFE_DELETE( tgl ); } diff --git a/src/eepp/graphics/ctextureatlasloader.cpp b/src/eepp/graphics/ctextureatlasloader.cpp index 73690cf03..5eccba6a6 100644 --- a/src/eepp/graphics/ctextureatlasloader.cpp +++ b/src/eepp/graphics/ctextureatlasloader.cpp @@ -15,7 +15,6 @@ using namespace Private; cTextureAtlasLoader::cTextureAtlasLoader() : mThreaded(false), mLoaded(false), - mAppPath( Sys::GetProcessPath() ), mPack(NULL), mSkipResourceLoad(false), mIsLoading(false), @@ -27,7 +26,6 @@ cTextureAtlasLoader::cTextureAtlasLoader( const std::string& TextureGroupPath, c mTextureGroupPath( TextureGroupPath ), mThreaded( Threaded ), mLoaded(false), - mAppPath( Sys::GetProcessPath() ), mPack(NULL), mSkipResourceLoad(false), mIsLoading(false), @@ -41,7 +39,6 @@ cTextureAtlasLoader::cTextureAtlasLoader( const Uint8* Data, const Uint32& DataS mTextureGroupPath( TextureGroupName ), mThreaded( Threaded ), mLoaded(false), - mAppPath( Sys::GetProcessPath() ), mPack(NULL), mSkipResourceLoad(false), mIsLoading(false), @@ -55,7 +52,6 @@ cTextureAtlasLoader::cTextureAtlasLoader( cPack * Pack, const std::string& FileP mTextureGroupPath( FilePackPath ), mThreaded( Threaded ), mLoaded(false), - mAppPath( Sys::GetProcessPath() ), mPack(NULL), mSkipResourceLoad(false), mIsLoading(false), @@ -498,8 +494,4 @@ bool cTextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std: return true; } -std::string cTextureAtlasLoader::AppPath() const { - return mAppPath; -} - }} diff --git a/src/eepp/system/sys.cpp b/src/eepp/system/sys.cpp index 10fab2de8..c2f158df3 100644 --- a/src/eepp/system/sys.cpp +++ b/src/eepp/system/sys.cpp @@ -346,7 +346,7 @@ void Sys::Sleep( const Uint32& ms ) { #endif } -std::string Sys::GetProcessPath() { +static std::string sGetProcessPath() { #if EE_PLATFORM == EE_PLATFORM_MACOSX char exe_file[PATH_MAX + 1]; CFBundleRef mainBundle = CFBundleGetMainBundle(); @@ -441,6 +441,11 @@ std::string Sys::GetProcessPath() { #endif } +std::string Sys::GetProcessPath() { + static std::string path = sGetProcessPath(); + return path; +} + eeDouble Sys::GetSystemTime() { #if EE_PLATFORM == EE_PLATFORM_WIN static LARGE_INTEGER Frequency;