break off GetExtraStageInfoFromCourse
This commit is contained in:
@@ -474,27 +474,32 @@ void SongManager::ReloadCourses()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SongManager::GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
|
||||||
|
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out )
|
||||||
|
{
|
||||||
|
CString sCoursePath = "Songs\\" + sPreferredGroup + "\\" + (bExtra2 ? "extra2" : "extra1") + ".crs";
|
||||||
|
if( !DoesFileExist(sCoursePath) ) return false;
|
||||||
|
|
||||||
|
Course course;
|
||||||
|
course.LoadFromCRSFile( sCoursePath, m_pSongs );
|
||||||
|
if( course.m_iStages <= 0 ) return false;
|
||||||
|
|
||||||
|
pSongOut = course.m_apSongs[0];
|
||||||
|
pNotesOut = course.GetNotesForStage( 0 );
|
||||||
|
if( pNotesOut == NULL ) return false;
|
||||||
|
|
||||||
|
po_out.FromString( course.m_asModifiers[0] );
|
||||||
|
so_out.FromString( course.m_asModifiers[0] );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void SongManager::GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, NotesType nt,
|
void SongManager::GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, NotesType nt,
|
||||||
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out )
|
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out )
|
||||||
{
|
{
|
||||||
{
|
if(GetExtraStageInfoFromCourse(bExtra2, sPreferredGroup,
|
||||||
CString sCoursePath = "Songs\\" + sPreferredGroup + "\\" + (bExtra2 ? "extra2" : "extra1") + ".crs";
|
pSongOut, pNotesOut, po_out, so_out))
|
||||||
if( !DoesFileExist(sCoursePath) )
|
|
||||||
goto load_from_course_failed;
|
|
||||||
Course course;
|
|
||||||
course.LoadFromCRSFile( sCoursePath, m_pSongs );
|
|
||||||
if( course.m_iStages <= 0 )
|
|
||||||
goto load_from_course_failed;
|
|
||||||
pSongOut = course.m_apSongs[0];
|
|
||||||
pNotesOut = course.GetNotesForStage( 0 );
|
|
||||||
if( pNotesOut == NULL )
|
|
||||||
goto load_from_course_failed;
|
|
||||||
po_out.FromString( course.m_asModifiers[0] );
|
|
||||||
so_out.FromString( course.m_asModifiers[0] );
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
load_from_course_failed:
|
|
||||||
|
|
||||||
// Choose a hard song for the extra stage
|
// Choose a hard song for the extra stage
|
||||||
Song* pExtra1Song = NULL; // the absolute hardest Song and Notes. Use this for extra stage 1.
|
Song* pExtra1Song = NULL; // the absolute hardest Song and Notes. Use this for extra stage 1.
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void LoadStepManiaSongDir( CString sDir, void(*callback)() );
|
void LoadStepManiaSongDir( CString sDir, void(*callback)() );
|
||||||
void LoadDWISongDir( CString sDir );
|
void LoadDWISongDir( CString sDir );
|
||||||
|
bool GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
|
||||||
|
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out );
|
||||||
|
|
||||||
CMapStringToString m_mapGroupToBannerPath; // each song group has a banner associated with it
|
CMapStringToString m_mapGroupToBannerPath; // each song group has a banner associated with it
|
||||||
CStringArray m_arrayGroupNames;
|
CStringArray m_arrayGroupNames;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user