Dobbs Challenge
Welcome, Guest
Please Login or Register.
Lost Password?
_GEN_GOTOBOTTOM Post Reply

TOPIC: Re:void CSprite::RenderAll()..stopping the render

#102
Danilo Buendia ()
Click here to see the profile of this user
void CSprite::RenderAll()..stopping the render of 2008/06/05 07:45  
If I wanted to stop the rendering of a certain sprite..in my case, the Token, how would you do it? (without hiding it)

I know it's in CSprite::RenderAll, but I don't understand how to specify the Token.

void CSprite::RenderAll(){
// Begin sprite rendering
pD3DSprite->Begin(D3DXSPRITE_ALPHABLEND);

// Loop through each sprite in allSprites
std::vector<CSprite*>::iterator s;
for (s = allSprites.begin(); s != allSprites.end(); s++)
{
// Update frame animation, if necessary
(*s)->update();

if (*s doesn't equal "collectitem*.png")<---My logic, but the implementation?!
{
// Render current frame
(*s)->render();
}
}
}

How do you acess the from inside *s?
  The administrator has disabled public write access.
#103
Rod Hyde ()
Click here to see the profile of this user
Re:void CSprite::RenderAll()..stopping the render of 2008/06/05 08:22  
Look at its z coordinate - if it is equal to SPRITE_TYPE_TOKEN then you've found the token.

--- Rod
  The administrator has disabled public write access.
#104
Danilo Buendia ()
Click here to see the profile of this user
Re:void CSprite::RenderAll()..stopping the render 2008/06/05 08:33  
YES! THAT IS EXACTLY IT! Thanks very much.
  The administrator has disabled public write access.
_GEN_GOTOTOP Post Reply
© Copyright 2007 Best of Joomla, Powered by FireBoard
DDJ