Skip to content

Commit 01cfda4

Browse files
committed
Merge pull request #2079 from paroj:ovisres
2 parents 2c32791 + 310ca2b commit 01cfda4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

modules/ovis/src/ovis.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const char* RESOURCEGROUP_NAME = "OVIS";
2222
Ptr<Application> _app;
2323

2424
static const char* RENDERSYSTEM_NAME = "OpenGL 3+ Rendering Subsystem";
25-
static std::vector<String> _extraResourceLocations;
25+
static std::set<String> _extraResourceLocations;
2626

2727
// convert from OpenCV to Ogre coordinates:
2828
static Quaternion toOGRE(Degree(180), Vector3::UNIT_X);
@@ -245,10 +245,9 @@ struct Application : public OgreBites::ApplicationContext, public OgreBites::Inp
245245
ResourceGroupManager& rgm = ResourceGroupManager::getSingleton();
246246
rgm.createResourceGroup(RESOURCEGROUP_NAME);
247247

248-
for (size_t i = 0; i < _extraResourceLocations.size(); i++)
248+
for (auto loc :_extraResourceLocations)
249249
{
250-
String loc = _extraResourceLocations[i];
251-
String type = StringUtil::endsWith(loc, ".zip") ? "Zip" : "FileSystem";
250+
const char* type = StringUtil::endsWith(loc, ".zip") ? "Zip" : "FileSystem";
252251

253252
if (!FileSystemLayer::fileExists(loc))
254253
{
@@ -786,7 +785,10 @@ class WindowSceneImpl : public WindowScene
786785
}
787786
};
788787

789-
CV_EXPORTS_W void addResourceLocation(const String& path) { _extraResourceLocations.push_back(path); }
788+
CV_EXPORTS_W void addResourceLocation(const String& path)
789+
{
790+
_extraResourceLocations.insert(Ogre::StringUtil::normalizeFilePath(path, false));
791+
}
790792

791793
Ptr<WindowScene> createWindow(const String& title, const Size& size, int flags)
792794
{

0 commit comments

Comments
 (0)