Skip to content

Commit

Permalink
[FIX] Fix resources loading when a resource does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
LAGNEAU Romain committed Jan 10, 2025
1 parent fa83af1 commit f832dbc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/ar/src/ogre-simulator/vpAROgre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,12 @@ void vpAROgre::init(bool
for (i = settings->begin(); i != settings->end(); ++i) {
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
if (vpIoTools::checkDirectory(archName) || vpIoTools::checkFilename(archName)) {
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
else {
std::cout << "INFO: Resource \"" << archName << "\" of type \"" << typeName << "\" does not exist." << std::endl;
}
}
}
#else
Expand All @@ -473,7 +478,12 @@ void vpAROgre::init(bool
for (i = settings.begin(); i != settings.end(); ++i) {
typeName = i->first;
archName = i->second;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
if (vpIoTools::checkDirectory(archName) || vpIoTools::checkFilename(archName)) {
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
else {
std::cout << "INFO: Resource \"" << archName << "\" of type \"" << typeName << "\" does not exist." << std::endl;
}
}
}
#endif
Expand Down

0 comments on commit f832dbc

Please sign in to comment.