From 0298438390d8628e80dfb0540bf68c063efc20d9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 28 Apr 2007 22:06:36 +0000 Subject: [PATCH] do less work if iIndex specified --- stepmania/src/StepMania.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index e9abbff2d1..49f1aa15b6 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1115,15 +1115,6 @@ int main(int argc, char* argv[]) RString StepMania::SaveScreenshot( RString sDir, bool bSaveCompressed, bool bMakeSignature, int iIndex ) { - // - // Find a file name for the screenshot - // - FILEMAN->FlushDirCache( sDir ); - - vector files; - GetDirListing( sDir + "screen*", files, false, false ); - sort( files.begin(), files.end() ); - /* Files should be of the form "screen#####.xxx". Ignore the extension; find * the last file of this form, and use the next number. This way, we don't * write the same screenshot number for different formats (screen00011.bmp, @@ -1131,6 +1122,15 @@ RString StepMania::SaveScreenshot( RString sDir, bool bSaveCompressed, bool bMak * is deleted, we won't fill in the hole (which makes screenshots hard to find). */ if( iIndex == -1 ) { + // + // Find a file name for the screenshot + // + FILEMAN->FlushDirCache( sDir ); + + vector files; + GetDirListing( sDir + "screen*", files, false, false ); + sort( files.begin(), files.end() ); + iIndex = 0; for( int i = files.size()-1; i >= 0; --i )