Add error output, simplify

This commit is contained in:
Glenn Maynard
2003-03-05 09:51:32 +00:00
parent 4f120731aa
commit f5116967a8
+23 -19
View File
@@ -576,27 +576,31 @@ void Song::TidyUpData()
continue; // skip continue; // skip
SDL_Surface *img = IMG_Load( m_sSongDir + arrayImages[i] ); SDL_Surface *img = IMG_Load( m_sSongDir + arrayImages[i] );
if( img ) if( !img )
{ {
int width = img->w; LOG->Trace("Couldn't load %s%s: %s",
int height = img->h; m_sSongDir.GetString(), arrayImages[i].GetString(), SDL_GetError());
SDL_FreeSurface( img ); continue;
}
if( !HasBackground() && width >= 320 && height >= 240 ) const int width = img->w;
{ const int height = img->h;
m_sBackgroundFile = arrayImages[i]; SDL_FreeSurface( img );
continue;
} if( !HasBackground() && width >= 320 && height >= 240 )
if( !HasBanner() && 100<=width && width<=320 && 50<=height && height<=240 ) {
{ m_sBackgroundFile = arrayImages[i];
m_sBannerFile = arrayImages[i]; continue;
continue; }
} if( !HasBanner() && 100<=width && width<=320 && 50<=height && height<=240 )
if( !HasCDTitle() && width<=100 && height<=50 ) {
{ m_sBannerFile = arrayImages[i];
m_sCDTitleFile = arrayImages[i]; continue;
continue; }
} if( !HasCDTitle() && width<=100 && height<=50 )
{
m_sCDTitleFile = arrayImages[i];
continue;
} }
} }