stop accessing m_vpSteps directly
This commit is contained in:
@@ -454,7 +454,7 @@ bool BMSLoader::LoadFromDir( CString sDir, Song &out )
|
|||||||
const bool ok = LoadFromBMSFile( out.GetSongDir() + arrayBMSFileNames[i],
|
const bool ok = LoadFromBMSFile( out.GetSongDir() + arrayBMSFileNames[i],
|
||||||
*pNewNotes );
|
*pNewNotes );
|
||||||
if( ok )
|
if( ok )
|
||||||
out.m_vpSteps.push_back( pNewNotes );
|
out.AddSteps( pNewNotes );
|
||||||
else
|
else
|
||||||
delete pNewNotes;
|
delete pNewNotes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ bool DWILoader::LoadFromDWIFile( CString sPath, Song &out )
|
|||||||
*pNewNotes
|
*pNewNotes
|
||||||
);
|
);
|
||||||
if(pNewNotes->m_StepsType != STEPS_TYPE_INVALID)
|
if(pNewNotes->m_StepsType != STEPS_TYPE_INVALID)
|
||||||
out.m_vpSteps.push_back( pNewNotes );
|
out.AddSteps( pNewNotes );
|
||||||
else
|
else
|
||||||
delete pNewNotes;
|
delete pNewNotes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ bool KSFLoader::LoadFromDir( CString sDir, Song &out )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
out.m_vpSteps.push_back( pNewNotes );
|
out.AddSteps( pNewNotes );
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ bool SMLoader::LoadFromSMFile( CString sPath, Song &out )
|
|||||||
{
|
{
|
||||||
Steps* pNewNotes = new Steps;
|
Steps* pNewNotes = new Steps;
|
||||||
ASSERT( pNewNotes );
|
ASSERT( pNewNotes );
|
||||||
out.m_vpSteps.push_back( pNewNotes );
|
out.AddSteps( pNewNotes );
|
||||||
|
|
||||||
if( iNumParams < 7 )
|
if( iNumParams < 7 )
|
||||||
{
|
{
|
||||||
@@ -456,7 +456,7 @@ bool SMLoader::LoadEdit( CString sEditFilePath, ProfileSlot slot )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pSong->m_vpSteps.push_back( pNewNotes );
|
pSong->AddSteps( pNewNotes );
|
||||||
return true; // Only allow one Steps per edit file!
|
return true; // Only allow one Steps per edit file!
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -277,7 +277,10 @@ void SongManager::LoadGroupSymLinks(CString sDir, CString sGroupFolder)
|
|||||||
delete pNewSong; // The song failed to load.
|
delete pNewSong; // The song failed to load.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pNewSong->m_vpSteps.clear(); // No memory hogs..
|
const vector<Steps*>& vpSteps = pNewSong->GetAllSteps();
|
||||||
|
while( vpSteps.size() )
|
||||||
|
pNewSong->RemoveSteps( vpSteps[0] );
|
||||||
|
|
||||||
pNewSong->m_BackgroundChanges.clear();
|
pNewSong->m_BackgroundChanges.clear();
|
||||||
|
|
||||||
pNewSong->m_bIsSymLink = true; // Very important so we don't double-parse later
|
pNewSong->m_bIsSymLink = true; // Very important so we don't double-parse later
|
||||||
|
|||||||
Reference in New Issue
Block a user