background assert -> warning. This fired, but I can't repro it and the assert didn't give useful data.

This commit is contained in:
Chris Danford
2005-06-14 05:21:48 +00:00
parent ca3667576c
commit 2276b03c55
4 changed files with 61 additions and 29 deletions
+12 -4
View File
@@ -23,6 +23,7 @@
#include "XmlFile.h"
#include "BackgroundUtil.h"
#include "song.h"
#include "RageFileDriverMemory.h"
ThemeMetric<float> LEFT_EDGE ("Background","LeftEdge");
ThemeMetric<float> TOP_EDGE ("Background","TopEdge");
@@ -250,9 +251,7 @@ void BackgroundImpl::Unload()
void BackgroundImpl::Layer::Unload()
{
for( map<BackgroundDef,Actor*>::iterator iter = m_BGAnimations.begin();
iter != m_BGAnimations.end();
iter++ )
FOREACHM( BackgroundDef, Actor*, m_BGAnimations, iter )
delete iter->second;
m_BGAnimations.clear();
m_aBGChanges.clear();
@@ -766,7 +765,16 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
m_pFadingBGA = m_pCurrentBGA;
map<BackgroundDef,Actor*>::const_iterator iter = m_BGAnimations.find( change.m_def );
ASSERT( iter != m_BGAnimations.end() );
if( iter == m_BGAnimations.end() )
{
XNode *pNode = change.m_def.CreateNode();
RageFileObjMem f;
pNode->GetXML( f, NULL );
LOG->Warn( "Tried to switch to a background that was never loaded\n" + f.GetString() );
SAFE_DELETE( pNode );
return;
}
m_pCurrentBGA = iter->second;
if( m_pFadingBGA == m_pCurrentBGA )