From 1246e086f2d28f8793008e11ac693df79bc64441 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 5 Jun 2004 08:20:07 +0000 Subject: [PATCH] Only create autogen steps pointers if steps autogen is enabled. This fixes random courses taking too long to generate with autogen disabled: it has to iterate over *all* steps (including the unused autogen steps); when outputting the catalog, this means it has to iterate over every song once per random course line per steps type per course difficulty. (test case of one 9-random-entry course with autogen off: ~10 seconds -> ~1.5 seconds; still too much) --- stepmania/src/Song.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index c37e05d7e5..f25245a3a7 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -1091,6 +1091,10 @@ void Song::AddAutoGenNotes() if( HasNotes[stMissing] ) continue; + /* If m_bAutogenSteps is disabled, only autogen lights. */ + if( !PREFSMAN->m_bAutogenSteps && stMissing != STEPS_TYPE_LIGHTS_CABINET ) + continue; + // missing Steps of this type int iNumTracksOfMissing = GAMEMAN->NotesTypeToNumTracks(stMissing);