From 474875f7cb0f98c0a3b6609047eba64d9aace30e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 23 Jun 2003 23:00:49 +0000 Subject: [PATCH] move song cache into a subdir --- stepmania/src/Song.cpp | 2 +- stepmania/src/SongCacheIndex.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index a8b774bb4d..eb4fa95429 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -277,7 +277,7 @@ float Song::GetElapsedTimeFromBeat( float fBeat ) const CString Song::GetCacheFilePath() const { - return ssprintf( "Cache/%u", GetHashForString(m_sSongDir) ); + return ssprintf( "Cache/Songs/%u", GetHashForString(m_sSongDir) ); } /* Get a path to the SM containing data for this song. It might diff --git a/stepmania/src/SongCacheIndex.cpp b/stepmania/src/SongCacheIndex.cpp index 876b893235..9608e506e0 100644 --- a/stepmania/src/SongCacheIndex.cpp +++ b/stepmania/src/SongCacheIndex.cpp @@ -12,7 +12,7 @@ SongCacheIndex *SONGINDEX; SongCacheIndex::SongCacheIndex() { - mkdir("Cache", 0755); + CreateDirectories( "Cache/Songs" ); CacheIndex.SetPath( "Cache/index.cache" ); ReadCacheIndex(); } @@ -50,6 +50,7 @@ void SongCacheIndex::ReadCacheIndex() LOG->Trace( "Cache format is out of date. Deleting all cache files." ); EmptyDir( "Cache/" ); EmptyDir( "Cache/Banners/" ); + EmptyDir( "Cache/Songs/" ); CacheIndex.Reset(); }