added extra stage course support (.crs file with #EXTRA tag)
and some bugs fixed...
This commit is contained in:
@@ -61,6 +61,11 @@ void Course::LoadFromCRSFile( CString sPath, CArray<Song*,Song*> &apSongs )
|
|||||||
m_iLives = atoi( sParams[1] );
|
m_iLives = atoi( sParams[1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if( 0 == stricmp(sValueName, "EXTRA") )
|
||||||
|
{
|
||||||
|
m_iExtra = atoi( sParams[1] );
|
||||||
|
}
|
||||||
|
|
||||||
else if( 0 == stricmp(sValueName, "SONG") )
|
else if( 0 == stricmp(sValueName, "SONG") )
|
||||||
{
|
{
|
||||||
CString sSongDir = "Songs\\" + sParams[1] + "\\";
|
CString sSongDir = "Songs\\" + sParams[1] + "\\";
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ class Song;
|
|||||||
struct Notes;
|
struct Notes;
|
||||||
|
|
||||||
|
|
||||||
const int MAX_COURSE_STAGES = 100;
|
const int MAX_COURSE_STAGES = 300; // Increased since the user can place all Bemani songs in a single folder
|
||||||
|
|
||||||
|
|
||||||
class Course
|
class Course
|
||||||
{
|
{
|
||||||
@@ -28,6 +29,7 @@ public:
|
|||||||
m_bRepeat = false;
|
m_bRepeat = false;
|
||||||
m_bRandomize = false;
|
m_bRandomize = false;
|
||||||
m_iLives = 4;
|
m_iLives = 4;
|
||||||
|
m_iExtra = 0;
|
||||||
for( int i=0; i<MAX_COURSE_STAGES; i++ )
|
for( int i=0; i<MAX_COURSE_STAGES; i++ )
|
||||||
m_apSongs[i] = NULL;
|
m_apSongs[i] = NULL;
|
||||||
}
|
}
|
||||||
@@ -43,6 +45,7 @@ public:
|
|||||||
bool m_bRandomize; // play the songs in a random order
|
bool m_bRandomize; // play the songs in a random order
|
||||||
int m_iLives; // -1 means use bar life meter
|
int m_iLives; // -1 means use bar life meter
|
||||||
CString m_sModifiers; // contains player options and song options
|
CString m_sModifiers; // contains player options and song options
|
||||||
|
int m_iExtra; // extra stage number...
|
||||||
|
|
||||||
void GetPlayerOptions( PlayerOptions* pPO_out );
|
void GetPlayerOptions( PlayerOptions* pPO_out );
|
||||||
void GetSongOptions( SongOptions* pSO_out);
|
void GetSongOptions( SongOptions* pSO_out);
|
||||||
@@ -52,7 +55,7 @@ public:
|
|||||||
|
|
||||||
void AddStage( Song* pSong, CString sDescription )
|
void AddStage( Song* pSong, CString sDescription )
|
||||||
{
|
{
|
||||||
ASSERT( m_iStages <= MAX_COURSE_STAGES );
|
ASSERT( m_iStages <= MAX_COURSE_STAGES - 1 );
|
||||||
m_apSongs[m_iStages] = pSong;
|
m_apSongs[m_iStages] = pSong;
|
||||||
m_asDescriptions[m_iStages] = sDescription;
|
m_asDescriptions[m_iStages] = sDescription;
|
||||||
m_iStages++;
|
m_iStages++;
|
||||||
|
|||||||
@@ -376,14 +376,35 @@ MusicWheel::MusicWheel()
|
|||||||
for( int so=0; so<NUM_SORT_ORDERS; so++ )
|
for( int so=0; so<NUM_SORT_ORDERS; so++ )
|
||||||
BuildWheelItemDatas( m_WheelItemDatas[so], SongSortOrder(so) );
|
BuildWheelItemDatas( m_WheelItemDatas[so], SongSortOrder(so) );
|
||||||
|
|
||||||
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
||||||
|
{
|
||||||
|
m_bUseRandomExtra = true;
|
||||||
|
Course cCourse;
|
||||||
|
for( int i=0; i< SONGMAN->m_aExtraCourses.GetSize(); i++ )
|
||||||
|
{
|
||||||
|
cCourse = SONGMAN->m_aExtraCourses[i];
|
||||||
|
if( cCourse.m_sName == GAMESTATE->m_sPreferredGroup )
|
||||||
|
{
|
||||||
|
if( ( GAMESTATE->IsExtraStage() && cCourse.m_iExtra == 1 ) ||
|
||||||
|
( GAMESTATE->IsExtraStage2() && cCourse.m_iExtra == 2 ) || 1 ) // force extra whatever
|
||||||
|
{
|
||||||
|
GAMESTATE->m_pCurSong = SONGMAN->m_aExtraCourses[i].m_apSongs[0];
|
||||||
|
m_bUseRandomExtra = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// select a song if none are selected
|
// select a song if none are selected
|
||||||
if( GAMESTATE->m_pCurSong == NULL && // if there is no currently selected song
|
if( GAMESTATE->m_pCurSong == NULL && // if there is no currently selected song
|
||||||
SONGMAN->m_pSongs.GetSize() > 0 ) // and there is at least one song
|
SONGMAN->m_pSongs.GetSize() > 0 ) // and there is at least one song
|
||||||
{
|
{
|
||||||
CArray<Song*, Song*> arraySongs;
|
CArray<Song*, Song*> arraySongs;
|
||||||
SONGMAN->GetSongsInGroup( GAMESTATE->m_sPreferredGroup, arraySongs );
|
SONGMAN->GetSongsInGroup( GAMESTATE->m_sPreferredGroup, arraySongs );
|
||||||
|
// even tho separating these loops makes more code, in the end it'll be executed faster...
|
||||||
if( arraySongs.GetSize() > 0 )
|
//else
|
||||||
|
if( arraySongs.GetSize() > 0 && GAMESTATE->m_pCurSong == NULL) // still nothing selected
|
||||||
GAMESTATE->m_pCurSong = arraySongs[0]; // select the first song
|
GAMESTATE->m_pCurSong = arraySongs[0]; // select the first song
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -816,8 +837,31 @@ void MusicWheel::Update( float fDeltaTime )
|
|||||||
break;
|
break;
|
||||||
case STATE_TWEENING_ON_SCREEN:
|
case STATE_TWEENING_ON_SCREEN:
|
||||||
SCREENMAN->SendMessageToTopScreen( SM_PlaySongSample, 0 );
|
SCREENMAN->SendMessageToTopScreen( SM_PlaySongSample, 0 );
|
||||||
m_WheelState = STATE_SELECTING_MUSIC;
|
|
||||||
m_fTimeLeftInState = 0;
|
m_fTimeLeftInState = 0;
|
||||||
|
if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() )
|
||||||
|
{
|
||||||
|
if ( m_bUseRandomExtra )
|
||||||
|
{
|
||||||
|
MUSIC->Stop;
|
||||||
|
m_soundExpand.Play();
|
||||||
|
m_WheelState = STATE_ROULETTE_SPINNING;
|
||||||
|
m_SortOrder = SORT_GROUP;
|
||||||
|
m_MusicSortDisplay.SetDiffuseColor( D3DXCOLOR(1,1,1,0) );
|
||||||
|
m_MusicSortDisplay.SetEffectNone();
|
||||||
|
BuildWheelItemDatas( m_WheelItemDatas[SORT_GROUP], SORT_GROUP, true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_WheelState = STATE_LOCKED;
|
||||||
|
m_soundStart.Play();
|
||||||
|
m_fLockedWheelVelocity = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_WheelState = STATE_SELECTING_MUSIC;
|
||||||
|
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case STATE_TWEENING_OFF_SCREEN:
|
case STATE_TWEENING_OFF_SCREEN:
|
||||||
m_WheelState = STATE_WAITING_OFF_SCREEN;
|
m_WheelState = STATE_WAITING_OFF_SCREEN;
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public:
|
|||||||
Course* GetSelectedCourse() { return GetCurWheelItemDatas()[m_iSelection].m_pCourse; };
|
Course* GetSelectedCourse() { return GetCurWheelItemDatas()[m_iSelection].m_pCourse; };
|
||||||
CString GetSelectedSection(){ return GetCurWheelItemDatas()[m_iSelection].m_sSectionName; };
|
CString GetSelectedSection(){ return GetCurWheelItemDatas()[m_iSelection].m_sSectionName; };
|
||||||
|
|
||||||
|
bool WheelIsLocked() { return (m_WheelState == STATE_LOCKED ? true : false); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arrayWheelItems, SongSortOrder so, bool bRoulette = false );
|
void BuildWheelItemDatas( CArray<WheelItemData, WheelItemData&> &arrayWheelItems, SongSortOrder so, bool bRoulette = false );
|
||||||
@@ -166,6 +167,7 @@ protected:
|
|||||||
float m_fTimeLeftInState;
|
float m_fTimeLeftInState;
|
||||||
float m_fPositionOffsetFromSelection;
|
float m_fPositionOffsetFromSelection;
|
||||||
|
|
||||||
|
bool m_bUseRandomExtra;
|
||||||
|
|
||||||
// having sounds here causes a crash in Bass. What the heck!?!?!
|
// having sounds here causes a crash in Bass. What the heck!?!?!
|
||||||
RageSoundSample m_soundChangeMusic;
|
RageSoundSample m_soundChangeMusic;
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, const InputEventType
|
|||||||
if( m_Menu.IsClosing() )
|
if( m_Menu.IsClosing() )
|
||||||
return; // ignore
|
return; // ignore
|
||||||
|
|
||||||
|
if( ! GAMESTATE->IsExtraStage() && ! GAMESTATE->IsExtraStage2() )
|
||||||
if( m_bMadeChoice && !m_bGoToOptions && MenuI.button == MENU_BUTTON_START )
|
if( m_bMadeChoice && !m_bGoToOptions && MenuI.button == MENU_BUTTON_START )
|
||||||
{
|
{
|
||||||
m_bGoToOptions = true;
|
m_bGoToOptions = true;
|
||||||
@@ -239,11 +240,13 @@ void ScreenSelectMusic::Input( const DeviceInput& DeviceI, const InputEventType
|
|||||||
|
|
||||||
if( INPUTQUEUE->MatchesPattern(MenuI.player, EASIER_DIFFICULTY_PATTERN, EASIER_DIFFICULTY_PATTERN_SIZE) )
|
if( INPUTQUEUE->MatchesPattern(MenuI.player, EASIER_DIFFICULTY_PATTERN, EASIER_DIFFICULTY_PATTERN_SIZE) )
|
||||||
{
|
{
|
||||||
|
if( ! GAMESTATE->IsExtraStage() && ! GAMESTATE->IsExtraStage2() )
|
||||||
EasierDifficulty( MenuI.player );
|
EasierDifficulty( MenuI.player );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( INPUTQUEUE->MatchesPattern(MenuI.player, HARDER_DIFFICULTY_PATTERN, HARDER_DIFFICULTY_PATTERN_SIZE) )
|
if( INPUTQUEUE->MatchesPattern(MenuI.player, HARDER_DIFFICULTY_PATTERN, HARDER_DIFFICULTY_PATTERN_SIZE) )
|
||||||
{
|
{
|
||||||
|
if( ! GAMESTATE->IsExtraStage() && ! GAMESTATE->IsExtraStage2() )
|
||||||
HarderDifficulty( MenuI.player );
|
HarderDifficulty( MenuI.player );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -313,9 +316,10 @@ void ScreenSelectMusic::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
bIsHoldingNext = true;
|
bIsHoldingNext = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( bIsHoldingNext || m_bGoToOptions )
|
if( ! GAMESTATE->IsExtraStage() && ! GAMESTATE->IsExtraStage2() &&
|
||||||
|
( bIsHoldingNext || m_bGoToOptions ) )
|
||||||
{
|
{
|
||||||
SCREENMAN->SetNewScreen( new ScreenPlayerOptions );
|
SCREENMAN->SetNewScreen( new ScreenPlayerOptions );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -338,6 +342,7 @@ void ScreenSelectMusic::MenuLeft( const PlayerNumber p, const InputEventType typ
|
|||||||
if( type >= IET_SLOW_REPEAT && INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_RIGHT) ) )
|
if( type >= IET_SLOW_REPEAT && INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_RIGHT) ) )
|
||||||
return; // ignore
|
return; // ignore
|
||||||
|
|
||||||
|
if( ! m_MusicWheel.WheelIsLocked() )
|
||||||
MUSIC->Stop();
|
MUSIC->Stop();
|
||||||
|
|
||||||
m_MusicWheel.PrevMusic();
|
m_MusicWheel.PrevMusic();
|
||||||
@@ -349,6 +354,7 @@ void ScreenSelectMusic::MenuRight( const PlayerNumber p, const InputEventType ty
|
|||||||
if( type >= IET_SLOW_REPEAT && INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_LEFT) ) )
|
if( type >= IET_SLOW_REPEAT && INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_LEFT) ) )
|
||||||
return; // ignore
|
return; // ignore
|
||||||
|
|
||||||
|
if( ! m_MusicWheel.WheelIsLocked() )
|
||||||
MUSIC->Stop();
|
MUSIC->Stop();
|
||||||
|
|
||||||
m_MusicWheel.NextMusic();
|
m_MusicWheel.NextMusic();
|
||||||
@@ -359,7 +365,8 @@ void ScreenSelectMusic::MenuStart( const PlayerNumber p )
|
|||||||
if( INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_LEFT) ) &&
|
if( INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_LEFT) ) &&
|
||||||
INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_RIGHT) ) )
|
INPUTMAPPER->IsButtonDown( MenuInput(p, MENU_BUTTON_RIGHT) ) )
|
||||||
{
|
{
|
||||||
m_MusicWheel.NextSort();
|
if( ! GAMESTATE->IsExtraStage() && ! GAMESTATE->IsExtraStage2() )
|
||||||
|
m_MusicWheel.NextSort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -399,7 +399,6 @@ void SongManager::InitCoursesFromDisk()
|
|||||||
m_aOniCourses.Add( course );
|
m_aOniCourses.Add( course );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create endless courses
|
// Create endless courses
|
||||||
//
|
//
|
||||||
@@ -420,6 +419,28 @@ void SongManager::InitCoursesFromDisk()
|
|||||||
m_aEndlessCourses.Add( course );
|
m_aEndlessCourses.Add( course );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Load extra stages
|
||||||
|
//
|
||||||
|
for( int g=0; g<saGroupNames.GetSize(); g++ ) // foreach Group
|
||||||
|
{
|
||||||
|
CString sGroupName = saGroupNames[g];
|
||||||
|
CStringArray saCourseFiles;
|
||||||
|
GetDirListing( "Songs\\" + sGroupName + "\\*.crs", saCourseFiles );
|
||||||
|
for( int i=0; i<saCourseFiles.GetSize(); i++ )
|
||||||
|
{
|
||||||
|
Course course;
|
||||||
|
course.LoadFromCRSFile( "Songs\\" + sGroupName + "\\" + saCourseFiles[i], m_pSongs );
|
||||||
|
if( course.m_iStages > 0 )
|
||||||
|
m_aExtraCourses.Add( course );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SongManager::ReloadCourses()
|
void SongManager::ReloadCourses()
|
||||||
|
|||||||
@@ -44,10 +44,13 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// for Oni
|
// for Oni
|
||||||
CArray<Course, Course> m_aOniCourses;
|
CArray<Course, Course> m_aOniCourses;
|
||||||
|
|
||||||
|
// for Extra Stages
|
||||||
|
CArray<Course, Course> m_aExtraCourses;
|
||||||
|
|
||||||
// for Endless
|
// for Endless
|
||||||
CArray<Course, Course> m_aEndlessCourses;
|
CArray<Course, Course> m_aEndlessCourses;
|
||||||
|
|
||||||
void InitCoursesFromDisk();
|
void InitCoursesFromDisk();
|
||||||
void ReloadCourses();
|
void ReloadCourses();
|
||||||
|
|||||||
Reference in New Issue
Block a user