Fix oddities in the music wheel when two songs use the default

banner in a row (m_size wasn't being reset so CroppedSprite messed
up)
This commit is contained in:
Glenn Maynard
2003-03-16 00:45:06 +00:00
parent f4b5b431d4
commit 1ab0823940
+8 -5
View File
@@ -141,12 +141,15 @@ void Sprite::UnloadTexture()
bool Sprite::LoadFromTexture( RageTextureID ID )
{
if( m_pTexture && m_pTexture->GetID()==ID ) // don't do anything if this texture is already loaded
return true;
if( !m_pTexture || !(m_pTexture->GetID() == ID) )
{
/* Load the texture if it's not already loaded. We still need
* to do the rest, even if it's the same texture, since we need
* to reset Sprite::m_size, etc. */
UnloadTexture();
m_pTexture = TEXTUREMAN->LoadTexture( ID );
}
UnloadTexture();
m_pTexture = TEXTUREMAN->LoadTexture( ID );
ASSERT( m_pTexture != NULL );
// the size of the sprite is the size of the image before it was scaled