From ee791b9c9c63835aeab5123d1f467f0104be9349 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 16 Jul 2005 03:10:59 +0000 Subject: [PATCH] fix copying when unloaded --- stepmania/src/BitmapText.cpp | 5 ++++- stepmania/src/Sprite.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index a61c1d7602..4a22a403b6 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -97,7 +97,10 @@ BitmapText::BitmapText( const BitmapText &cpy ): CPY( m_pTextures ); #undef CPY - m_pFont = FONT->CopyFont( cpy.m_pFont ); + if( cpy.m_pFont != NULL ) + m_pFont = FONT->CopyFont( cpy.m_pFont ); + else + m_pFont = NULL; } void BitmapText::LoadFromNode( const CString& sDir, const XNode* pNode ) diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index f423a15b1b..b32e1b4c33 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -59,7 +59,10 @@ Sprite::Sprite( const Sprite &cpy ): CPY( m_fTexCoordVelocityY ); #undef CPY - m_pTexture = TEXTUREMAN->CopyTexture( cpy.m_pTexture ); + if( cpy.m_pTexture != NULL ) + m_pTexture = TEXTUREMAN->CopyTexture( cpy.m_pTexture ); + else + m_pTexture = NULL; } RageTextureID Sprite::SongBGTexture( RageTextureID ID )