comment, cleanup

This commit is contained in:
AJ Kelly
2011-02-21 03:11:39 -06:00
parent 7b3923aca7
commit d0459c3488
3 changed files with 16 additions and 23 deletions
+1 -4
View File
@@ -370,7 +370,6 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
} }
ASSERT( !sEffectFile.empty() ); ASSERT( !sEffectFile.empty() );
Actor *pActor = ActorUtil::MakeActor( sEffectFile ); Actor *pActor = ActorUtil::MakeActor( sEffectFile );
ASSERT( pActor ); ASSERT( pActor );
@@ -487,9 +486,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
if( g_fBGBrightness == 0.0f ) if( g_fBGBrightness == 0.0f )
return; return;
// // Choose a bunch of backgrounds that we'll use for the random file marker
// Choose a bunch of background that we'll use for the random file marker
//
{ {
vector<RString> vsThrowAway, vsNames; vector<RString> vsThrowAway, vsNames;
switch( g_RandomBackgroundMode ) switch( g_RandomBackgroundMode )
+7 -9
View File
@@ -18,18 +18,17 @@ struct TapScoreDistribution
for( int i=0; i<=TNS_W1; i++ ) for( int i=0; i<=TNS_W1; i++ )
{ {
fCumulativePercent += fPercent[i]; fCumulativePercent += fPercent[i];
if( fRand <= fCumulativePercent+1e-4 ) /* rounding error */ if( fRand <= fCumulativePercent+1e-4 ) // rounding error
return (TapNoteScore)i; return (TapNoteScore)i;
} }
ASSERT_M( 0, ssprintf("%f,%f",fRand,fCumulativePercent) ); // the fCumulativePercents must sum to 1.0, so we should never get here! // the fCumulativePercents must sum to 1.0, so we should never get here!
ASSERT_M( 0, ssprintf("%f,%f",fRand,fCumulativePercent) );
return TNS_W1; return TNS_W1;
} }
}; };
static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS]; static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS];
void PlayerAI::InitFromDisk() void PlayerAI::InitFromDisk()
{ {
bool bSuccess; bool bSuccess;
@@ -68,7 +67,6 @@ void PlayerAI::InitFromDisk()
} }
} }
TapNoteScore PlayerAI::GetTapNoteScore( const PlayerState* pPlayerState ) TapNoteScore PlayerAI::GetTapNoteScore( const PlayerState* pPlayerState )
{ {
if( pPlayerState->m_PlayerController == PC_AUTOPLAY ) if( pPlayerState->m_PlayerController == PC_AUTOPLAY )
@@ -84,10 +82,10 @@ TapNoteScore PlayerAI::GetTapNoteScore( const PlayerState* pPlayerState )
int iCpuSkill = pPlayerState->m_iCpuSkill; int iCpuSkill = pPlayerState->m_iCpuSkill;
/* If we're in battle mode, reduce the skill based on the number of modifier attacks /* If we're in battle mode, reduce the skill based on the number of modifier
* against us. If we're in demonstration or jukebox mode with modifiers attached, * attacks against us. If we're in demonstration or jukebox mode with
* don't make demonstration miss a lot. */ * modifiers attached, don't make demonstration miss a lot. */
// xxx: weight certain modifiers (boomerang, tornado) more? (to simulate // Idea: weight certain modifiers (boomerang, tornado) more? (to simulate
// readability problems) -aj // readability problems) -aj
if( !GAMESTATE->m_bDemonstrationOrJukebox ) if( !GAMESTATE->m_bDemonstrationOrJukebox )
{ {
+2 -4
View File
@@ -142,7 +142,6 @@ void SongManager::InitSongsFromDisk( LoadingWindow *ld )
LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() ); LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() );
} }
static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder \"%s\" appears to be a song folder. All song folders must reside in a group folder. For example, \"Songs/Originals/My Song\"." ); static LocalizedString FOLDER_CONTAINS_MUSIC_FILES( "SongManager", "The folder \"%s\" appears to be a song folder. All song folders must reside in a group folder. For example, \"Songs/Originals/My Song\"." );
void SongManager::SanityCheckGroupDir( RString sDir ) const void SongManager::SanityCheckGroupDir( RString sDir ) const
{ {
@@ -299,8 +298,7 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
LoadEnabledSongsFromPref(); LoadEnabledSongsFromPref();
} }
// Instead of "symlinks", songs should have membership in multiple groups. // Instead of "symlinks", songs should have membership in multiple groups. -Chris
// -Chris
void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder) void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder)
{ {
// Find all symlink files in this folder // Find all symlink files in this folder
@@ -312,7 +310,7 @@ void SongManager::LoadGroupSymLinks(RString sDir, RString sGroupFolder)
{ {
MsdFile msdF; MsdFile msdF;
msdF.ReadFile( sDir+sGroupFolder+"/"+arraySymLinks[s].c_str(), false ); // don't unescape msdF.ReadFile( sDir+sGroupFolder+"/"+arraySymLinks[s].c_str(), false ); // don't unescape
RString sSymDestination = msdF.GetParam(0,1); // Should only be 1 vale&param...period. RString sSymDestination = msdF.GetParam(0,1); // Should only be 1 value & param...period.
Song* pNewSong = new Song; Song* pNewSong = new Song;
if( !pNewSong->LoadFromSongDir( sSymDestination ) ) if( !pNewSong->LoadFromSongDir( sSymDestination ) )