@@ -22,7 +22,7 @@ const char* RESOURCEGROUP_NAME = "OVIS";
22
22
Ptr<Application> _app;
23
23
24
24
static const char * RENDERSYSTEM_NAME = " OpenGL 3+ Rendering Subsystem" ;
25
- static std::vector <String> _extraResourceLocations;
25
+ static std::set <String> _extraResourceLocations;
26
26
27
27
// convert from OpenCV to Ogre coordinates:
28
28
static Quaternion toOGRE (Degree(180 ), Vector3::UNIT_X);
@@ -245,10 +245,9 @@ struct Application : public OgreBites::ApplicationContext, public OgreBites::Inp
245
245
ResourceGroupManager& rgm = ResourceGroupManager::getSingleton ();
246
246
rgm.createResourceGroup (RESOURCEGROUP_NAME);
247
247
248
- for (size_t i = 0 ; i < _extraResourceLocations. size (); i++ )
248
+ for (auto loc : _extraResourceLocations)
249
249
{
250
- String loc = _extraResourceLocations[i];
251
- String type = StringUtil::endsWith (loc, " .zip" ) ? " Zip" : " FileSystem" ;
250
+ const char * type = StringUtil::endsWith (loc, " .zip" ) ? " Zip" : " FileSystem" ;
252
251
253
252
if (!FileSystemLayer::fileExists (loc))
254
253
{
@@ -786,7 +785,10 @@ class WindowSceneImpl : public WindowScene
786
785
}
787
786
};
788
787
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
+ }
790
792
791
793
Ptr<WindowScene> createWindow (const String& title, const Size& size, int flags)
792
794
{
0 commit comments