Пример #1
0
	ResCache::~ResCache()
	{
		while (!m_lruResources.empty())
		{
			FreeOneResource();
		}
	}
Пример #2
0
ResCache::~ResCache()
{
	while (!m_lru.empty())
	{
		FreeOneResource();
	}
	SAFE_DELETE(m_file);
}
Пример #3
0
ResourceManager::~ResourceManager()
{
    while (!this->lru.empty())
    {
        FreeOneResource();
    }

    this->resources.clear();
}
Пример #4
0
//************************************
// Method:    MakeRoom
// FullName:  ResCache::MakeRoom
// Access:    protected 
// Returns:   bool
// Qualifier:
// Parameter: unsigned int size
//************************************
bool ResCache::MakeRoom(unsigned int size)
{	
	if(size > m_cacheSize)
	{
		return false;
	}

	while(size >(m_cacheSize - m_allocated))
	{
		if (m_lru.empty())
			return false;

		FreeOneResource();
	}

	return true;
}
Пример #5
0
bool ResourceCache::MakeRoom(unsigned int uSize)
{
	if (uSize > m_uCacheSize)
	{
		return false;
	}

	while (uSize > (m_uCacheSize - m_uAllocated))
	{
		//cache is empty and it's still not enough room to allocated the resource
		if (m_lru.empty())
			return false;

		FreeOneResource();
	}

	return true;
}
Пример #6
0
	bool ResCache::MakeRoom(unsigned int size)
	{
		if (size > m_cacheSize)
		{
			return false;
		}

		// return null if there's no possible way to allocate the memory
		while (size > (m_cacheSize - m_allocated))
		{
			// The cache is empty, and there's still not enough room.
			if (m_lruResources.empty())
				return false;

			FreeOneResource();
		}

		return true;
	}
Пример #7
0
bool ResourceManager::MakeRoom(unsigned int size)
{
    if (size > this->cacheSize)
    {
        return false;
    }

    while (size > (this->cacheSize - this->allocatedSize))
    {
        if (this->lru.empty())
        {
            // The cache is empty, and there's still not enough room.
            return false;
        }

        FreeOneResource();
    }

    return true;
}