[loading window] More use of the global instead of as an argument.
This commit is contained in:
+13
-12
@@ -88,10 +88,11 @@ SongManager::~SongManager()
|
||||
FreeSongs();
|
||||
}
|
||||
|
||||
void SongManager::InitAll( LoadingWindow *ld )
|
||||
void SongManager::InitAll()
|
||||
{
|
||||
InitSongsFromDisk( ld );
|
||||
InitCoursesFromDisk( ld );
|
||||
InitSongsFromDisk();
|
||||
|
||||
InitCoursesFromDisk();
|
||||
InitAutogenCourses();
|
||||
InitRandomAttacks();
|
||||
}
|
||||
@@ -130,14 +131,14 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld )
|
||||
UpdatePreferredSort();
|
||||
}
|
||||
|
||||
void SongManager::InitSongsFromDisk( LoadingWindow *ld )
|
||||
void SongManager::InitSongsFromDisk()
|
||||
{
|
||||
RageTimer tm;
|
||||
LoadStepManiaSongDir( SpecialFiles::SONGS_DIR, ld );
|
||||
LoadStepManiaSongDir( SpecialFiles::SONGS_DIR);
|
||||
|
||||
const bool bOldVal = PREFSMAN->m_bFastLoad;
|
||||
PREFSMAN->m_bFastLoad.Set( PREFSMAN->m_bFastLoadAdditionalSongs );
|
||||
LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR, ld );
|
||||
LoadStepManiaSongDir( ADDITIONAL_SONGS_DIR );
|
||||
PREFSMAN->m_bFastLoad.Set( bOldVal );
|
||||
|
||||
LOG->Trace( "Found %d songs in %f seconds.", (int)m_pSongs.size(), tm.GetDeltaTime() );
|
||||
@@ -224,7 +225,7 @@ void SongManager::AddGroup( RString sDir, RString sGroupDirName )
|
||||
}
|
||||
|
||||
static LocalizedString LOADING_SONGS ( "SongManager", "Loading songs..." );
|
||||
void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
void SongManager::LoadStepManiaSongDir( RString sDir )
|
||||
{
|
||||
// Make sure sDir has a trailing slash.
|
||||
if( sDir.Right(1) != "/" )
|
||||
@@ -261,9 +262,9 @@ void SongManager::LoadStepManiaSongDir( RString sDir, LoadingWindow *ld )
|
||||
RString sSongDirName = arraySongDirs[j];
|
||||
|
||||
// this is a song directory. Load a new song.
|
||||
if( ld )
|
||||
if( pLoadingWindow )
|
||||
{
|
||||
ld->SetText( LOADING_SONGS.GetValue()+ssprintf("\n%s\n%s",
|
||||
pLoadingWindow->SetText( LOADING_SONGS.GetValue()+ssprintf("\n%s\n%s",
|
||||
Basename(sGroupDirName).c_str(),
|
||||
Basename(sSongDirName).c_str()));
|
||||
}
|
||||
@@ -719,7 +720,7 @@ RString SongManager::ShortenGroupName( RString sLongGroupName )
|
||||
}
|
||||
|
||||
static LocalizedString LOADING_COURSES ( "SongManager", "Loading courses..." );
|
||||
void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
|
||||
void SongManager::InitCoursesFromDisk()
|
||||
{
|
||||
LOG->Trace( "Loading courses." );
|
||||
|
||||
@@ -749,9 +750,9 @@ void SongManager::InitCoursesFromDisk( LoadingWindow *ld )
|
||||
|
||||
FOREACH_CONST( RString, vsCoursePaths, sCoursePath )
|
||||
{
|
||||
if( ld )
|
||||
if( pLoadingWindow )
|
||||
{
|
||||
ld->SetText( LOADING_COURSES.GetValue()+ssprintf("\n%s\n%s",
|
||||
pLoadingWindow->SetText( LOADING_COURSES.GetValue()+ssprintf("\n%s\n%s",
|
||||
Basename(*sCourseGroup).c_str(),
|
||||
Basename(*sCoursePath).c_str()));
|
||||
}
|
||||
|
||||
+5
-6
@@ -1,7 +1,6 @@
|
||||
#ifndef SONGMANAGER_H
|
||||
#define SONGMANAGER_H
|
||||
|
||||
class LoadingWindow;
|
||||
class Song;
|
||||
class Style;
|
||||
class Steps;
|
||||
@@ -31,7 +30,7 @@ public:
|
||||
SongManager();
|
||||
~SongManager();
|
||||
|
||||
void InitSongsFromDisk( LoadingWindow *ld );
|
||||
void InitSongsFromDisk();
|
||||
void FreeSongs();
|
||||
void Cleanup();
|
||||
|
||||
@@ -49,7 +48,7 @@ public:
|
||||
|
||||
void LoadGroupSymLinks( RString sDir, RString sGroupFolder );
|
||||
|
||||
void InitCoursesFromDisk( LoadingWindow *ld );
|
||||
void InitCoursesFromDisk();
|
||||
void InitAutogenCourses();
|
||||
void InitRandomAttacks();
|
||||
void FreeCourses();
|
||||
@@ -59,8 +58,8 @@ public:
|
||||
void DeleteAutogenCourses();
|
||||
void InvalidateCachedTrails();
|
||||
|
||||
void InitAll( LoadingWindow *ld ); // songs, courses, groups - everything.
|
||||
void Reload( bool bAllowFastLoad, LoadingWindow *ld=NULL ); // songs, courses, groups - everything.
|
||||
void InitAll(); // songs, courses, groups - everything.
|
||||
void Reload( bool bAllowFastLoad); // songs, courses, groups - everything.
|
||||
void PreloadSongImages();
|
||||
|
||||
RString GetSongGroupBannerPath( RString sSongGroup ) const;
|
||||
@@ -166,7 +165,7 @@ public:
|
||||
void PushSelf( lua_State *L );
|
||||
|
||||
protected:
|
||||
void LoadStepManiaSongDir( RString sDir, LoadingWindow *ld );
|
||||
void LoadStepManiaSongDir( RString sDir );
|
||||
void LoadDWISongDir( RString sDir );
|
||||
bool GetExtraStageInfoFromCourse( bool bExtra2, RString sPreferredGroup, Song*& pSongOut, Steps*& pStepsOut );
|
||||
void SanityCheckGroupDir( RString sDir ) const;
|
||||
|
||||
+1
-1
@@ -1073,7 +1073,7 @@ int main(int argc, char* argv[])
|
||||
INPUTQUEUE = new InputQueue;
|
||||
pLoadingWindow->SetText("Building song cache index...");
|
||||
SONGINDEX = new SongCacheIndex;
|
||||
pLoadingWindow->SetText("Building banner cache...");
|
||||
pLoadingWindow->SetText("Loading banner cache...");
|
||||
BANNERCACHE = new BannerCache;
|
||||
//BACKGROUNDCACHE = new BackgroundCache;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user