Ensure the Group Offset is applied when Reloading a Song from Disk
This commit is contained in:
+6
-1
@@ -481,6 +481,7 @@ bool Song::ReloadFromSongDir( RString sDir )
|
|||||||
return false;
|
return false;
|
||||||
copy.RemoveAutoGenNotes();
|
copy.RemoveAutoGenNotes();
|
||||||
*this = copy;
|
*this = copy;
|
||||||
|
m_SongTiming.m_fBeat0GroupOffsetInSeconds = GetGroup()->GetSyncOffset();
|
||||||
|
|
||||||
/* Go through the steps, first setting their Song pointer to this song
|
/* Go through the steps, first setting their Song pointer to this song
|
||||||
* (instead of the copy used above), and constructing a map to let us
|
* (instead of the copy used above), and constructing a map to let us
|
||||||
@@ -489,10 +490,14 @@ bool Song::ReloadFromSongDir( RString sDir )
|
|||||||
for( std::vector<Steps*>::const_iterator it = m_vpSteps.begin(); it != m_vpSteps.end(); ++it )
|
for( std::vector<Steps*>::const_iterator it = m_vpSteps.begin(); it != m_vpSteps.end(); ++it )
|
||||||
{
|
{
|
||||||
(*it)->m_pSong = this;
|
(*it)->m_pSong = this;
|
||||||
|
|
||||||
StepsID id;
|
StepsID id;
|
||||||
id.FromSteps( *it );
|
id.FromSteps( *it );
|
||||||
mNewSteps[id] = *it;
|
mNewSteps[id] = *it;
|
||||||
|
|
||||||
|
// Reapply the Group Offset if the steps have their own timing data.
|
||||||
|
if( mNewSteps[id]->m_Timing.empty() )
|
||||||
|
continue;
|
||||||
|
mNewSteps[id]->m_Timing.m_fBeat0GroupOffsetInSeconds = GetGroup()->GetSyncOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we wipe out the new pointers, which were shallow copied and not deep copied...
|
// Now we wipe out the new pointers, which were shallow copied and not deep copied...
|
||||||
|
|||||||
Reference in New Issue
Block a user