@@ -388,20 +388,20 @@ void ofxAssimpModelLoader::loadGLResources(){
388
388
auto ogPath = texPathStr;
389
389
bool bHasEmbeddedTexture = false ;
390
390
391
- string modelFolder = ofFilePath::getEnclosingDirectory ( file.path () );
392
- string relTexPath = ofFilePath::getEnclosingDirectory (texPathStr,false );
393
- string texFile = ofFilePath::getFileName ( texPathStr) ;
394
- string realPath = ofFilePath::join ( ofFilePath::join (modelFolder, relTexPath), texFile);
391
+ auto modelFolder = ofFilePath::getEnclosingDirectory ( file.path () );
392
+ auto relTexPath = ofFilePath::getEnclosingDirectory (texPathStr,false );
393
+ auto realPath = modelFolder / of::filesystem::path{ texPathStr } ;
394
+
395
395
396
396
#ifndef TARGET_LINUX_ARM
397
397
if (bTryEmbed || ofFile::doesFileExist (realPath) == false ) {
398
398
auto embeddedTexture = scene->GetEmbeddedTexture (ogPath.c_str ());
399
399
if ( embeddedTexture ){
400
400
bHasEmbeddedTexture = true ;
401
- ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource() texture " << texFile << " is embedded " ;
401
+ ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource() texture " << realPath. filename () << " is embedded " ;
402
402
}else {
403
403
ofLogError (" ofxAssimpModelLoader" ) << " loadGLResource(): texture doesn't exist: \" "
404
- << file.getFileName () + " \" in \" " << realPath << " \" " ;
404
+ << file.getFileName () + " \" in \" " << realPath. string () << " \" " ;
405
405
}
406
406
}
407
407
#endif
@@ -419,7 +419,7 @@ void ofxAssimpModelLoader::loadGLResources(){
419
419
meshHelper.addTexture (assimpTexture);
420
420
421
421
ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource(): texture already loaded: \" "
422
- << file.getFileName () + " \" from \" " << realPath << " \" " << " adding texture as " << assimpTexture.getTextureTypeAsString () ;
422
+ << file.getFileName () + " \" from \" " << realPath. string () << " \" " << " adding texture as " << assimpTexture.getTextureTypeAsString () ;
423
423
} else {
424
424
425
425
shared_ptr<ofTexture> texture = std::make_shared<ofTexture>();
@@ -463,7 +463,7 @@ void ofxAssimpModelLoader::loadGLResources(){
463
463
ofLogVerbose (" ofxAssimpModelLoader" ) << " loadGLResource(): texture " << tmpTex.getTextureTypeAsString () << " loaded, dimensions: " << texture->getWidth () << " x" << texture->getHeight ();
464
464
}else {
465
465
ofLogError (" ofxAssimpModelLoader" ) << " loadGLResource(): couldn't load texture: \" "
466
- << file.getFileName () + " \" from \" " << realPath << " \" " ;
466
+ << file.getFileName () + " \" from \" " << realPath. string () << " \" " ;
467
467
}
468
468
}
469
469
}
0 commit comments