don't warn about Sprite having the wrong number of states
This commit is contained in:
@@ -692,14 +692,18 @@ void Sprite::SetState( int iNewState )
|
|||||||
// problems in debug builds, but they're not fatal.
|
// problems in debug builds, but they're not fatal.
|
||||||
if( iNewState < 0 || iNewState >= (int)m_States.size() )
|
if( iNewState < 0 || iNewState >= (int)m_States.size() )
|
||||||
{
|
{
|
||||||
CString sError;
|
// Don't warn about number of states in "_blank".
|
||||||
if( m_pTexture )
|
if( m_pTexture->GetID().filename.Find("_blank") == -1 )
|
||||||
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()));
|
CString sError;
|
||||||
else
|
if( m_pTexture )
|
||||||
sError = ssprintf("A Sprite (\"%s\") tried to set state index %d but no texture is loaded.",
|
sError = ssprintf("The Sprite '%s' (\"%s\") tried to set state index %d, but it has only %u states",
|
||||||
this->m_sName.c_str(), iNewState );
|
m_pTexture->GetID().filename.c_str(), this->m_sName.c_str(), iNewState, unsigned(m_States.size()));
|
||||||
Dialog::OK( sError );
|
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);
|
CLAMP(iNewState, 0, (int)m_States.size()-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user