Mygui Ogre resource system question

Tubulii

25-08-2012 18:37:30

Hi,

I tried to figure out, why mygui does not accept some of my layout files. After tracing mygui with the debugger, I have found out that mygui skips all files which are not in the root dir (i.e. have a path) e.g. : Path/file.layout, file2.layout, /Path/To/file.layout.
But why?

Altren

26-08-2012 15:11:41

MyGUI Ogre resource system is just Ogre's resources, and Ogre works with files in folders, added as resource folders. So it is just plain Ogre's resource system, MyGUI doesn't skip or do anything with resource path, it just ask Ogre's resource system for them.
And by the way, it is possible to have resources with names like Path/file.layout. You need to add only root resource folder with recursive flag. Look at Ogre::ResourceGroupManager::addResourceLocation description for details.

Tubulii

26-08-2012 15:38:14

My fault, I did not express myself well.
Mygui checks, if the resource has a path (i.e. if the "path" field is not empty):
(MyGUI_OgreDataManager.cpp, line 109)
Ogre::FileInfoListPtr pFileInfo = pFileInfos;
for (Ogre::FileInfoList::iterator fi = pFileInfo->begin(); fi != pFileInfo->end(); ++fi )
{
if (fi->path.empty()) //why? This seems not to be needed somewhere
{
bool found = false;
for (VectorString::iterator iter = result.begin(); iter != result.end(); ++iter)
{
if (*iter == fi->filename)
{
found = true;
break;
}
}
if (!found)
{
result.push_back(_fullpath ? fi->archive->getName() + "/" + fi->filename : fi->filename);
}
}
}

That was my question :oops: