| 1080 | } |
| 1081 | |
| 1082 | bool TileMap::loadFromFile( const std::string& path ) { |
| 1083 | if ( FileSystem::fileExists( path ) ) { |
| 1084 | mPath = path; |
| 1085 | |
| 1086 | IOStreamFile IOS( mPath ); |
| 1087 | |
| 1088 | return loadFromStream( IOS ); |
| 1089 | } else if ( PackManager::instance()->isFallbackToPacksActive() ) { |
| 1090 | std::string tPath( path ); |
| 1091 | Pack* tPack = PackManager::instance()->exists( tPath ); |
| 1092 | |
| 1093 | if ( NULL != tPack ) { |
| 1094 | return loadFromPack( tPack, tPath ); |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | return false; |
| 1099 | } |
| 1100 | |
| 1101 | bool TileMap::loadFromPack( Pack* Pack, const std::string& FilePackPath ) { |
| 1102 | if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { |
no test coverage detected