file access cross-platform compatibility fixes

This commit is contained in:
tmj-fstate
2018-03-29 03:48:21 +02:00
parent 64dea17e6f
commit 6ffced1d90
12 changed files with 40 additions and 30 deletions

View File

@@ -81,12 +81,13 @@ TModelsManager::GetModel(std::string const &Name, bool const Dynamic)
// - wczytanie modelu animowanego - Init() - sprawdzić
std::string const buftp { Global.asCurrentTexturePath }; // zapamiętanie aktualnej ścieżki do tekstur,
std::string filename { Name };
if( Name.find( '/' ) != std::string::npos ) {
if( ( false == Dynamic )
&& ( Name.find( '/' ) != std::string::npos ) ) {
// pobieranie tekstur z katalogu, w którym jest model
// when loading vehicles the path is set by the calling routine, so we can skip it here
Global.asCurrentTexturePath += Name;
Global.asCurrentTexturePath.erase( Global.asCurrentTexturePath.rfind( "/" ) + 1 );
Global.asCurrentTexturePath.erase( Global.asCurrentTexturePath.rfind( '/' ) + 1 );
}
erase_extension( filename );
filename = ToLower( filename );