Thrown together Initial working implementation of pack.ini

# Conflicts:
#	src/MusicWheel.cpp
This commit is contained in:
Crash Cringle
2025-03-03 23:25:32 -08:00
committed by teejusb
parent 239d38d5aa
commit 5e6f3378a8
9 changed files with 280 additions and 32 deletions
+9
View File
@@ -276,6 +276,11 @@ const RString &Song::GetSongFilePath() const
* <set> into Song.h, which is heavily used. */
static std::set<RString> BlacklistedImages;
Pack* Song::GetPack() const
{
return SONGMAN->GetPackFromGroupName(m_sGroupName);
}
/* If PREFSMAN->m_bFastLoad is true, always load from cache if possible.
* Don't read the contents of sDir if we can avoid it. That means we can't call
* HasMusic(), HasBanner() or GetHashForDirectory().
@@ -457,11 +462,14 @@ bool Song::LoadFromSongDir(RString sDir, bool load_autosave, ProfileSlot from_pr
return true; // do load this song
}
/* This function feels EXTREMELY hacky - copying things on top of pointers so
* they don't break elsewhere. Maybe it could be rewritten to politely ask the
* Song/Steps objects to reload themselves. -- djpohly */
bool Song::ReloadFromSongDir( RString sDir )
{
LOG->Trace("Reload From Song Dir Pack Test: %s", GetPack()->m_sGroupName.c_str());
// Remove the cache file to force the song to reload from its dir instead
// of loading from the cache. -Kyz
FILEMAN->Remove(GetCacheFilePath());
@@ -469,6 +477,7 @@ bool Song::ReloadFromSongDir( RString sDir )
RemoveAutoGenNotes();
std::vector<Steps*> vOldSteps = m_vpSteps;
Song copy;
if( !copy.LoadFromSongDir( sDir ) )
return false;