Move cache indexing into a global object. Only load the cache file once, instead of for each song loaded. (Speedup, and simplifies Song.cpp.)

It's still written over for each file; this way, if a file load crashes, the earlier files will still be written to cache.
This commit is contained in:
Glenn Maynard
2002-08-21 02:13:08 +00:00
parent 22f558bf34
commit 9e9e012310
6 changed files with 84 additions and 29 deletions
+4
View File
@@ -41,6 +41,7 @@
#include "InputFilter.h"
#include "InputMapper.h"
#include "InputQueue.h"
#include "SongCacheIndex.h"
//
// StepMania common classes
@@ -666,6 +667,8 @@ HRESULT CreateObjects( HWND hWnd )
INPUTFILTER = new InputFilter();
INPUTMAPPER = new InputMapper();
INPUTQUEUE = new InputQueue();
SONGINDEX = new SongCacheIndex();
/* depends on SONGINDEX: */
SONGMAN = new SongManager( PaintLoadingWindow ); // this takes a long time to load
DISPLAY = new RageDisplay( hWnd );
@@ -714,6 +717,7 @@ void DestroyObjects()
SAFE_DELETE( INPUTMAPPER );
SAFE_DELETE( INPUTFILTER );
SAFE_DELETE( SONGMAN );
SAFE_DELETE( SONGINDEX );
SAFE_DELETE( PREFSMAN );
SAFE_DELETE( GAMESTATE );
SAFE_DELETE( GAMEMAN );