Ejemplo n.º 1
0
//----------------------------------------
void CBlendGroup::Update(float frameTime)
{
	TJobVector::iterator it, end=m_jobs.end();

	for(it=m_jobs.begin();it!=end;++it)
	{
		CBlendJobNode *pNode = *it;

		if(!pNode->IsFree())
		{
			pNode->Update(frameTime);

			if(pNode->Done())
				pNode->ResetBlendJob();
		}
	}
}
//---------------------------------------------
void CBlendGroup::AddJob(IBlendType *pBlend, IBlendedEffect *pFx, float speed)
{
    TJobVector::iterator it, end = m_jobs.end();

    for(it = m_jobs.begin(); it != end; ++it)
    {
        CBlendJobNode *pNode = *it;

        if(pNode->IsFree())
        {
            pNode->Init(pBlend, pFx, speed);
            pFx->Init();
            return;
        }
    }

    //We need to add another slot
    CBlendJobNode *newJob = new CBlendJobNode();
    newJob->Init(pBlend, pFx, speed);
    pFx->Init();
    m_jobs.push_back(newJob);
}