Ensure Group offset is always applied
This commit is contained in:
+2
-2
@@ -30,7 +30,7 @@ Group::Group() {
|
|||||||
m_sGroupName = "";
|
m_sGroupName = "";
|
||||||
m_sTranslitTitle = "";
|
m_sTranslitTitle = "";
|
||||||
m_sSeries = "";
|
m_sSeries = "";
|
||||||
m_fSyncOffset = 0;
|
m_fSyncOffset = 0.0f;
|
||||||
m_bHasPackIni = false;
|
m_bHasPackIni = false;
|
||||||
m_iYearReleased = 0;
|
m_iYearReleased = 0;
|
||||||
m_sBannerPath = "";
|
m_sBannerPath = "";
|
||||||
@@ -57,7 +57,7 @@ Group::Group(const RString& sDir, const RString& sGroupDirName, bool bFromProfil
|
|||||||
m_sSortTitle = m_sGroupName;
|
m_sSortTitle = m_sGroupName;
|
||||||
m_sTranslitTitle = m_sGroupName;
|
m_sTranslitTitle = m_sGroupName;
|
||||||
m_sSeries = "";
|
m_sSeries = "";
|
||||||
m_fSyncOffset = PREFSMAN->m_DefaultSyncOffset == SyncOffset_NULL ? 0 : -0.009;
|
m_fSyncOffset = PREFSMAN->m_DefaultSyncOffset == SyncOffset_NULL ? 0.0f : -0.009f;
|
||||||
m_bHasPackIni = false;
|
m_bHasPackIni = false;
|
||||||
m_iYearReleased = 0;
|
m_iYearReleased = 0;
|
||||||
m_sBannerPath = "";
|
m_sBannerPath = "";
|
||||||
|
|||||||
+12
-1
@@ -386,7 +386,6 @@ bool Song::LoadFromSongDir(RString sDir, bool load_autosave, ProfileSlot from_pr
|
|||||||
LoadEditsFromSongDir(sDir);
|
LoadEditsFromSongDir(sDir);
|
||||||
|
|
||||||
TidyUpData(false, true);
|
TidyUpData(false, true);
|
||||||
|
|
||||||
// Don't save a cache file if the autosave is being loaded, because the
|
// Don't save a cache file if the autosave is being loaded, because the
|
||||||
// cache file would contain the autosave filename. -Kyz
|
// cache file would contain the autosave filename. -Kyz
|
||||||
// Songs loaded from removable profile are never cached, on the
|
// Songs loaded from removable profile are never cached, on the
|
||||||
@@ -429,8 +428,20 @@ bool Song::LoadFromSongDir(RString sDir, bool load_autosave, ProfileSlot from_pr
|
|||||||
m_sCDTitleFile.clear();
|
m_sCDTitleFile.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Normally TidyUpData would handle setting the m_fBeat0GroupOffsetInSeconds.
|
||||||
|
// That is to keep the song start and end times become inaccurate in some cases.
|
||||||
|
// SInce there are cases where TidyUpData isn't called, we still want to guarantee the
|
||||||
|
// m_fBeat0GroupOffsetInSeconds is always set so we do that here.
|
||||||
|
float fOffset = PREFSMAN->m_DefaultSyncOffset == SyncOffset_NULL ? 0 : -0.009;
|
||||||
|
if (SONGMAN->GetGroupFromName(m_sGroupName) != nullptr)
|
||||||
|
{
|
||||||
|
fOffset = SONGMAN->GetGroupFromName(m_sGroupName)->GetSyncOffset();
|
||||||
|
}
|
||||||
|
m_SongTiming.m_fBeat0GroupOffsetInSeconds = fOffset;
|
||||||
|
|
||||||
for (Steps *s : m_vpSteps)
|
for (Steps *s : m_vpSteps)
|
||||||
{
|
{
|
||||||
|
s->m_Timing.m_fBeat0GroupOffsetInSeconds = fOffset;
|
||||||
if(m_LoadedFromProfile != ProfileSlot_Invalid)
|
if(m_LoadedFromProfile != ProfileSlot_Invalid)
|
||||||
{
|
{
|
||||||
s->ChangeFilenamesForCustomSong();
|
s->ChangeFilenamesForCustomSong();
|
||||||
|
|||||||
+1
-1
@@ -415,7 +415,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this->m_fBeat0OffsetInSeconds == other.m_fBeat0OffsetInSeconds;
|
return this->m_fBeat0OffsetInSeconds == other.m_fBeat0OffsetInSeconds && this->m_fBeat0GroupOffsetInSeconds == other.m_fBeat0GroupOffsetInSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user