ResourceGroupManager Problem

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
katoun
Halfling
Posts: 65
Joined: Wed Mar 23, 2005 8:28 pm
Location: Romania-Bucharest
Contact:

ResourceGroupManager Problem

Post by katoun »

I have real in the manual about it, I have looked in the source code and I understood how it works but I got in to a dad end.
I'm trying to make a resource group in wich to declare 3 resources so that it can be reported so I can use the Loading Bar example from the Demos.
It loads all the default resources but mine.

Code: Select all

mLoadingBar.start(mWindow, 1, 1, 0.75);

		// Turn off rendering of everything except overlays
		mSceneMgr->clearSpecialCaseRenderQueues();
		mSceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY);
		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE);

		////////////////////////////////////
		//create resource group
		ResourceGroupManager::getSingleton().createResourceGroup("NewCity");
		
		
		ResourceGroupManager::getSingleton().declareResource(LandScape,"Mesh","NewCity");
		ResourceGroupManager::getSingleton().declareResource(Trotuare,"Mesh","NewCity");
		ResourceGroupManager::getSingleton().declareResource(Blocuri,"Mesh","NewCity");
		ResourceGroupManager::getSingleton().declareResource(Bloc21,"Mesh","NewCity");
		
		// Initialise the rest of the resource groups, parse scripts etc
		ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
		
		ResourceGroupManager::getSingleton().loadResourceGroup(
			ResourceGroupManager::getSingleton().getWorldResourceGroupName(),
			false, false);
		ResourceGroupManager::getSingleton().loadResourceGroup("NewCity",true,false);
		//////////////////////////////////////

		// Back to full rendering
		mSceneMgr->clearSpecialCaseRenderQueues();
		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);

		mLoadingBar.finish();
Pls help on this one. Tall me were I can find info on this.Or give me some code that realy work for you in doing what I want.
Would it have to do to the fact that I use the Generic SceneManager?
Kat'Oun
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

You never added any resource locations to your new group.
User avatar
katoun
Halfling
Posts: 65
Joined: Wed Mar 23, 2005 8:28 pm
Location: Romania-Bucharest
Contact:

Post by katoun »

Dosen't ExampleApplication do that automaticaly ?

Code: Select all

/// Method which will define the source of resources (other than current folder)
    virtual void setupResources(void)
    {
        // Load resource paths from config file
        ConfigFile cf;
        cf.load("resources.cfg");

        // Go through all sections & settings in the file
        ConfigFile::SectionIterator seci = cf.getSectionIterator();

        String secName, typeName, archName;
        while (seci.hasMoreElements())
        {
            secName = seci.peekNextKey();
            ConfigFile::SettingsMultiMap *settings = seci.getNext();
            ConfigFile::SettingsMultiMap::iterator i;
            for (i = settings->begin(); i != settings->end(); ++i)
            {
                typeName = i->first;
                archName = i->second;
                ResourceGroupManager::getSingleton().addResourceLocation(
                    archName, typeName, secName);
            }
        }
    }
Forgot to mention, I use the Demo_BSP source but insted of a BSP I want to load .mesh files.
Kat'Oun
Post Reply