#include "pvr.h"

/// <summary>
/// 
/// </summary>
PVR::cDisplayListQueue::cDisplayListQueue()
{
	//todo
	//no op?
}

void PVR::cDisplayListQueue::Add(PVR::cBatchedQuad* item)
{
	m_vQuads.push_back(item);
}

void PVR::cDisplayListQueue::Clear()
{
	if (m_vQuads.size() > 0)
	{
		for (vector<cBatchedQuad*>::iterator pQuad = m_vQuads.begin(); pQuad != m_vQuads.end(); ++pQuad)
		{
			if (pQuad != m_vQuads.end())
			{
				cBatchedQuad *p = (*pQuad);
				if (!p->m_bIsPersistent)
				{
					delete p;
				}				
			}			
		}
		m_vQuads.clear();
	}	
}

void PVR::cDisplayListQueue::Lock()
{
	m_bLocked = true;
}

void PVR::cDisplayListQueue::Unlock()
{
	m_bLocked = false;
}

bool PVR::cDisplayListQueue::IsLocked()
{
	return m_bLocked;
}