diff --git a/stepmania/src/AnnouncerManager.cpp b/stepmania/src/AnnouncerManager.cpp index e0e98078af..e67424fbb1 100644 --- a/stepmania/src/AnnouncerManager.cpp +++ b/stepmania/src/AnnouncerManager.cpp @@ -73,9 +73,7 @@ CString AnnouncerManager::GetAnnouncerDirFromName( CString sAnnouncerName ) void AnnouncerManager::SwitchAnnouncer( CString sNewAnnouncerName ) { - if( sNewAnnouncerName == "" ) - m_sCurAnnouncerName = ""; - else if( !DoesAnnouncerExist(sNewAnnouncerName) ) + if( !DoesAnnouncerExist(sNewAnnouncerName) ) m_sCurAnnouncerName = ""; else m_sCurAnnouncerName = sNewAnnouncerName; @@ -138,6 +136,7 @@ CString AnnouncerManager::GetPathTo( AnnouncerElement ae, CString sAnnouncerName case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_HARD: sAssetDir = "select difficulty comment hard"; break; case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_MEDIUM:sAssetDir = "select difficulty comment medium"; break; case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ONI: sAssetDir = "select difficulty comment oni"; break; + case ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ENDLESS:sAssetDir = "select difficulty comment endless"; break; case ANNOUNCER_SELECT_DIFFICULTY_CHALLENGE: sAssetDir = "select difficulty challenge"; break; case ANNOUNCER_SELECT_DIFFICULTY_INTRO: sAssetDir = "select difficulty intro"; break; case ANNOUNCER_SELECT_GROUP_COMMENT_ALL_MUSIC: sAssetDir = "select group comment all music"; break; @@ -161,7 +160,8 @@ CString AnnouncerManager::GetPathTo( AnnouncerElement ae, CString sAnnouncerName case ANNOUNCER_STAGE_FINAL: sAssetDir = "stage final"; break; case ANNOUNCER_STAGE_EXTRA: sAssetDir = "stage extra"; break; case ANNOUNCER_STAGE_ANOTHER_EXTRA: sAssetDir = "stage another extra"; break; - case ANNOUNCER_STAGE_CHALLENGE: sAssetDir = "stage challenge"; break; + case ANNOUNCER_STAGE_ONI: sAssetDir = "stage oni"; break; + case ANNOUNCER_STAGE_ENDLESS: sAssetDir = "stage endless"; break; case ANNOUNCER_TITLE_MENU_ATTRACT: sAssetDir = "title menu attract"; break; case ANNOUNCER_TITLE_MENU_GAME_NAME: sAssetDir = "title menu game name"; break; diff --git a/stepmania/src/AnnouncerManager.h b/stepmania/src/AnnouncerManager.h index ab2064a90b..90c2392f2d 100644 --- a/stepmania/src/AnnouncerManager.h +++ b/stepmania/src/AnnouncerManager.h @@ -58,6 +58,7 @@ enum AnnouncerElement { ANNOUNCER_SELECT_DIFFICULTY_COMMENT_HARD, ANNOUNCER_SELECT_DIFFICULTY_COMMENT_MEDIUM, ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ONI, + ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ENDLESS, ANNOUNCER_SELECT_DIFFICULTY_CHALLENGE, ANNOUNCER_SELECT_DIFFICULTY_INTRO, ANNOUNCER_SELECT_GROUP_COMMENT_ALL_MUSIC, @@ -81,7 +82,8 @@ enum AnnouncerElement { ANNOUNCER_STAGE_FINAL, ANNOUNCER_STAGE_EXTRA, ANNOUNCER_STAGE_ANOTHER_EXTRA, - ANNOUNCER_STAGE_CHALLENGE, + ANNOUNCER_STAGE_ONI, + ANNOUNCER_STAGE_ENDLESS, ANNOUNCER_TITLE_MENU_ATTRACT, ANNOUNCER_TITLE_MENU_GAME_NAME, diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index a451937d9f..507c677e51 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -19,11 +19,12 @@ #include "RageTimer.h" -float ArrowGetYOffset( const PlayerOptions& po, float fStepIndex, float fSongBeat ) +float ArrowGetYOffset( const PlayerNumber pn, float fStepIndex ) { + float fSongBeat = GAMESTATE->m_fSongBeat; float fBeatsUntilStep = NoteRowToBeat( fStepIndex ) - fSongBeat; float fYOffset = fBeatsUntilStep * ARROW_GAP; - switch( po.m_EffectType ) + switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType ) { case PlayerOptions::EFFECT_BOOST: fYOffset *= 1.4f / ((fYOffset+SCREEN_HEIGHT/1.6f)/SCREEN_HEIGHT); @@ -35,8 +36,9 @@ float ArrowGetYOffset( const PlayerOptions& po, float fStepIndex, float fSongBea return fYOffset; } -float ArrowGetXPos( const PlayerOptions& po, int iColNum, float fYOffset, float fSongBeat ) +float ArrowGetXPos( const PlayerNumber pn, int iColNum, float fYOffset ) { + float fSongBeat = GAMESTATE->m_fSongBeat; float fPixelOffsetFromCenter = GAMESTATE->GetCurrentStyleDef()->m_ColumnInfo[PLAYER_1][iColNum].fXOffset; // BUG OR FEATURE??? THIS IS WHERE THE REAL COLUMN PLACEMENT HAPPENS!!! @@ -68,7 +70,7 @@ float ArrowGetXPos( const PlayerOptions& po, int iColNum, float fYOffset, float } */ - switch( po.m_EffectType ) + switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType ) { case PlayerOptions::EFFECT_DRUNK: fPixelOffsetFromCenter += cosf( TIMER->GetTimeSinceStart()/4 + iColNum*0.4f + fYOffset/SCREEN_HEIGHT*4) * ARROW_SIZE/3; @@ -77,11 +79,11 @@ float ArrowGetXPos( const PlayerOptions& po, int iColNum, float fYOffset, float return fPixelOffsetFromCenter; } -float ArrowGetRotation( const PlayerOptions& po, int iColNum, float fYOffset ) +float ArrowGetRotation( const PlayerNumber pn, int iColNum, float fYOffset ) { float fRotation = 0; //StyleDef.m_ColumnToRotation[iColNum]; - switch( po.m_EffectType ) + switch( GAMESTATE->m_PlayerOptions[pn].m_EffectType ) { case PlayerOptions::EFFECT_DIZZY: fRotation += fYOffset/SCREEN_HEIGHT*6; @@ -91,12 +93,12 @@ float ArrowGetRotation( const PlayerOptions& po, int iColNum, float fYOffset ) return fRotation; } -float ArrowGetYPos( const PlayerOptions& po, float fYOffset ) +float ArrowGetYPos( const PlayerNumber pn, float fYOffset ) { - return fYOffset * po.m_fArrowScrollSpeed * (po.m_bReverseScroll ? -1 : 1 ); + return fYOffset * GAMESTATE->m_PlayerOptions[pn].m_fArrowScrollSpeed * (GAMESTATE->m_PlayerOptions[pn].m_bReverseScroll ? -1 : 1 ); } -float ArrowGetAlpha( const PlayerOptions& po, float fYPos ) +float ArrowGetAlpha( const PlayerNumber pn, float fYPos ) { float fAlpha; static float blinktimer=0; @@ -104,7 +106,7 @@ float ArrowGetAlpha( const PlayerOptions& po, float fYPos ) blinktimer = TIMER->GetTimeSinceStart(); static int blinkstate=2; - switch( po.m_AppearanceType ) + switch( GAMESTATE->m_PlayerOptions[pn].m_AppearanceType ) { case PlayerOptions::APPEARANCE_VISIBLE: fAlpha = 1; diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 34ae62c51c..0bd50a737d 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -87,8 +87,11 @@ void Course::LoadFromCRSFile( CString sPath, CArray &apSongs ) } -void Course::CreateFromGroupAndDifficultyClass( CString sGroupName, DifficultyClass dc, CArray &apSongsInGroup ) +void Course::CreateEndlessCourseFromGroupAndDifficultyClass( CString sGroupName, DifficultyClass dc, CArray &apSongsInGroup ) { + m_bRepeat = true; + m_bRandomize = true; + m_iLives = -1; CString sShortGroupName = SONGMAN->ShortenGroupName( sGroupName ); m_sName = sShortGroupName + " "; diff --git a/stepmania/src/Course.h b/stepmania/src/Course.h index ef398c9bab..225b65bbb5 100644 --- a/stepmania/src/Course.h +++ b/stepmania/src/Course.h @@ -26,6 +26,7 @@ public: { m_iStages = 0; m_bRepeat = false; + m_bRandomize = false; m_iLives = 4; for( int i=0; i &apSongs ); - void CreateFromGroupAndDifficultyClass( CString sGroupName, DifficultyClass dc, CArray &apSongsInGroup ); + void CreateEndlessCourseFromGroupAndDifficultyClass( CString sGroupName, DifficultyClass dc, CArray &apSongsInGroup ); void AddStage( Song* pSong, CString sDescription ) { diff --git a/stepmania/src/CourseContentsFrame.cpp b/stepmania/src/CourseContentsFrame.cpp index 0d981329e6..1acd343877 100644 --- a/stepmania/src/CourseContentsFrame.cpp +++ b/stepmania/src/CourseContentsFrame.cpp @@ -109,8 +109,8 @@ void CourseContentsFrame::SetFromCourse( Course* pCourse ) printf( "Adding song '%s'\n", pSong->m_sMainTitle ); m_CourseContentDisplays[m_iNumContents].Load( m_iNumContents+1, pSong, pNotes ); m_CourseContentDisplays[m_iNumContents].SetXY( 0, -((MAX_VISIBLE_CONTENTS-1)/2) * CONTENTS_BAR_HEIGHT ); - m_CourseContentDisplays[m_iNumContents].BeginTweening( i*0.1f ); - m_CourseContentDisplays[m_iNumContents].SetTweenY( (-(MAX_VISIBLE_CONTENTS-1)/2 + i) * CONTENTS_BAR_HEIGHT ); + m_CourseContentDisplays[m_iNumContents].BeginTweening( m_iNumContents*0.1f ); + m_CourseContentDisplays[m_iNumContents].SetTweenY( (-(MAX_VISIBLE_CONTENTS-1)/2 + m_iNumContents) * CONTENTS_BAR_HEIGHT ); m_iNumContents ++; } @@ -162,9 +162,7 @@ void CourseContentsFrame::DrawPrimitives() if( m_fTimeUntilScroll <= 0 ) m_CourseContentDisplays[iItemToDraw].SetY( fY ); m_CourseContentDisplays[iItemToDraw].Draw(); - iItemToDraw++; - if( iItemToDraw >= m_iNumContents ) - iItemToDraw -= m_iNumContents; + iItemToDraw = (iItemToDraw+1) % m_iNumContents; fY += CONTENTS_BAR_HEIGHT; } diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index fc3c977418..693482e54d 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -15,6 +15,7 @@ #include "GameManager.h" #include "PrefsManager.h" #include "InputMapper.h" +#include "Song.h" GameState* GAMESTATE = NULL; // global and accessable from anywhere in our program @@ -22,6 +23,7 @@ GameState* GAMESTATE = NULL; // global and accessable from anywhere in our progr GameState::GameState() { + m_CurGame = GAME_DANCE; m_sLoadingMessage = "Initializing hardware..."; m_CurGame = GAME_DANCE; Reset(); @@ -35,29 +37,136 @@ void GameState::Reset() { int p; + m_CurStyle = STYLE_NONE; + m_MasterPlayerNumber = PLAYER_INVALID; + m_sPreferredGroup = ""; + for( p=0; pIsPlayerEnabled(p) ) + sText += ssprintf("%d ", m_iStagesIntoCourse[p]); + else + sText += "a "; + } + sText.TrimRight(); + sText.Replace('a',' '); + return sText; + } + break; + default: + ; // fall through + } + + if( IsFinalStage() ) return "Final"; else if( IsExtraStage() ) @@ -125,12 +257,6 @@ D3DXCOLOR GameState::GetStageColor() return D3DXCOLOR(0.3f,1,0.3f,1); // green } -GameplayStatistics& GameState::GetLatestGameplayStatistics() -{ - ASSERT( m_aGameplayStatistics.GetSize() > 0 ); - return m_aGameplayStatistics[ m_aGameplayStatistics.GetSize()-1 ]; -} - GameDef* GameState::GetCurrentGameDef() { return GAMEMAN->GetGameDefForGame( m_CurGame ); @@ -148,4 +274,33 @@ bool GameState::IsPlayerEnabled( PlayerNumber pn ) return ( pn == m_MasterPlayerNumber ) || ( GetCurrentStyleDef()->m_StyleType == StyleDef::TWO_PLAYERS_USE_TWO_SIDES ); -}; +} + +float GameState::GetElapsedSeconds() +{ + switch( m_PlayMode ) + { + case PLAY_MODE_ARCADE: + return max( 0, m_fMusicSeconds ); + case PLAY_MODE_ONI: + case PLAY_MODE_ENDLESS: + { + float fSecondsTotal = 0; + for( int i=0; im_fMusicLengthSeconds; + fSecondsTotal += max( 0, m_fMusicSeconds ); + return fSecondsTotal; + } + default: + ASSERT(0); + return 0; + } +} + +float GameState::GetPlayerSurviveTime( PlayerNumber p ) +{ + if( m_fSecondsBeforeFail[p] != -1 ) + return m_fSecondsBeforeFail[p]; + else + return GetElapsedSeconds(); +} diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index c4f1c21b70..d393e15ff5 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -92,7 +92,7 @@ public: // Statistics for: Arcade: for the current stage. Oni/Endless: for current course // int m_iPossibleDancePoints[NUM_PLAYERS]; - int m_iActualDancePoints[NUM_PLAYERS]; // In Endless, possible dance points is -1. + int m_iActualDancePoints[NUM_PLAYERS]; int m_TapNoteScores[NUM_PLAYERS][NUM_TAP_NOTE_SCORES]; int m_HoldNoteScores[NUM_PLAYERS][NUM_HOLD_NOTE_SCORES]; int m_iMaxCombo[NUM_PLAYERS]; @@ -106,7 +106,7 @@ public: // Only used in final evaluation screen in play mode Arcade. // Before being displayed, these values should be normalized by dividing by number of stages int m_iAccumPossibleDancePoints[NUM_PLAYERS]; - int m_iAccumActualDancePoints[NUM_PLAYERS]; // In Endless, possible dance points is -1. + int m_iAccumActualDancePoints[NUM_PLAYERS]; int m_AccumTapNoteScores[NUM_PLAYERS][NUM_TAP_NOTE_SCORES]; int m_AccumHoldNoteScores[NUM_PLAYERS][NUM_HOLD_NOTE_SCORES]; int m_iAccumMaxCombo[NUM_PLAYERS]; diff --git a/stepmania/src/GrayArrow.cpp b/stepmania/src/GrayArrow.cpp index 10f594c868..044607171d 100644 --- a/stepmania/src/GrayArrow.cpp +++ b/stepmania/src/GrayArrow.cpp @@ -28,9 +28,11 @@ void GrayArrow::Update( float fDeltaTime ) { Sprite::Update( fDeltaTime ); - int iNewState = (int)( fmod(GAMESTATE->m_fSongBeat,1) * Sprite::GetNumStates() ); - if( iNewState < 0 ) - iNewState += Sprite::GetNumStates(); + float fPercentIntoBeat = fmodf(GAMESTATE->m_fSongBeat,1); + if( fPercentIntoBeat < 0 ) + fPercentIntoBeat += 1; + int iNewState = fPercentIntoBeat<0.25f ? 0 : 1; + CLAMP( iNewState, 0, Sprite::GetNumStates() ); SetState( iNewState ); } diff --git a/stepmania/src/LifeMeterBar.cpp b/stepmania/src/LifeMeterBar.cpp index b72a5c0f17..7bf26049b0 100644 --- a/stepmania/src/LifeMeterBar.cpp +++ b/stepmania/src/LifeMeterBar.cpp @@ -30,14 +30,19 @@ const float FAIL_THRESHOLD = 0; LifeMeterBar::LifeMeterBar() { - m_fLifePercentage = 0.5f; + switch( GAMESTATE->m_SongOptions.m_DrainType ) + { + case SongOptions::DRAIN_NORMAL: m_fLifePercentage = 0.5f; break; + case SongOptions::DRAIN_NO_RECOVER: m_fLifePercentage = 1.0f; break; + case SongOptions::DRAIN_SUDDEN_DEATH: m_fLifePercentage = 1.0f; break; + default: ASSERT(0); + } + m_fTrailingLifePercentage = 0; m_fLifeVelocity = 0; m_fHotAlpha = 0; m_bFailedEarlier = false; - m_frame; - m_quadBlackBackground.SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); m_quadBlackBackground.SetZoomX( METER_WIDTH ); m_quadBlackBackground.SetZoomY( METER_HEIGHT ); @@ -95,8 +100,17 @@ void LifeMeterBar::ChangeLife( TapNoteScore score ) } break; case SongOptions::DRAIN_SUDDEN_DEATH: - fDeltaLife = -1; + switch( score ) + { + case TNS_PERFECT: fDeltaLife = +0; break; + case TNS_GREAT: fDeltaLife = +0; break; + case TNS_GOOD: fDeltaLife = -1; break; + case TNS_BOO: fDeltaLife = -1; break; + case TNS_MISS: fDeltaLife = -1; break; + } break; + default: + ASSERT(0); } diff --git a/stepmania/src/LifeMeterBattery.cpp b/stepmania/src/LifeMeterBattery.cpp index 11a0fa7574..ab42db7bd3 100644 --- a/stepmania/src/LifeMeterBattery.cpp +++ b/stepmania/src/LifeMeterBattery.cpp @@ -125,8 +125,6 @@ void LifeMeterBattery::OnDancePointsChange() CString sNumToDisplay = ssprintf("%03.1f", fNumToDisplay); if( sNumToDisplay.GetLength() == 3 ) sNumToDisplay = "0" + sNumToDisplay; - if( iPossibleDancePoints == -1 ) - sNumToDisplay = "??.?"; m_textPercent.SetText( sNumToDisplay ); } diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index 6c7b3ba969..1f2bfadfdd 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -520,8 +520,8 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr case PLAY_MODE_ONI: { CArray apCourses; - for( int i=0; im_aCourses.GetSize(); i++ ) - apCourses.Add( &SONGMAN->m_aCourses[i] ); + for( int i=0; im_aOniCourses.GetSize(); i++ ) + apCourses.Add( &SONGMAN->m_aOniCourses[i] ); SortCoursePointerArrayByDifficulty( apCourses ); @@ -532,6 +532,19 @@ void MusicWheel::BuildWheelItemDatas( CArray &arr } } break; + case PLAY_MODE_ENDLESS: + { + CArray apCourses; + for( int i=0; im_aEndlessCourses.GetSize(); i++ ) + apCourses.Add( &SONGMAN->m_aEndlessCourses[i] ); + + for( int c=0; cGetColor()) ); + } + } + break; default: ASSERT(0); // invalid PlayMode } diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 960796cef5..51a75f6afb 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -95,7 +95,7 @@ RageTexture* RageTextureManager::LoadTexture( CString sTexturePath, bool bForceR m_mapPathToTexture.SetAt( sTexturePath, pTexture ); } - LOG->WriteLine( "Display: %u MB video memory left", DISPLAY->GetDevice()->GetAvailableTextureMem() ); + LOG->WriteLine( "Display: %u KB video memory left", DISPLAY->GetDevice()->GetAvailableTextureMem() ); return pTexture; } diff --git a/stepmania/src/ScoreDisplayNormal.cpp b/stepmania/src/ScoreDisplayNormal.cpp index 8d02aed8c6..0136d57eda 100644 --- a/stepmania/src/ScoreDisplayNormal.cpp +++ b/stepmania/src/ScoreDisplayNormal.cpp @@ -38,8 +38,6 @@ ScoreDisplayNormal::ScoreDisplayNormal() void ScoreDisplayNormal::Init( PlayerNumber pn ) { m_PlayerNumber = pn; - - SetScore( GAMESTATE->m_fScore[pn] ); } void ScoreDisplayNormal::SetScore( float fNewScore ) diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index f13b3ad2a8..111f184025 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -55,6 +55,12 @@ void Screen::Input( const DeviceInput& DeviceI, const InputEventType type, const if( !GAMESTATE->IsPlayerEnabled(MenuI.player) ) return; + if( DeviceI.device == DEVICE_KEYBOARD && DeviceI.button == DIK_ESCAPE ) // don't make user hold back button if they're pressing escape + { + this->MenuBack( MenuI.player ); + return; + } + switch( MenuI.button ) { case MENU_BUTTON_UP: this->MenuUp( MenuI.player, type ); return; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index d34b8865d3..179db8b57d 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -98,10 +98,8 @@ ScreenGameplay::ScreenGameplay() GAMESTATE->m_pCurNotes[p]->GetNoteData( ¬edata ); GAMESTATE->m_iPossibleDancePoints[p] = notedata.GetPossibleDancePoints(); break; - case PLAY_MODE_ENDLESS: - GAMESTATE->m_iPossibleDancePoints[p] = -1; - break; case PLAY_MODE_ONI: + case PLAY_MODE_ENDLESS: { GAMESTATE->m_iPossibleDancePoints[p] = 0; @@ -229,10 +227,10 @@ ScreenGameplay::ScreenGameplay() switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ARCADE: - case PLAY_MODE_ENDLESS: m_pScoreDisplay[p] = new ScoreDisplayNormal; break; case PLAY_MODE_ONI: + case PLAY_MODE_ENDLESS: m_pScoreDisplay[p] = new ScoreDisplayOni; break; default: @@ -390,6 +388,10 @@ bool ScreenGameplay::IsLastSong() case PLAY_MODE_ENDLESS: { Course* pCourse = GAMESTATE->m_pCurCourse; + + if( pCourse->m_bRepeat ) + return false; + CArray apSongs; CArray apNotes[NUM_PLAYERS]; pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes ); @@ -419,9 +421,15 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad ) CArray apNotes[NUM_PLAYERS]; pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes ); - GAMESTATE->m_pCurSong = apSongs[GAMESTATE->m_iCurrentStageIndex]; + int iPlaySongIndex = -1; + if( pCourse->m_bRandomize ) + iPlaySongIndex = rand() % apSongs.GetSize(); + else + iPlaySongIndex = GAMESTATE->m_iCurrentStageIndex; + + GAMESTATE->m_pCurSong = apSongs[iPlaySongIndex]; for( int p=0; pm_pCurNotes[p] = apNotes[p][GAMESTATE->m_iCurrentStageIndex]; + GAMESTATE->m_pCurNotes[p] = apNotes[p][iPlaySongIndex]; } break; default: @@ -1020,8 +1028,13 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) case SM_GoToScreenAfterBack: switch( GAMESTATE->m_PlayMode ) { - case PLAY_MODE_ARCADE: SCREENMAN->SetNewScreen( new ScreenSelectMusic ); break; - case PLAY_MODE_ONI: SCREENMAN->SetNewScreen( new ScreenSelectCourse ); break; + case PLAY_MODE_ARCADE: + SCREENMAN->SetNewScreen( new ScreenSelectMusic ); + break; + case PLAY_MODE_ONI: + case PLAY_MODE_ENDLESS: + SCREENMAN->SetNewScreen( new ScreenSelectCourse ); + break; default: ASSERT(0); } break; diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index 3aa578a44f..ca5a204e3b 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -253,7 +253,7 @@ void ScreenSelectDifficulty::HandleScreenMessage( const ScreenMessage SM ) break; case 4: GAMESTATE->m_PlayMode = PLAY_MODE_ENDLESS; - SCREENMAN->SetNewScreen( new ScreenSelectGroup ); + SCREENMAN->SetNewScreen( new ScreenSelectCourse ); break; default: ASSERT(0); // bad selection @@ -379,6 +379,7 @@ void ScreenSelectDifficulty::MenuStart( PlayerNumber pn ) case 1: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_MEDIUM) ); break; case 2: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_HARD) ); break; case 3: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ONI) ); break; + case 4: SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_SELECT_DIFFICULTY_COMMENT_ENDLESS) ); break; } if( iSelection >= 3 ) // chose something on page 2 diff --git a/stepmania/src/ScreenStage.cpp b/stepmania/src/ScreenStage.cpp index 33997b6ddf..d5b890c4d4 100644 --- a/stepmania/src/ScreenStage.cpp +++ b/stepmania/src/ScreenStage.cpp @@ -43,9 +43,15 @@ ScreenStage::ScreenStage() if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI ) { - m_textStage.SetText( "Challenge Mode" ); + m_textStage.SetText( "Nonstop Challenge" ); m_textStage.SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,1,1) ); // light blue - SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_CHALLENGE) ); + SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_ONI) ); + } + else if( GAMESTATE->m_PlayMode == PLAY_MODE_ENDLESS ) + { + m_textStage.SetText( "Endless Challenge" ); + m_textStage.SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,1,1) ); // light blue + SOUND->PlayOnceStreamedFromDir( ANNOUNCER->GetPathTo(ANNOUNCER_STAGE_ENDLESS) ); } else if( GAMESTATE->IsExtraStage() ) { diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 012a174bac..618f81b544 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -396,14 +396,12 @@ void SongManager::InitCoursesFromDisk() Course course; course.LoadFromCRSFile( "Courses\\" + saCourseFiles[i], m_pSongs ); if( course.m_iStages > 0 ) - m_aCourses.Add( course ); + m_aOniCourses.Add( course ); } -/* - Chris: Default courses were a bad idea. Get rid of them. // - // Create default courses + // Create endless courses // CStringArray saGroupNames; this->GetGroupNames( saGroupNames ); @@ -416,13 +414,12 @@ void SongManager::InitCoursesFromDisk() for( DifficultyClass dc=CLASS_EASY; dc<=CLASS_HARD; dc=DifficultyClass(dc+1) ) // foreach DifficultyClass { Course course; - course.CreateFromGroupAndDifficultyClass( sGroupName, dc, apGroupSongs ); + course.CreateEndlessCourseFromGroupAndDifficultyClass( sGroupName, dc, apGroupSongs ); if( course.m_iStages > 0 ) - m_aCourses.Add( course ); + m_aEndlessCourses.Add( course ); } } - */ } void SongManager::ReloadCourses() diff --git a/stepmania/src/SongManager.h b/stepmania/src/SongManager.h index dadc23f1d4..29c25811e4 100644 --- a/stepmania/src/SongManager.h +++ b/stepmania/src/SongManager.h @@ -43,8 +43,11 @@ public: void GetSongsInGroup( const CString sGroupName, CArray &AddTo ); - // for Courses - CArray m_aCourses; + // for Oni + CArray m_aOniCourses; + + // for Endless + CArray m_aEndlessCourses; void InitCoursesFromDisk(); void ReloadCourses();