don't warn about Sprite having the wrong number of states

This commit is contained in:
Chris Danford
2005-03-20 05:51:44 +00:00
parent cc34c9bd6b
commit 1ab61d7dde
+12 -8
View File
@@ -692,14 +692,18 @@ void Sprite::SetState( int iNewState )
// problems in debug builds, but they're not fatal.
if( iNewState < 0 || iNewState >= (int)m_States.size() )
{
CString sError;
if( m_pTexture )
sError = ssprintf("The Sprite '%s' (\"%s\") tried to set state index %d, but it has only %u states",
m_pTexture->GetID().filename.c_str(), this->m_sName.c_str(), iNewState, unsigned(m_States.size()));
else
sError = ssprintf("A Sprite (\"%s\") tried to set state index %d but no texture is loaded.",
this->m_sName.c_str(), iNewState );
Dialog::OK( sError );
// Don't warn about number of states in "_blank".
if( m_pTexture->GetID().filename.Find("_blank") == -1 )
{
CString sError;
if( m_pTexture )
sError = ssprintf("The Sprite '%s' (\"%s\") tried to set state index %d, but it has only %u states",
m_pTexture->GetID().filename.c_str(), this->m_sName.c_str(), iNewState, unsigned(m_States.size()));
else
sError = ssprintf("A Sprite (\"%s\") tried to set state index %d but no texture is loaded.",
this->m_sName.c_str(), iNewState );
Dialog::OK( sError );
}
}
CLAMP(iNewState, 0, (int)m_States.size()-1);