From c8e4d02641ca2ad83a84e67a54ec483329372049 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 29 Dec 2003 23:19:41 +0000 Subject: [PATCH] Optimize autogen pointer creation (~20% less CPU during cached loads) --- stepmania/src/Song.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index b18130f51d..80dbf4857b 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -1013,11 +1013,21 @@ void Song::SaveToDWIFile() void Song::AddAutoGenNotes() { - for( StepsType ntMissing=(StepsType)0; ntMissingIsAutogen() ) continue; + StepsType nt = m_apNotes[i]->m_StepsType; + HasNotes[nt] = true; + } + + for( StepsType ntMissing=(StepsType)0; ntMissingNotesTypeToNumTracks(ntMissing); @@ -1028,9 +1038,10 @@ void Song::AddAutoGenNotes() for( StepsType nt=(StepsType)0; ntNotesTypeToNumTracks(nt); const int iTrackDifference = abs(iNumTracks-iNumTracksOfMissing); if( iTrackDifference < iBestTrackDifference )