From 403d7a9660f5ab9a82cae6903e58826390d24a1d Mon Sep 17 00:00:00 2001 From: Patrick McIlroy Date: Tue, 20 Jul 2010 00:48:52 +0000 Subject: [PATCH] - Fixes UserPack deletion bug - trivial whitespace corrections to Song.cpp and ProfileManager.cpp git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg/branches/dev@767 83fadc84-e282-4d84-a09a-c4228d6ae7e5 --- src/ProfileManager.cpp | 2 +- src/ScreenUserPacks.cpp | 2 +- src/Song.cpp | 18 ++---------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 93608804..ed9d4a20 100755 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -78,7 +78,7 @@ void ProfileManager::GetLocalProfileNames( vector &asNamesOut ) const Profile::LoadResult ProfileManager::LoadProfile( PlayerNumber pn, CString sProfileDir, bool bIsMemCard ) { - LOG->Trace( "LoadingProfile P%d, %s, %d", pn+1, sProfileDir.c_str(), bIsMemCard ); + LOG->Trace( "LoadingProfile P%d, %s, %d", pn+1, sProfileDir.c_str(), bIsMemCard ); ASSERT( !sProfileDir.empty() ); ASSERT( sProfileDir.Right(1) == "/" ); diff --git a/src/ScreenUserPacks.cpp b/src/ScreenUserPacks.cpp index 66bcb7bb..35c6dada 100644 --- a/src/ScreenUserPacks.cpp +++ b/src/ScreenUserPacks.cpp @@ -262,7 +262,7 @@ void ScreenUserPacks::HandleScreenMessage( const ScreenMessage SM ) return; CString sSelection = m_AddedZips.GetCurrentSelection(); g_CurSelection = sSelection; - bool bSuccess = UPACKMAN->Remove( USER_PACK_SAVE_PATH + "/" + sSelection ); + bool bSuccess = UPACKMAN->Remove( USER_PACK_SAVE_PATH + sSelection ); if (bSuccess) { m_SoundDelete.Play(); diff --git a/src/Song.cpp b/src/Song.cpp index 86c46f0f..8afedc34 100755 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -217,7 +217,7 @@ static set BlacklistedImages; */ bool Song::LoadFromSongDir( CString sDir ) { -// LOG->Trace( "Song::LoadFromSongDir(%s)", sDir.c_str() ); + // LOG->Trace( "Song::LoadFromSongDir(%s)", sDir.c_str() ); ASSERT( sDir != "" ); // make sure there is a trailing slash at the end of sDir @@ -266,6 +266,7 @@ bool Song::LoadFromSongDir( CString sDir ) } bool success = ld->LoadFromDir( sDir, *this ); + BlacklistedImages = ld->GetBlacklistedImages(); if(!success) @@ -282,8 +283,6 @@ bool Song::LoadFromSongDir( CString sDir ) // save a cache file so we don't have to parse it all over again next time SaveToCacheFile(); } - - FOREACH( Steps*, m_vpSteps, s ) { @@ -391,15 +390,12 @@ void Song::DeleteDuplicateSteps( vector &vSteps ) { /* vSteps have the same StepsType and Difficulty. Delete them if they have the * same m_sDescription, m_iMeter and SMNoteData. */ - CHECKPOINT; for( unsigned i=0; iGetDescription() != s2->GetDescription() ) @@ -666,8 +662,6 @@ void Song::TidyUpData() // image is the banner, which is the background, and which is the CDTitle. // - CHECKPOINT_M( "Looking for images..." ); - // // First, check the file name for hints. // @@ -808,7 +802,6 @@ void Song::TidyUpData() if( HasBanner() ) BANNERCACHE->CacheBanner( GetBannerPath() ); - // If no BGChanges are specified and there are movies in the song directory, then assume // they are DWI style where the movie begins at beat 0. if( !HasBGChanges() ) @@ -826,7 +819,6 @@ void Song::TidyUpData() this->AddBackgroundChange( BACKGROUND_LAYER_1, BackgroundChange(0,arrayPossibleMovies[0],"",1.f,SBE_StretchNoLoop) ); } - /* Don't allow multiple Steps of the same StepsType and Difficulty (except for edits). * We should be able to use difficulty names as unique identifiers for steps. */ AdjustDuplicateSteps(); @@ -885,7 +877,6 @@ void Song::ReCalculateRadarValuesAndLastBeat( float fSeconds ) { float fFirstBeat = FLT_MAX; /* inf */ float fLastBeat = 0; - CHECKPOINT; // fix for rare case ogglengthpatch wankery if ( fSeconds <= 1.0f ) @@ -907,14 +898,10 @@ void Song::ReCalculateRadarValuesAndLastBeat( float fSeconds ) if( pSteps->IsAutogen() ) continue; - CHECKPOINT_M( m_sSongFileName + " begin"); - /* Don't calculate based off edits from the machine profile. Use them * only if they were in the original .SM file to begin with. */ if( pSteps->IsAPlayerEdit() ) continue; - - CHECKPOINT_M( m_sSongFileName + " end"); // Don't set first/last beat based on lights. They often start very // early and end very late. @@ -933,7 +920,6 @@ void Song::ReCalculateRadarValuesAndLastBeat( float fSeconds ) fLastBeat = max( fLastBeat, tempNoteData.GetLastBeat() ); } - CHECKPOINT_M( m_sSongFileName + " tail" ); m_fFirstBeat = fFirstBeat; m_fLastBeat = fLastBeat; } -- 2.11.0