//-----------------------------------
void CBlendGroup::Reset()
{
    TJobVector::iterator it, end = m_jobs.end();

    for(it = m_jobs.begin(); it != end; ++it)
    {
        CBlendJobNode *pNode = *it;
        pNode->ResetBlendJob();
    }
}
예제 #2
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);
}