From 1ab0823940f4dd8dcf55eed3259253fa95bbb8f5 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 16 Mar 2003 00:45:06 +0000 Subject: [PATCH] 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) --- stepmania/src/Sprite.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index 322a7fd783..f7ce0c81fa 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -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