Esempio n. 1
0
	//-----------------------------------------------------------------------
	void ResourceManager::remove(ResourceHandle handle)
	{
		ResourcePtr res = getByHandle(handle);

		if (!res.isNull())
		{
			removeImpl(res);
		}
	}
Esempio n. 2
0
	//-----------------------------------------------------------------------
	void ResourceManager::unload(ResourceHandle handle)
	{
		ResourcePtr res = getByHandle(handle);

		if (!res.isNull())
		{
			// Unload resource
			res->unload();

		}
	}
Esempio n. 3
0
    //-----------------------------------------------------------------------
    void ResourceManager::remove(ResourceHandle handle)
    {
        ResourcePtr res = getByHandle(handle);

#if OGRE_RESOURCEMANAGER_STRICT
        OgreAssert(res, "attempting to remove unknown resource");
#endif

        if (res)
        {
            removeImpl(res);
        }
    }
Esempio n. 4
0
    //-----------------------------------------------------------------------
    void ResourceManager::unload(ResourceHandle handle)
    {
        ResourcePtr res = getByHandle(handle);

#if OGRE_RESOURCEMANAGER_STRICT
        OgreAssert(res, "attempting to unload unknown resource");
#endif

        if (res)
        {
            res->unload();
        }
    }
	//-----------------------------------------------------------------------
	void CachedResourceOgreManager::frameRenderingQueued(const FrameEvent& _evt)
	{
		NumFramesNotUsedMap::iterator it = mNumFramesNotUsedMap.begin();
		while(it != mNumFramesNotUsedMap.end())
		{
			ResourceHandle handle = it->first;
			size_t& numFramesNotUsed = (it++)->second;
			if(numFramesNotUsed++ > mNumFramesBeforeUnload)
			{
				ResourcePtr resource = getByHandle(handle);
				resource->unload();
			}
		}
	}