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