void CGraphicsInstance::Update(void)
{
	CLightInstance*	pcLight;
	int				iLight;
	int				i;

	if (!CanDraw())
	{
		return;
	}

	iLight = 0;
	for (i = 0; i < mpcWorld->mcWorldLightList.NumElements(); i++)
	{
		pcLight = mpcWorld->mcWorldLightList.Get(i);
		if (pcLight->IsEnabled())
		{
			if (mapLights.NumElements() > iLight)
			{
				mapLights.Set(iLight, &pcLight);
			}
			else
			{
				mapLights.Add(&pcLight);
			}
			iLight ++;
		}
	}

	if (iLight != mapLights.NumElements())
	{
		mapLights.GrowToNumElements(iLight);
	}
}
Example #2
0
void Appartenance::Draw(int state)
{
    if(CanDraw(state))
    {
//        _window.Draw(_shape);
        _window.Draw(_str);
    }
}
Example #3
0
void Button::Draw(int state)
{
	if(CanDraw(state))
	{
		_window.Draw(_rect);
		_window.Draw(_text);
	}
}
void CTableCellAnimationRight::UpdateForAnimation()
{
    if(!CanDraw())
        return;

    if(m_nX > m_nStartX + CELL_RENDER_SIZE)
        m_bComplete = true;
    else
        m_nX += SPEED_ANIMATION;
}
void CTableCellAnimationUp::UpdateForAnimation()
{
    if(!CanDraw())
        return;

    if(m_nY < m_nStartY - CELL_RENDER_SIZE)
        m_bComplete = true;
    else
        m_nY -= SPEED_ANIMATION;
}
//This animation will only draw a portion of resource on the top row of the table board 
void CTableCellAnimationDrop::UpdateForAnimation()
{
    if(!CanDraw())
        return;

    SDL_Surface* pImage = CGemsResources::GetInstance().ResourceFor(m_resource);
    if(!pImage)
        return;

    if(m_nImgHeight > pImage->h + (CELL_RENDER_SIZE - pImage->h) / 2)
        m_bComplete = true;
    else
        m_nImgHeight++;
}
void CGraphicsInstance::Draw(void)
{

	if (!CanDraw())
	{
		return;
	}

	//Copy the instances controlling matrix pointers over the objects.  This allows object to be drawn at different positions in the safe frame.
	memcpy_fast(mpcGraphicsObject->GetMatricies()->GetData(), mapMatrices.GetData(), mapMatrices.ByteSize());

	//Copy the instances states over the objects.  This allows different types of filtering on the same object... is it really necessary?
	memcpy_fast(mpcGraphicsObject->GetStates()->GetData(), mapStates.GetData(), mapStates.ByteSize());

	//Copy the instances materials over the objects.  This allows different textures on the same object...
	memcpy_fast(mpcGraphicsObject->GetMaterials()->GetData(), mapMaterials.GetData(), mapMaterials.ByteSize());

	mpcWorld->UseLights(&mapLights);

	//Draw the updated object.
	ReverseCullAsNecessary();
	mpcGraphicsObject->Draw();
	UnreverseCullAsNecessary();
}
Example #8
0
void Hotel::Draw(int state)
{
    if(CanDraw(state))
        _window.Draw(_rectangle);
}
Example #9
0
void Maison::Draw(int state)
{
    if(CanDraw(state))
        _window.Draw(_rectangle);
}