diff --git a/stepmania/README-FIRST.TXT b/stepmania/README-FIRST.TXT index f0f8c27f60..3434deab80 100644 --- a/stepmania/README-FIRST.TXT +++ b/stepmania/README-FIRST.TXT @@ -518,25 +518,25 @@ Header section... #COURSE:...; - name of the course #LIVES:<0..10>; - An integer between 0 and 10. This line is optional. #REPEAT:; - start over after last stage? -#SONG:\:; - +#SONG:\:[:modifiers]; - group folder - The name of the folder that contains the song folder. song folder - the name of the folder that contains files for the song description - BASIC, TRICK, SSR, MANIAC, HEAVY, etc. + modifiers - One or more of: + 0.5x, 0.75x, 1.5x, 2.0x, 3.0x, 4.0x, 5.0x, 8.0x + boost, wave, drunk, dizzy, space, mini + hidden, sudden, stealth + mirror, left, right, shuffle + little + reverse + note, flat, plain + noholds + nofreeze + dark + norecover, suddendeath, power-drop, death + 0.7xmusic, 0.8xmusic, 0.9xmusic, 1.0xmusic, 1.1xmusic, + 1.2xmusic, 1.3xmusic, 1.4xmusic, 1.5xmusic -//The modifiers section could be a list of comma-separated tags, like: -//"1.5x,REVERSE,SUDDEN", etc. We'd have to come up with a standard set for -//features common to both SM and DWI... and new ones could be added for features -//only supported by SM perhaps (Space, Drunk, etc...). -// -//The number of songs in a course is just how many "#SONG:"... lines there are. -// -//So... and "ENDLESS" mode would be as simple as: #COURSE:Endless; #REPEATS:YES; -//#SONG:*:7..9; -// -//New features could be added to the end of the "#SONG" line in the future. -//...how does this all sound to you? That way courses could easily be used between -//versions and passed around. :) -// ************************************************************ 16. Improving Image Quality with Texture Hints @@ -633,6 +633,7 @@ variables take effect. ************************************************************ ------------------------CVS after 3.00 beta 5---------------- +OPTIMIZATION: Much faster song loading. BUG FIX: New hashing algorithm prevents multiple songs from hashing to the same cache file. BUG FIX: "Select Group" screen now only displays songs and groups available in @@ -663,6 +664,9 @@ NEW FEATURE: During gameplay: F8 = toggle AutoPlay NEW FEATURE: During gameplay: F9 = decrease offset, F10 = increase offset, NEW FEATURE: During gameplay: F11 = decrease BPM of current segment, F12 = increase BPM of current segment. +NEW FEATURE: After changing Offset or BPM during gameplay, I prompt will appear + at the end of the stage or course asking if you want to save changes. + Chosing cancel will revert to the pre-modified values. CHANGE: Life meters graphics are now part of the theme system CHANGE: New Song Option: Choose Oni life battery or normal life meter BUG FIX: Life Bar no-recover and sudden death options now work. @@ -684,6 +688,25 @@ NEW FEATURE: MenuInput option. Setting this option to "USE ONLY DEDICATED MENU buttons that can be dedicated to controlling the menus (like a DDR arcade cabinet). Also, using only dedicated menu buttons will allow you to enter codes at the Select Music screen using the dance panels. +NEW FEATURE: Random background movies. Put a bunch of movies in RandomMovies and + change the BackgroundMode setting in Game Options to "RANDOM MOVIES". +CHANGE: Made folders for DWI-style CDTitles and DWI-style Music. +BUG FIX: Fixed more HoldNote drawing ugliness. +BUG FIX: Hidden and Sudden now work with Reverse. +BUG FIX: Group names are now correct when using the SongFolders option +BUG FIX: No longer crashes in Select Group with > 15 groups +NEW FEATURE: PlayerOptions and SongOptions displays on the Select Music screen. +BUG FIX: Extra stage actually works! Props to Bruno for all of his help with this. + You can manually specify extra stage 1 and 2 by creating a .CRS files in the + group folder called extra1.crs and extra2.crs. These courses must contain + exactly one valid song. Don't forget to specify modifiers - see the CRS File + Format section in the readme for more information. If a CRS file is not found + or is invalid, the program will choose approprite Song/Notes/Options. +BUG FIX: Browsing past a song that don't have notes for some Difficulties will not + change your preferred difficulty. +BUG FIX: TurnMirror, TurnLeft, and TurnShuffle now work. TurnRight does the same + thing is as TurnLeft temporarily. +NEW FEATURE: Demonstration plays after sitting idle at title screen. ------------------------Version 3.00 beta 4------------------ BUG FIX: Fixed crash entering Config Joy/Key (duh!) @@ -1026,8 +1049,9 @@ Bug fix: Good and Boo arrows not being drawn. 21. Thanks ************************************************************ -Thnaks to: +Thanks to: Dj Slash & Tony Thai for the caution graphic + Kyle "KeeL" Ward for his awesome menu music (www.ampcast.com/keel) ************************************************************ End of document diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index a1930eec57..538eb0dfac 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -209,7 +209,7 @@ bool Background::LoadFromSong( Song* pSong, bool bDisableVisualizations ) GetDirListing( RANDOMMOVIES_DIR + "*.avi", asMovieNames ); GetDirListing( RANDOMMOVIES_DIR + "*.mpg", asMovieNames ); GetDirListing( RANDOMMOVIES_DIR + "*.mpeg", asMovieNames ); - for( int i=0; i &arr case PLAY_MODE_ONI: case PLAY_MODE_ENDLESS: { + int i; + CArray apCourses; switch( GAMESTATE->m_PlayMode ) { case PLAY_MODE_ONI: - for( int i=0; im_aOniCourses.GetSize(); i++ ) + for( i=0; im_aOniCourses.GetSize(); i++ ) apCourses.Add( &SONGMAN->m_aOniCourses[i] ); SortCoursePointerArrayByDifficulty( apCourses ); break; case PLAY_MODE_ENDLESS: - for( int i=0; im_aEndlessCourses.GetSize(); i++ ) + for( i=0; im_aEndlessCourses.GetSize(); i++ ) apCourses.Add( &SONGMAN->m_aEndlessCourses[i] ); break; } diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 6e9b5b9343..9e4799199d 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -510,12 +510,14 @@ void NoteData::Turn( PlayerOptions::TurnType tt ) { int iTakeFromTrack[MAX_NOTE_TRACKS]; // New track "t" will take from old track iTakeFromTrack[t] + int t; + switch( tt ) { case PlayerOptions::TURN_NONE: return; // nothing to do case PlayerOptions::TURN_MIRROR: - for( int t=0; t aiTracksLeftToMap; - for( int t=0; tConvertHoldNotesTo2sAnd3s(); // transform notes - for( int t=0; tm_fSongBeat - GetMaxBeatDifference() ); - + int iNumMisses = UpdateTapNotesMissedOlderThan( GAMESTATE->m_fSongBeat - GetMaxBeatDifference() ); + if( iNumMisses > 0 ) + int kjsdfsd = 0; // // update HoldNotes logic @@ -482,7 +483,7 @@ int Player::UpdateTapNotesMissedOlderThan( float fMissIfOlderThanThisBeat ) void Player::CrossedRow( int iNoteRow ) { - if( PREFSMAN->m_bAutoPlay ) + if( PREFSMAN->m_bAutoPlay || GAMESTATE->m_bDemonstration ) { // check to see if there's at the crossed row for( int t=0; tResetStageStatistics(); // clear values + // Update possible dance points for( int p=0; pAddSubActor( &m_sprFailed ); - m_Fade.SetClosed(); + if( GAMESTATE->m_bDemonstration ) + { + m_quadDemonstrationBox.SetDiffuseColor( D3DXCOLOR(0,0,0,0.7f) ); + m_quadDemonstrationBox.StretchTo( CRect(SCREEN_LEFT, int(CENTER_Y-60), SCREEN_RIGHT, int(CENTER_Y+60)) ); + this->AddSubActor( &m_quadDemonstrationBox ); + + m_sprDemonstration.Load( THEME->GetPathTo(GRAPHIC_GAMEPLAY_DEMONSTRATION) ); + m_sprDemonstration.SetXY( CENTER_X, CENTER_Y ); + m_sprDemonstration.SetEffectBlinking(); + this->AddSubActor( &m_sprDemonstration ); + + m_Fade.OpenWipingRight(); + } + m_Fade.SetOpened(); this->AddSubActor( &m_Fade ); @@ -403,40 +421,52 @@ ScreenGameplay::ScreenGameplay() - m_soundFail.Load( THEME->GetPathTo(SOUND_GAMEPLAY_FAILED) ); - m_soundOniDie.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ONI_DIE) ); - m_announcerReady.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_READY) ); - if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) - m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_EXTRA) ); - else if( GAMESTATE->IsFinalStage() ) - m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_FINAL) ); - else - m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_NORMAL) ); - m_announcerDanger.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_DANGER) ); - m_announcerGood.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_GOOD) ); - m_announcerHot.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_HOT) ); - - m_announcer100Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_100_COMBO) ); - m_announcer200Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_200_COMBO) ); - m_announcer300Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_300_COMBO) ); - m_announcer400Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_400_COMBO) ); - m_announcer500Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_500_COMBO) ); - m_announcer600Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_600_COMBO) ); - m_announcer700Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_700_COMBO) ); - m_announcer800Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_800_COMBO) ); - m_announcer900Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_900_COMBO) ); - m_announcer1000Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_1000_COMBO) ); - m_announcerComboStopped.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMBO_STOPPED) ); + if( !GAMESTATE->m_bDemonstration ) // don't load sounds if just playing demonstration + { + m_soundFail.Load( THEME->GetPathTo(SOUND_GAMEPLAY_FAILED) ); + m_soundOniDie.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ONI_DIE) ); + m_announcerReady.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_READY) ); + if( GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2() ) + m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_EXTRA) ); + else if( GAMESTATE->IsFinalStage() ) + m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_FINAL) ); + else + m_announcerHereWeGo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_HERE_WE_GO_NORMAL) ); + m_announcerDanger.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_DANGER) ); + m_announcerGood.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_GOOD) ); + m_announcerHot.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMMENT_HOT) ); + m_announcer100Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_100_COMBO) ); + m_announcer200Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_200_COMBO) ); + m_announcer300Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_300_COMBO) ); + m_announcer400Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_400_COMBO) ); + m_announcer500Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_500_COMBO) ); + m_announcer600Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_600_COMBO) ); + m_announcer700Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_700_COMBO) ); + m_announcer800Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_800_COMBO) ); + m_announcer900Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_900_COMBO) ); + m_announcer1000Combo.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_1000_COMBO) ); + m_announcerComboStopped.Load( ANNOUNCER->GetPathTo(ANNOUNCER_GAMEPLAY_COMBO_STOPPED) ); + } m_soundAssistTick.Load( THEME->GetPathTo(SOUND_GAMEPLAY_ASSIST_TICK) ); LoadNextSong( true ); - // Send some messages every have second to we can get the introduction rolling - for( int i=0; i<30; i++ ) - this->SendScreenMessage( ScreenMessage(SM_User+i), i/2.0f ); + + if( GAMESTATE->m_bDemonstration ) + { + m_StarWipe.SetOpened(); + m_DancingState = STATE_DANCING; + m_soundMusic.Play(); + this->SendScreenMessage( SM_BeginFadingToTitleMenu, DEMONSTRATION_TIME ); + } + else + { + for( int i=0; i<30; i++ ) + this->SendScreenMessage( ScreenMessage(SM_User+i), i/2.0f ); // Send messages to we can get the introduction rolling + } } ScreenGameplay::~ScreenGameplay() @@ -604,7 +634,6 @@ bool ScreenGameplay::AllFailedEarlier() void ScreenGameplay::Update( float fDeltaTime ) { //LOG->Trace( "ScreenGameplay::Update(%f)", fDeltaTime ); - Screen::Update( fDeltaTime ); m_soundMusic.Update( fDeltaTime ); @@ -612,17 +641,19 @@ void ScreenGameplay::Update( float fDeltaTime ) return; + // update the global music statistics for other classes to access float fPositionSeconds = m_soundMusic.GetPositionSeconds(); float fSongBeat, fBPS; bool bFreeze; GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( fPositionSeconds, fSongBeat, fBPS, bFreeze ); - // update the global music statistics for other classes to access GAMESTATE->m_fMusicSeconds = fPositionSeconds; GAMESTATE->m_fSongBeat = fSongBeat; GAMESTATE->m_fCurBPS = fBPS; GAMESTATE->m_bFreeze = bFreeze; + +// LOG->Trace( "GAMESTATE->m_fMusicSeconds = %f", GAMESTATE->m_fMusicSeconds ); m_Background.SetSongBeat( fSongBeat, bFreeze, fPositionSeconds ); @@ -666,14 +697,15 @@ void ScreenGameplay::Update( float fDeltaTime ) for( int p=0; pIsPlayerEnabled(p) ) if( m_pLifeMeter[p]->IsFailing() && GAMESTATE->m_fSecondsBeforeFail[p] == -1 ) // not yet failed - { - // kill them! - GAMESTATE->m_fSecondsBeforeFail[p] = GAMESTATE->GetElapsedSeconds(); - m_soundOniDie.PlayRandom(); - ShowOniGameOver((PlayerNumber)p); - m_Player[p].Init(); // remove all notes and scoring - m_Player[p].FadeToFail(); // tell the NoteField to fade to white - } + if( !AllFailedEarlier() ) // if not the last one to fail + { + // kill them! + GAMESTATE->m_fSecondsBeforeFail[p] = GAMESTATE->GetElapsedSeconds(); + m_soundOniDie.PlayRandom(); + ShowOniGameOver((PlayerNumber)p); + m_Player[p].Init(); // remove all notes and scoring + m_Player[p].FadeToFail(); // tell the NoteField to fade to white + } break; } break; @@ -687,17 +719,22 @@ void ScreenGameplay::Update( float fDeltaTime ) // // Check to see if it's time to play a gameplay comment // - m_fTimeLeftBeforeDancingComment -= fDeltaTime; - if( m_fTimeLeftBeforeDancingComment <= 0 ) + if( !GAMESTATE->m_bDemonstration ) // don't play announcer comments in demonstration { - m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS; // reset for the next comment + m_fTimeLeftBeforeDancingComment -= fDeltaTime; + if( m_fTimeLeftBeforeDancingComment <= 0 ) + { + m_fTimeLeftBeforeDancingComment = TIME_BETWEEN_DANCING_COMMENTS; // reset for the next comment - if( OneIsHot() ) - m_announcerHot.PlayRandom(); - else if( AllAreInDanger() ) - m_announcerDanger.PlayRandom(); - else - m_announcerGood.PlayRandom(); + + + if( OneIsHot() ) + m_announcerHot.PlayRandom(); + else if( AllAreInDanger() ) + m_announcerDanger.PlayRandom(); + else + m_announcerGood.PlayRandom(); + } } } @@ -759,6 +796,9 @@ void ScreenGameplay::Update( float fDeltaTime ) iRowLastCrossed = iRowNow; } + + + Screen::Update( fDeltaTime ); } @@ -772,9 +812,16 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ { //LOG->Trace( "ScreenGameplay::Input()" ); - float fSongBeat, fBPS; - bool bFreeze; - GAMESTATE->m_pCurSong->GetBeatAndBPSFromElapsedTime( m_soundMusic.GetPositionSeconds(), fSongBeat, fBPS, bFreeze ); + if( GAMESTATE->m_bDemonstration ) + { + if( MenuI.button == MENU_BUTTON_START ) + { + m_soundMusic.Stop(); + SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_INSERT_COIN) ); + m_Fade.CloseWipingRight( SM_GoToTitleMenu ); + } + return; // don't fall through below + } // Handle special keys to adjust the offset @@ -806,7 +853,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ } if( type == IET_FAST_REPEAT ) fOffsetDelta *= 10; - BPMSegment& seg = GAMESTATE->m_pCurSong->GetBPMSegmentAtBeat( fSongBeat ); + BPMSegment& seg = GAMESTATE->m_pCurSong->GetBPMSegmentAtBeat( GAMESTATE->m_fSongBeat ); seg.m_fBPM += fOffsetDelta; @@ -867,8 +914,6 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ // if( m_DancingState == STATE_DANCING ) { - const float fMaxBeatDifference = fBPS * PREFSMAN->m_fJudgeWindow * GAMESTATE->m_SongOptions.m_fMusicRate; - if( type == IET_FIRST_PRESS ) { if( StyleI.IsValid() ) @@ -880,7 +925,7 @@ void ScreenGameplay::Input( const DeviceInput& DeviceI, const InputEventType typ } } -void SaveChanges( void* pContext ) +void SaveChanges() { switch( GAMESTATE->m_PlayMode ) { @@ -902,7 +947,7 @@ void SaveChanges( void* pContext ) } } -void DontSaveChanges( void* pContext ) +void DontSaveChanges() { switch( GAMESTATE->m_PlayMode ) { @@ -1060,6 +1105,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) LoadNextSong( false ); m_OniFade.OpenWipingRight( SM_None ); break; + case SM_BeginFadingToTitleMenu: + m_Fade.CloseWipingRight( SM_GoToTitleMenu ); + break; case SM_100Combo: if( m_fTimeLeftBeforeDancingComment < 12 ) @@ -1187,7 +1235,8 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) m_DancingState = STATE_OUTRO; m_soundMusic.Pause(); m_StarWipe.CloseWipingRight( SM_None ); - for( int p=0; pIsPlayerEnabled(p) ) m_Player[p].FadeToFail(); @@ -1258,6 +1307,9 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) else SCREENMAN->SetNewScreen( new ScreenGameOver ); break; + case SM_GoToTitleMenu: + SCREENMAN->SetNewScreen( new ScreenTitleMenu ); + break; } } diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index aad66dacf0..595d88e611 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -113,6 +113,9 @@ private: Sprite m_sprOniGameOver[NUM_PLAYERS]; void ShowOniGameOver( PlayerNumber p ); + Quad m_quadDemonstrationBox; + Sprite m_sprDemonstration; + RandomSample m_soundFail; RandomSample m_soundOniDie; RandomSample m_announcerReady; diff --git a/stepmania/src/ScreenPrompt.cpp b/stepmania/src/ScreenPrompt.cpp index ef2637fca1..a07775ab06 100644 --- a/stepmania/src/ScreenPrompt.cpp +++ b/stepmania/src/ScreenPrompt.cpp @@ -26,7 +26,7 @@ const float PROMPT_X = CENTER_X; const float PROMPT_Y = CENTER_Y + 120; -ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer, void(*OnYes)(void* pContext), void(*OnNo)(void* pContext) ) +ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer, void(*OnYes)(), void(*OnNo)() ) { m_SMSendWhenDone = SM_SendWhenDone; m_pOnYes = OnYes; @@ -154,8 +154,12 @@ void ScreenPrompt::MenuStart( const PlayerNumber p ) m_textAnswer[1].BeginTweening( 0.2f ); m_textAnswer[1].SetTweenDiffuseColor( D3DXCOLOR(1,1,1,0) ); - SOUND->PlayOnceStreamed( THEME->GetPathTo(SOUND_MENU_START) ); + + if( m_bAnswer ) + m_pOnYes(); + else + m_pOnNo(); } void ScreenPrompt::MenuBack( const PlayerNumber p ) diff --git a/stepmania/src/ScreenPrompt.h b/stepmania/src/ScreenPrompt.h index fd8d95f0d0..6e970b6dcc 100644 --- a/stepmania/src/ScreenPrompt.h +++ b/stepmania/src/ScreenPrompt.h @@ -25,7 +25,7 @@ class ScreenPrompt : public Screen { public: ScreenPrompt(); - ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL ); + ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, PromptType pt, bool bDefaultAnswer = false, void(*OnYes)() = NULL, void(*OnNo)() = NULL ); virtual void Update( float fDeltaTime ); virtual void DrawPrimitives(); @@ -46,7 +46,7 @@ protected: PromptType m_PromptType; bool m_bAnswer; // true = "YES", false = "NO"; ScreenMessage m_SMSendWhenDone; - void(*m_pOnYes)(void* pContext); - void(*m_pOnNo)(void* pContext); + void(*m_pOnYes)(); + void(*m_pOnNo)(); }; diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index f2d14041ac..7ceab5fbb9 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -30,6 +30,7 @@ #include "ScreenEz2SelectPlayer.h" #include "GameState.h" #include "GameManager.h" +#include "ScreenGameplay.h" // @@ -52,7 +53,7 @@ const float CHOICES_GAP_Y = 52; const float HELP_X = CENTER_X; const float HELP_Y = SCREEN_HEIGHT-55; -const CString EZ2_ANNOUNCER_NAME = "ez2"; +//const CString EZ2_ANNOUNCER_NAME = "ez2"; const ScreenMessage SM_PlayAttract = ScreenMessage(SM_User+1); const ScreenMessage SM_GoToCaution = ScreenMessage(SM_User+2); @@ -64,6 +65,12 @@ const ScreenMessage SM_GoToAppearanceOptions= ScreenMessage(SM_User+7); const ScreenMessage SM_GoToEdit = ScreenMessage(SM_User+10); const ScreenMessage SM_DoneOpening = ScreenMessage(SM_User+11); const ScreenMessage SM_GoToEz2 = ScreenMessage(SM_User+12); +const ScreenMessage SM_FadeToDemonstration = ScreenMessage(SM_User+13); +const ScreenMessage SM_GoToDemonstration = ScreenMessage(SM_User+14); + + +const float SECONDS_BEFORE_DEMONSTRATION = 5; + ScreenTitleMenu::ScreenTitleMenu() { @@ -76,8 +83,6 @@ ScreenTitleMenu::ScreenTitleMenu() INPUTMAPPER->ReadMappingsFromDisk(); - int i; - m_sprBG.Load( THEME->GetPathTo(GRAPHIC_TITLE_MENU_BACKGROUND) ); m_sprBG.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) ); m_sprBG.SetDiffuseColor( D3DXCOLOR(0.6f,0.6f,0.6f,1) ); @@ -121,7 +126,7 @@ ScreenTitleMenu::ScreenTitleMenu() this->AddSubActor( &m_textSongs ); - for( i=0; i< NUM_TITLE_MENU_CHOICES; i++ ) + for( int i=0; i< NUM_TITLE_MENU_CHOICES; i++ ) { m_textChoice[i].Load( THEME->GetPathTo(FONT_HEADER1) ); m_textChoice[i].SetText( CHOICE_TEXT[i] ); @@ -138,7 +143,7 @@ ScreenTitleMenu::ScreenTitleMenu() /* // Chris: - // I'm removing thos not that announcer prefs are saved per Game. + // I'm removing this now that announcer prefs are saved per Game. // LEAVE THIS HERE! ITS ESSENTIAL // I know you're a fan of removing my code, but if this isn't here @@ -202,16 +207,14 @@ ScreenTitleMenu::ScreenTitleMenu() m_soundInvalid.Load( THEME->GetPathTo(SOUND_MENU_INVALID) ); - for( i=0; i<3000; i++ ) - this->SendScreenMessage( SM_PlayAttract, (float)20+i*20 ); - - m_TitleMenuChoice = CHOICE_GAME_START; GainFocus( m_TitleMenuChoice ); MUSIC->Stop(); - //this->SendScreenMessage( SM_TimeToFadeOut, 30.0 ); + for( i=12; iSendScreenMessage( SM_PlayAttract, (float)i ); + this->SendScreenMessage( SM_FadeToDemonstration, SECONDS_BEFORE_DEMONSTRATION ); } @@ -237,9 +240,6 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM ) { case SM_DoneOpening: break; - case SM_PlayAttract: - m_soundAttract.PlayRandom(); - break; case SM_GoToCaution: SCREENMAN->SetNewScreen( new ScreenCaution ); break; @@ -264,6 +264,73 @@ void ScreenTitleMenu::HandleScreenMessage( const ScreenMessage SM ) case SM_GoToEz2: SCREENMAN->SetNewScreen( new ScreenEz2SelectPlayer ); break; + case SM_FadeToDemonstration: + { + // Set up the game state for a demonstration + switch( GAMESTATE->m_CurGame ) + { + case GAME_DANCE: GAMESTATE->m_CurStyle = STYLE_DANCE_VERSUS; break; + case GAME_PUMP: GAMESTATE->m_CurStyle = STYLE_PUMP_VERSUS; break; + case GAME_EZ2: GAMESTATE->m_CurStyle = STYLE_EZ2_SINGLE_VERSUS; break; + default: ASSERT(0); + } + + GAMESTATE->m_PlayMode = PLAY_MODE_ARCADE; + + // choose a Song and Notes + Song* pSongToPlay = NULL; + Notes* pNotesToPlay = NULL; + for( int i=0; i<100; i++ ) // try 100 times + { + Song* pSong = SONGMAN->m_pSongs[ rand()%SONGMAN->m_pSongs.GetSize() ]; + for( int j=0; j<10; j++ ) // try 10 times + { + Notes* pNotes = pSong->m_apNotes[ rand()%pSong->m_apNotes.GetSize() ]; + if( pNotes->m_NotesType == GAMESTATE->GetCurrentStyleDef()->m_NotesType ) + { + // found something we can use! + pSongToPlay = pSong; + pNotesToPlay = pNotes; + goto found_song_and_notes; + } + } + } + // Couldn't find Song/Notes to play. Abort demonstration! + GAMESTATE->Reset(); + return; + +found_song_and_notes: + ASSERT( pSongToPlay ); + + GAMESTATE->m_pCurSong = pSongToPlay; + for( int p=0; pm_pCurNotes[p] = pNotesToPlay; + + // choose some cool options + for( p=0; pIsPlayerEnabled(p) ) + { + GAMESTATE->m_PlayerOptions[p].m_fArrowScrollSpeed = (RandomFloat(0,1)>0.7f ? 1.5f : 1.0f) ; + GAMESTATE->m_PlayerOptions[p].m_EffectType = PlayerOptions::EffectType(rand()%PlayerOptions::NUM_EFFECT_TYPES); + GAMESTATE->m_PlayerOptions[p].m_AppearanceType = PlayerOptions::AppearanceType(rand()%(PlayerOptions::NUM_APPEARANCE_TYPES-1)); // don't use blink + GAMESTATE->m_PlayerOptions[p].m_bReverseScroll = RandomFloat(0,1) > 0.8f; + GAMESTATE->m_PlayerOptions[p].m_ColorType = PlayerOptions::ColorType(rand()%PlayerOptions::NUM_COLOR_TYPES); + GAMESTATE->m_PlayerOptions[p].m_bDark = RandomFloat(0,1) > 0.8f; + } + } + GAMESTATE->m_SongOptions.m_LifeType = SongOptions::LifeType(rand()%SongOptions::NUM_LIFE_TYPES); + + GAMESTATE->m_bDemonstration = true; + m_Fade.CloseWipingRight( SM_GoToDemonstration ); + } + break; + case SM_GoToDemonstration: + { + ASSERT( GAMESTATE->m_pCurSong ); + SCREENMAN->SetNewScreen( new ScreenGameplay ); + } + break; } } diff --git a/stepmania/src/SongOptions.h b/stepmania/src/SongOptions.h index 9ad6d9712b..9fda39c584 100644 --- a/stepmania/src/SongOptions.h +++ b/stepmania/src/SongOptions.h @@ -14,7 +14,7 @@ struct SongOptions { - enum LifeType { LIFE_BAR=0, LIFE_BATTERY }; + enum LifeType { LIFE_BAR=0, LIFE_BATTERY, NUM_LIFE_TYPES }; LifeType m_LifeType; enum DrainType { DRAIN_NORMAL, DRAIN_NO_RECOVER, DRAIN_SUDDEN_DEATH }; DrainType m_DrainType; // only used with LifeBar diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 223b61b459..16068abd21 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -694,6 +694,7 @@ HRESULT CreateObjects( HWND hWnd ) BringWindowToTop( hWnd ); SetForegroundWindow( hWnd ); + //SCREENMAN->SetNewScreen( new ScreenAttractLogo ); SCREENMAN->SetNewScreen( new ScreenTitleMenu ); //SCREENMAN->SetNewScreen( new ScreenLoading ); //SCREENMAN->SetNewScreen( new ScreenSandbox ); diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 4729bb5b7d..af38391005 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -456,6 +456,14 @@ SOURCE=.\TransitionKeepAlive.h # End Source File # Begin Source File +SOURCE=.\TransitionOniFade.cpp +# End Source File +# Begin Source File + +SOURCE=.\TransitionOniFade.h +# End Source File +# Begin Source File + SOURCE=.\TransitionRectWipe.cpp # End Source File # Begin Source File diff --git a/stepmania/src/ThemeManager.cpp b/stepmania/src/ThemeManager.cpp index a9266bb180..a1ca2b121d 100644 --- a/stepmania/src/ThemeManager.cpp +++ b/stepmania/src/ThemeManager.cpp @@ -131,6 +131,7 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName ) case GRAPHIC_GAMEPLAY_DANGER_TEXT: sAssetPrefix = "Graphics\\gameplay danger text"; break; case GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_ICONS: sAssetPrefix = "Graphics\\gameplay difficulty banner icons";break; case GRAPHIC_GAMEPLAY_DIFFICULTY_BANNER_FRAME: sAssetPrefix = "Graphics\\gameplay difficulty banner frame";break; + case GRAPHIC_GAMEPLAY_DEMONSTRATION: sAssetPrefix = "Graphics\\gameplay demonstration"; break; case GRAPHIC_GAMEPLAY_FAILED: sAssetPrefix = "Graphics\\gameplay failed"; break; case GRAPHIC_GAMEPLAY_HERE_WE_GO: sAssetPrefix = "Graphics\\gameplay here we go"; break; case GRAPHIC_GAMEPLAY_JUDGEMENT: sAssetPrefix = "Graphics\\gameplay judgement 1x9"; break; @@ -247,6 +248,7 @@ CString ThemeManager::GetPathTo( ThemeElement te, CString sThemeName ) case SOUND_GAMEPLAY_ONI_GAIN_LIFE: sAssetPrefix = "Sounds\\gameplay oni gain life"; break; case SOUND_GAMEPLAY_ONI_LOSE_LIFE: sAssetPrefix = "Sounds\\gameplay oni lose life"; break; case SOUND_GAMEPLAY_ONI_DIE: sAssetPrefix = "Sounds\\gameplay oni die"; break; + case SOUND_INSERT_COIN: sAssetPrefix = "Sounds\\insert coin"; break; case SOUND_MENU_BACK: sAssetPrefix = "Sounds\\menu back"; break; case SOUND_MENU_EXPLANATION_SWOOSH: sAssetPrefix = "Sounds\\menu explanation swoosh"; break; case SOUND_MENU_INVALID: sAssetPrefix = "Sounds\\menu invalid"; break; diff --git a/stepmania/src/ThemeManager.h b/stepmania/src/ThemeManager.h index 0d9116b12d..e3d1cd74a0 100644 --- a/stepmania/src/ThemeManager.h +++ b/stepmania/src/ThemeManager.h @@ -38,6 +38,7 @@ enum ThemeElement { GRAPHIC_GAMEPLAY_COMBO, GRAPHIC_GAMEPLAY_DANGER_BACKGROUND, GRAPHIC_GAMEPLAY_DANGER_TEXT, + GRAPHIC_GAMEPLAY_DEMONSTRATION, GRAPHIC_GAMEPLAY_FAILED, GRAPHIC_GAMEPLAY_JUDGEMENT, GRAPHIC_GAMEPLAY_READY, @@ -151,6 +152,7 @@ enum ThemeElement { SOUND_EDIT_CHANGE_SNAP, SOUND_EDIT_SAVE, SOUND_EVALUATION_EXTRA_STAGE, + SOUND_INSERT_COIN, SOUND_GAMEPLAY_ASSIST_TICK, SOUND_GAMEPLAY_FAILED, SOUND_GAMEPLAY_ONI_GAIN_LIFE,