diff --git a/stepmania/src/ArrowEffects.cpp b/stepmania/src/ArrowEffects.cpp index 6f2fdeef8c..b74e6d2602 100644 --- a/stepmania/src/ArrowEffects.cpp +++ b/stepmania/src/ArrowEffects.cpp @@ -105,6 +105,8 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos ) if (blinktimer == 0) blinktimer = TIMER->GetTimeSinceStart(); + const bool bReverse = GAMESTATE->m_PlayerOptions[pn].m_bReverseScroll; + static int blinkstate=2; switch( GAMESTATE->m_PlayerOptions[pn].m_AppearanceType ) { @@ -112,10 +114,10 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos ) fAlpha = 1; break; case PlayerOptions::APPEARANCE_HIDDEN: - fAlpha = (fYPos-100)/200; + fAlpha = ((bReverse?-fYPos:fYPos)-100)/200; break; case PlayerOptions::APPEARANCE_SUDDEN: - fAlpha = ((SCREEN_HEIGHT-fYPos)-260)/200; + fAlpha = ((SCREEN_HEIGHT-(bReverse?-fYPos:fYPos))-260)/200; break; case PlayerOptions::APPEARANCE_STEALTH: fAlpha = 0; @@ -160,7 +162,9 @@ float ArrowGetAlpha( const PlayerNumber pn, float fYPos ) ASSERT( false ); fAlpha = 0; }; - if( fYPos < 0 ) + if( !bReverse && fYPos < 0 ) + fAlpha = 1; + else if( bReverse && fYPos > 0 ) fAlpha = 1; return fAlpha; diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 693482e54d..3a82a10819 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -24,7 +24,6 @@ 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(); } @@ -62,10 +61,11 @@ void GameState::Reset() m_apSongsPlayed.RemoveAll(); + m_iSongsIntoCourse = 0; 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() ) diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index d393e15ff5..360b5b2a39 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -48,7 +48,7 @@ public: SongSortOrder m_SongSortOrder; // used by MusicWheel PlayMode m_PlayMode; bool m_bEditing; - int m_iCurrentStageIndex; // incremented after a song ends + int m_iCurrentStageIndex; // incremented on Eval screen int GetStageIndex(); bool IsFinalStage(); @@ -79,11 +79,13 @@ public: // and used to calculate the time into a course float GetElapsedSeconds(); // Arcade: time into current song. Oni/Endless: time into current course + int m_iSongsIntoCourse; // In Arcade, this value is meaningless. + // In Oni and Endless, this is the number of songs played in the current course. + int m_iSongsBeforeFail[NUM_PLAYERS]; // In Arcade, this value is meaningless. + // In Oni and Endless, this is the number of songs played before failing. float m_fSecondsBeforeFail[NUM_PLAYERS];// -1 means not yet failed // In Arcade, is the time into the current stage before failing. // In Oni and Endless this is the time into the current course before failing - int m_iStagesIntoCourse[NUM_PLAYERS]; // In Arcade, this value is meaningless. - // In Oni and Endless, this is the number of songs played before failing. bool m_bUsedAutoPlayer; // Used autoplayer at any time during any stage/course/song float GetPlayerSurviveTime( PlayerNumber p ); diff --git a/stepmania/src/NoteDataWithScoring.cpp b/stepmania/src/NoteDataWithScoring.cpp index 4c2adc66ef..75b02e0cd0 100644 --- a/stepmania/src/NoteDataWithScoring.cpp +++ b/stepmania/src/NoteDataWithScoring.cpp @@ -26,7 +26,10 @@ void NoteDataWithScoring::Init() m_TapNoteScores[t][i] = TNS_NONE; for( int i=0; i 0.0 when the HoldNote ends, then + // m_HoldScore becomes HSS_OK. // statistics diff --git a/stepmania/src/NoteField.cpp b/stepmania/src/NoteField.cpp index c7374336ff..2f9147b16b 100644 --- a/stepmania/src/NoteField.cpp +++ b/stepmania/src/NoteField.cpp @@ -48,6 +48,11 @@ void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBeh m_iPixelsToDrawBehind = iPixelsToDrawBehind; m_iPixelsToDrawAhead = iPixelsToDrawAhead; + NoteDataWithScoring::Init(); + + for( int i=0; iGetCurrentStyleDef(); this->CopyAll( pNoteData ); @@ -63,7 +68,7 @@ void NoteField::Load( NoteData* pNoteData, PlayerNumber pn, int iPixelsToDrawBeh for( int i=0; iGetCurrentStyleDef()->m_iColsPerPlayer ); @@ -266,7 +271,12 @@ void NoteField::DrawPrimitives() for( int i=0; i 0, then it was completed and don't draw it! - if( hn.m_iEndIndex < BeatToNoteRow(fSongBeat) && fLife > 0 ) + if( hn.m_iEndIndex < BeatToNoteRow(fSongBeat) && fLife > 0 && m_bIsHoldingHoldNote[i] ) continue; // skip const int iCol = hn.m_iTrack; - const float fHoldNoteLife = m_HoldNoteLife[i]; - const bool bActive = NoteRowToBeat(hn.m_iStartIndex-1) <= fSongBeat && fSongBeat <= NoteRowToBeat(hn.m_iEndIndex); // hack: added -1 because hn.m_iStartIndex changes as note is held + const float fHoldNoteLife = m_fHoldNoteLife[i]; + const bool bActive = m_bIsHoldingHoldNote[i]; // hack: added -1 because hn.m_iStartIndex changes as note is held // parts of the hold const float fStartDrawingAtBeat = froundf( (float)hn.m_iStartIndex, ROWS_BETWEEN_HOLD_BITS/GAMESTATE->m_PlayerOptions[m_PlayerNumber].m_fArrowScrollSpeed ); @@ -299,7 +309,7 @@ void NoteField::DrawPrimitives() if( j < iIndexFirstArrowToDraw || iIndexLastArrowToDraw < j) continue; // skip this arrow - if( fLife > 0 && NoteRowToBeat(j) < fSongBeat ) + if( bActive && NoteRowToBeat(j) < fSongBeat ) continue; CreateHoldNoteInstance( instances[iCount++], bActive, (float)j, hn, fHoldNoteLife ); @@ -325,17 +335,25 @@ void NoteField::DrawPrimitives() // See if there is a hold step that begins on this beat. bool bHoldNoteOnThisBeat = false; + float fHoldLife = -1; for( int j=0; j mapDanceNoteToNoteDataColumn; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index fef6f30066..4528aa97c6 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -79,8 +79,6 @@ void Player::Load( PlayerNumber pn, NoteData* pNoteData, LifeMeter* pLM, ScoreDi // init scoring NoteDataWithScoring::Init(); - for( int i=0; iIsButtonDown( GameI ) || PREFSMAN->m_bAutoPlay; // if they got a bad score or haven't stepped on the corresponding tap yet - const bool bSteppedOnTapNote = m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] >= TNS_GREAT; + const bool bSteppedOnTapNote = m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_NONE && + m_TapNoteScores[hn.m_iTrack][hn.m_iStartIndex] != TNS_MISS; + m_NoteField.m_bIsHoldingHoldNote[i] = bIsHoldingButton && bSteppedOnTapNote; if( bIsHoldingButton && bSteppedOnTapNote ) { @@ -178,7 +178,7 @@ void Player::Update( float fDeltaTime ) m_GhostArrowRow.HoldNote( hn.m_iTrack ); // update the "electric ghost" effect } - else // !bIsHoldingButton + else { if( fSongBeat-fStartBeat > GetMaxBeatDifference() ) { @@ -187,7 +187,7 @@ void Player::Update( float fDeltaTime ) fLife = max( fLife, 0 ); // clamp } } - m_NoteField.SetHoldNoteLife( i, fLife ); // update the NoteField display + m_NoteField.m_fHoldNoteLife[i] = fLife; // update the NoteField display } // check for NG @@ -197,6 +197,7 @@ void Player::Update( float fDeltaTime ) HandleNoteScore( hns ); m_Combo.EndCombo(); m_HoldJudgement[hn.m_iTrack].SetHoldJudgement( HNS_NG ); + m_NoteField.m_HoldNoteScores[i] = HNS_NG; // update the NoteField display } // check for OK @@ -207,7 +208,8 @@ void Player::Update( float fDeltaTime ) hns = HNS_OK; HandleNoteScore( hns ); m_HoldJudgement[hn.m_iTrack].SetHoldJudgement( HNS_OK ); - m_NoteField.SetHoldNoteLife( i, fLife ); // update the NoteField display + m_NoteField.m_fHoldNoteLife[i] = fLife; // update the NoteField display + m_NoteField.m_HoldNoteScores[i] = HNS_OK; // update the NoteField display } } @@ -369,7 +371,18 @@ void Player::OnRowDestroyed( int col, int iIndexThatWasSteppedOn ) score = min( score, m_TapNoteScores[t][iIndexThatWasSteppedOn] ); // remove this row from the NoteField - if ( ( score == TNS_PERFECT ) || ( score == TNS_GREAT ) ) + bool bHoldNoteOnThisBeat = false; + for( int j=0; j 0.0 when the HoldNote ends, then - // m_HoldScore becomes HSS_OK. int m_iNumTapNotes; // num of TapNotes for the current notes needed by scoring int m_iTapNotesHit; // number of notes judged so far, needed by scoring int m_iMeter; // meter of current steps, needed by scoring diff --git a/stepmania/src/ScreenEvaluation.cpp b/stepmania/src/ScreenEvaluation.cpp index fc2850e07c..79d439fc46 100644 --- a/stepmania/src/ScreenEvaluation.cpp +++ b/stepmania/src/ScreenEvaluation.cpp @@ -340,7 +340,7 @@ ScreenEvaluation::ScreenEvaluation( bool bSummary ) } m_BonusInfoFrame[p].SetBonusInfo( (PlayerNumber)p, fPossibleRadarValues[p], fActualRadarValues[p], iMaxCombo[p] ); - m_StageBox[p].SetStageInfo( (PlayerNumber)p, GAMESTATE->m_iStagesIntoCourse[p] ); + m_StageBox[p].SetStageInfo( (PlayerNumber)p, GAMESTATE->m_iSongsBeforeFail[p] ); } diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index f9371610c7..c5284b7031 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -42,6 +42,10 @@ const float STAGE_NUMBER_LOCAL_X = 0; const float STAGE_NUMBER_LOCAL_Y = +20; const float STAGE_NUMBER_LOCALEZ2_Y = -30; +const float SONG_NUMBER_LOCAL_X[NUM_PLAYERS] = { STAGE_NUMBER_LOCAL_X-16, STAGE_NUMBER_LOCAL_X+16 }; +const float SONG_NUMBER_LOCAL_Y[NUM_PLAYERS] = { STAGE_NUMBER_LOCAL_Y, STAGE_NUMBER_LOCAL_Y }; + + const float SCORE_LOCAL_X[NUM_PLAYERS] = { -214, +214 }; const float SCORE_LOCAL_Y[NUM_PLAYERS] = { -6, -6 }; @@ -61,7 +65,8 @@ const float TIME_BETWEEN_DANCING_COMMENTS = 13; // received while STATE_DANCING -const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+102); +const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+101); +const ScreenMessage SM_BeginLoadingNextSong = ScreenMessage(SM_User+102); const ScreenMessage SM_LastNotesEnded = ScreenMessage(SM_User+103); @@ -134,6 +139,9 @@ ScreenGameplay::ScreenGameplay() this->AddSubActor( &m_Background ); + m_OniFade.SetOpened(); + this->AddSubActor( &m_OniFade ); + for( p=0; pGetStageText() ); m_textStageNumber.SetDiffuseColor( GAMESTATE->GetStageColor() ); + for( int p=0; pGetPathTo(FONT_HEADER2) ); + m_textCourseSongNumber[p].TurnShadowOff(); + m_textCourseSongNumber[p].SetXY( SONG_NUMBER_LOCAL_X[p], SONG_NUMBER_LOCAL_Y[p] ); + m_textCourseSongNumber[p].SetText( "" ); + m_textCourseSongNumber[p].SetDiffuseColor( D3DXCOLOR(0.8f,0.8f,1,1) ); // light blue + } + if( GAMESTATE->m_CurGame == GAME_EZ2 ) { m_textStageNumber.SetXY( STAGE_NUMBER_LOCAL_X, STAGE_NUMBER_LOCALEZ2_Y ); @@ -202,7 +219,19 @@ ScreenGameplay::ScreenGameplay() m_textStageNumber.SetText( GAMESTATE->GetStageText() ); m_textStageNumber.SetDiffuseColor( GAMESTATE->GetStageColor() ); - m_frameTop.AddSubActor( &m_textStageNumber ); + switch( GAMESTATE->m_PlayMode ) + { + case PLAY_MODE_ARCADE: + m_frameTop.AddSubActor( &m_textStageNumber ); + break; + case PLAY_MODE_ONI: + case PLAY_MODE_ENDLESS: + for( int p=0; p apNotes[NUM_PLAYERS]; pCourse->GetSongAndNotesForCurrentStyle( apSongs, apNotes ); - return GAMESTATE->m_iCurrentStageIndex >= apSongs.GetSize(); // there are no more songs left + return GAMESTATE->m_iSongsIntoCourse >= apSongs.GetSize(); // there are no more songs left } break; default: @@ -431,7 +460,7 @@ void ScreenGameplay::LoadNextSong( bool bFirstLoad ) if( pCourse->m_bRandomize ) iPlaySongIndex = rand() % apSongs.GetSize(); else - iPlaySongIndex = GAMESTATE->m_iCurrentStageIndex; + iPlaySongIndex = GAMESTATE->m_iSongsIntoCourse; GAMESTATE->m_pCurSong = apSongs[iPlaySongIndex]; for( int p=0; p GAMESTATE->m_pCurSong->m_fLastBeat+4 ) + { + GAMESTATE->m_fSongBeat = 0; + m_soundMusic.Stop(); this->SendScreenMessage( SM_NotesEnded, 0 ); - + } + // // check for fail // @@ -902,8 +935,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) { if( GAMESTATE->IsPlayerEnabled(p) ) { - m_pLifeMeter[p]->SongEnded(); // let the oni life meter give them back a life - for( int r=0; rm_apSongsPlayed.Add( GAMESTATE->m_pCurSong ); + GAMESTATE->m_iSongsIntoCourse++; + for( int p=0; pIsPlayerEnabled(p) ) + if( !m_pLifeMeter[p]->FailedEarlier() ) + GAMESTATE->m_iSongsBeforeFail[p]++; - GAMESTATE->m_iCurrentStageIndex++; if( !IsLastSong() ) { - LoadNextSong( false ); + for( int p=0; pIsPlayerEnabled(p) ) + if( !m_pLifeMeter[p]->FailedEarlier() ) + m_pLifeMeter[p]->SongEnded(); // let the oni life meter give them back a life + + m_OniFade.CloseWipingRight( SM_BeginLoadingNextSong ); } else // IsLastSong { @@ -943,6 +983,11 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) } break; + case SM_BeginLoadingNextSong: + LoadNextSong( false ); + m_OniFade.OpenWipingRight( SM_None ); + break; + case SM_100Combo: if( m_fTimeLeftBeforeDancingComment < 12 ) { diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 2158119708..78d5761533 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -25,6 +25,7 @@ #include "ScoreDisplay.h" #include "DifficultyBanner.h" #include "TransitionFadeWipe.h" +#include "TransitionOniFade.h" // messages sent by Combo @@ -78,10 +79,13 @@ private: Background m_Background; + TransitionOniFade m_OniFade; // shows between songs in a course + ActorFrame m_frameTop; Sprite m_sprTopFrame; LifeMeter* m_pLifeMeter[NUM_PLAYERS]; BitmapText m_textStageNumber; + BitmapText m_textCourseSongNumber[NUM_PLAYERS]; ActorFrame m_frameBottom; Sprite m_sprBottomFrame; diff --git a/stepmania/src/ScreenPrompt.cpp b/stepmania/src/ScreenPrompt.cpp index 22aab9d6cc..ef2637fca1 100644 --- a/stepmania/src/ScreenPrompt.cpp +++ b/stepmania/src/ScreenPrompt.cpp @@ -36,7 +36,7 @@ ScreenPrompt::ScreenPrompt( ScreenMessage SM_SendWhenDone, CString sText, Prompt m_bAnswer = bDefaultAnswer; m_Fade.SetTransitionTime( 0.5f ); - m_Fade.SetColor( D3DXCOLOR(0,0,0,0.7f) ); + m_Fade.SetDiffuseColor( D3DXCOLOR(0,0,0,0.7f) ); m_Fade.SetOpened(); m_Fade.CloseWipingRight(); this->AddSubActor( &m_Fade ); diff --git a/stepmania/src/ScreenSelectCourse.cpp b/stepmania/src/ScreenSelectCourse.cpp index 346eb4b703..298ed1e284 100644 --- a/stepmania/src/ScreenSelectCourse.cpp +++ b/stepmania/src/ScreenSelectCourse.cpp @@ -29,6 +29,7 @@ #include "ScreenStage.h" #include "AnnouncerManager.h" #include "GameState.h" +#include "RageMusic.h" const float COURSE_INFO_FRAME_X = 160; @@ -54,6 +55,12 @@ ScreenSelectCourse::ScreenSelectCourse() { LOG->Trace( "ScreenSelectCourse::ScreenSelectCourse()" ); + if( !MUSIC->IsPlaying() ) + { + MUSIC->Load( THEME->GetPathTo(SOUND_MENU_MUSIC) ); + MUSIC->Play(true); + } + m_bMadeChoice = false; m_bGoToOptions = false; diff --git a/stepmania/src/ScreenSelectDifficulty.cpp b/stepmania/src/ScreenSelectDifficulty.cpp index c635f47ba8..af85298a63 100644 --- a/stepmania/src/ScreenSelectDifficulty.cpp +++ b/stepmania/src/ScreenSelectDifficulty.cpp @@ -65,7 +65,7 @@ const float DIFFICULTY_ARROW_X[NUM_DIFFICULTY_ITEMS][NUM_PLAYERS] = { const float ARROW_SHADOW_OFFSET = 10; -const float LOCK_INPUT_TIME = 0.50f; // lock input while waiting for tweening to complete +const float LOCK_INPUT_TIME = 0.30f; // lock input while waiting for tweening to complete const ScreenMessage SM_GoToPrevState = ScreenMessage(SM_User + 1); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 0302599b56..27dd895b97 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -696,32 +696,32 @@ bool Song::LoadFromDWIFile( CString sPath ) CString sValueName = sParams[0]; // handle the data - if( 0==stricmp(sValueName,"#FILE") ) + if( 0==stricmp(sValueName,"FILE") ) m_sMusicFile = sParams[1]; - else if( 0==stricmp(sValueName,"#TITLE") ) + else if( 0==stricmp(sValueName,"TITLE") ) GetMainAndSubTitlesFromFullTitle( sParams[1], m_sMainTitle, m_sSubTitle ); - else if( 0==stricmp(sValueName,"#ARTIST") ) + else if( 0==stricmp(sValueName,"ARTIST") ) m_sArtist = sParams[1]; - else if( 0==stricmp(sValueName,"#CDTITLE") ) + else if( 0==stricmp(sValueName,"CDTITLE") ) m_sCDTitleFile = sParams[1]; - else if( 0==stricmp(sValueName,"#BPM") ) + else if( 0==stricmp(sValueName,"BPM") ) AddBPMSegment( BPMSegment(0, (float)atof(sParams[1])) ); - else if( 0==stricmp(sValueName,"#GAP") ) + else if( 0==stricmp(sValueName,"GAP") ) // the units of GAP is 1/1000 second m_fBeat0OffsetInSeconds = -atoi( sParams[1] ) / 1000.0f; - else if( 0==stricmp(sValueName,"#SAMPLESTART") ) + else if( 0==stricmp(sValueName,"SAMPLESTART") ) m_fMusicSampleStartSeconds = TimeToSeconds( sParams[1] ); - else if( 0==stricmp(sValueName,"#SAMPLELENGTH") ) + else if( 0==stricmp(sValueName,"SAMPLELENGTH") ) m_fMusicSampleLengthSeconds = TimeToSeconds( sParams[1] ); - else if( 0==stricmp(sValueName,"#FREEZE") ) + else if( 0==stricmp(sValueName,"FREEZE") ) { CStringArray arrayFreezeExpressions; split( sParams[1], ",", arrayFreezeExpressions ); @@ -739,7 +739,7 @@ bool Song::LoadFromDWIFile( CString sPath ) } } - else if( 0==stricmp(sValueName,"#CHANGEBPM") || 0==stricmp(sValueName,"#BPMCHANGE") ) + else if( 0==stricmp(sValueName,"CHANGEBPM") || 0==stricmp(sValueName,"BPMCHANGE") ) { CStringArray arrayBPMChangeExpressions; split( sParams[1], ",", arrayBPMChangeExpressions ); @@ -756,10 +756,10 @@ bool Song::LoadFromDWIFile( CString sPath ) } } - else if( 0==stricmp(sValueName,"#SINGLE") || - 0==stricmp(sValueName,"#DOUBLE") || - 0==stricmp(sValueName,"#COUPLE") || - 0==stricmp(sValueName,"#SOLO")) + else if( 0==stricmp(sValueName,"SINGLE") || + 0==stricmp(sValueName,"DOUBLE") || + 0==stricmp(sValueName,"COUPLE") || + 0==stricmp(sValueName,"SOLO")) { Notes* pNewNotes = new Notes; pNewNotes->LoadFromDWITokens( diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index fb0e40df80..550208fcc9 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -134,7 +134,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() ) continue; // ignore it // this is a song directory. Load a new song! - GAMESTATE->m_sLoadingMessage = ssprintf("Loading songs...\n%s\n\n%s", sGroupDirName, sSongDirName); + GAMESTATE->m_sLoadingMessage = ssprintf("Loading songs...\n%s\n%s", sGroupDirName, sSongDirName); if( callback ) callback(); Song* pNewSong = new Song; diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 5da9692780..223b61b459 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -286,6 +286,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow ) Render(); if( !g_bIsActive && DISPLAY && DISPLAY->IsWindowed() ) ::Sleep( 0 ); // give some time to other processes +#ifdef _DEBUG + ::Sleep( 1 ); +#endif } } // end while( WM_QUIT != msg.message ) @@ -387,10 +390,10 @@ BOOL CALLBACK LoadingWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam case WM_PAINT: { CStringArray asMessageLines; - if( GAMESTATE ) + if( GAMESTATE && GAMESTATE->m_sLoadingMessage != "" ) split( GAMESTATE->m_sLoadingMessage, "\n", asMessageLines, false ); else - asMessageLines.Add( "Initializing hardware" ); + asMessageLines.Add( "Initializing hardware..." ); SendDlgItemMessage( hWnd, diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index cf774f03c0..25e30fa641 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -516,6 +516,12 @@ + + + + diff --git a/stepmania/src/Transition.cpp b/stepmania/src/Transition.cpp index 7a849ea6d8..fb84e229fb 100644 --- a/stepmania/src/Transition.cpp +++ b/stepmania/src/Transition.cpp @@ -20,7 +20,6 @@ Transition::Transition() m_TransitionState = closed, m_fTransitionTime = DEFAULT_TRANSITION_TIME; m_fPercentThroughTransition = 0.0f; - m_Color = D3DXCOLOR(0,0,0,1); } Transition::~Transition() diff --git a/stepmania/src/Transition.h b/stepmania/src/Transition.h index c81d2b0da3..24e37603b5 100644 --- a/stepmania/src/Transition.h +++ b/stepmania/src/Transition.h @@ -53,8 +53,6 @@ public: void SetTransitionTime( float fNewTransitionTime ) { m_fTransitionTime = fNewTransitionTime; }; - void SetColor( D3DXCOLOR new_color ) { m_Color = new_color; }; - protected: enum TransitionState { opened, closed, @@ -64,7 +62,7 @@ protected: TransitionState m_TransitionState; float m_fTransitionTime; float m_fPercentThroughTransition; - float GetPercentageOpen() + float GetPercentageOpen() { switch( m_TransitionState ) { @@ -83,11 +81,10 @@ protected: return 0; } }; + float GetPercentageClosed() { return 1-GetPercentageOpen(); }; ScreenMessage m_MessageToSendWhenDone; - - D3DXCOLOR m_Color; }; diff --git a/stepmania/src/TransitionFade.cpp b/stepmania/src/TransitionFade.cpp index 07ffe6a120..bad95f4ece 100644 --- a/stepmania/src/TransitionFade.cpp +++ b/stepmania/src/TransitionFade.cpp @@ -1,11 +1,12 @@ #include "stdafx.h" /* ----------------------------------------------------------------------------- - File: TransitionFade.cpp + Class: TransitionFade - Desc: Fades out or in. + Desc: See header. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ @@ -20,6 +21,7 @@ TransitionFade::TransitionFade() { m_rect.StretchTo( CRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT) ); + SetDiffuseColor( D3DXCOLOR(0,0,0,1) ); // black } TransitionFade::~TransitionFade() @@ -33,7 +35,7 @@ void TransitionFade::DrawPrimitives() if( fPercentageOpaque == 0 ) return; // draw nothing - D3DXCOLOR colorTemp = m_Color * fPercentageOpaque; + D3DXCOLOR colorTemp = m_colorDiffuse[0] * fPercentageOpaque; m_rect.SetDiffuseColor( colorTemp ); m_rect.Draw(); } diff --git a/stepmania/src/TransitionFade.h b/stepmania/src/TransitionFade.h index 8c010f367c..e536304237 100644 --- a/stepmania/src/TransitionFade.h +++ b/stepmania/src/TransitionFade.h @@ -1,18 +1,16 @@ +#pragma once /* ----------------------------------------------------------------------------- - File: TransitionFade.cpp + Class: TransitionFade - Desc: Fades out or in. + Desc: Fades whole screen to color. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford ----------------------------------------------------------------------------- */ -#ifndef _TransitionFade_H_ -#define _TransitionFade_H_ - - #include "Transition.h" #include "RageDisplay.h" #include "RageSound.h" @@ -31,7 +29,3 @@ protected: Quad m_rect; }; - - - -#endif \ No newline at end of file diff --git a/stepmania/src/TransitionOniFade.cpp b/stepmania/src/TransitionOniFade.cpp new file mode 100644 index 0000000000..af6ec7efb1 --- /dev/null +++ b/stepmania/src/TransitionOniFade.cpp @@ -0,0 +1,97 @@ +#include "stdafx.h" +/* +----------------------------------------------------------------------------- + Class: TransitionOniFade + + Desc: See header. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + +#include "RageUtil.h" + +#include "TransitionOniFade.h" +#include "GameConstantsAndTypes.h" +#include "PrefsManager.h" +#include "GameState.h" + + +TransitionOniFade::TransitionOniFade() +{ + SetDiffuseColor( D3DXCOLOR(1,1,1,1) ); // white + + m_quadBackground.StretchTo( CRect(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) ); + + m_quadStrip.StretchTo( CRect(SCREEN_LEFT, int(CENTER_Y-30), SCREEN_RIGHT, int(CENTER_Y+30)) ); + + m_textSongInfo.Load( THEME->GetPathTo(FONT_NORMAL) ); + m_textSongInfo.TurnShadowOff(); + m_textSongInfo.SetZoom( 0.5f ); + m_textSongInfo.SetXY( CENTER_X, CENTER_Y ); +} + +TransitionOniFade::~TransitionOniFade() +{ + +} + +void TransitionOniFade::DrawPrimitives() +{ + if( m_TransitionState == opened ) + return; + + if( m_TransitionState == closed ) + { + UpdateSongText(); + } + + m_quadBackground.SetDiffuseColor( D3DXCOLOR(1,1,1,SCALE(GetPercentageClosed(),0,1,-1,1)) ); + m_quadBackground.Draw(); + + if( m_TransitionState == closed || m_TransitionState == opening_right ) + { + m_quadStrip.SetDiffuseColor( D3DXCOLOR(0,0,0,SCALE(GetPercentageClosed(),0,1,0,2)) ); + m_quadStrip.Draw(); + + m_textSongInfo.SetDiffuseColor( D3DXCOLOR(1,1,1,SCALE(GetPercentageClosed(),0,1,0,2)) ); + m_textSongInfo.Draw(); + } +} + + +void TransitionOniFade::OpenWipingRight( ScreenMessage send_when_done ) +{ + SetTransitionTime( 4 ); + Transition::OpenWipingRight( send_when_done ); + UpdateSongText(); +} + +void TransitionOniFade::OpenWipingLeft( ScreenMessage send_when_done ) +{ + SetTransitionTime( 4 ); + Transition::OpenWipingLeft( send_when_done ); + UpdateSongText(); +} + +void TransitionOniFade::CloseWipingRight(ScreenMessage send_when_done ) +{ + SetTransitionTime( 2 ); + Transition::CloseWipingRight( send_when_done ); + UpdateSongText(); +} + +void TransitionOniFade::CloseWipingLeft( ScreenMessage send_when_done ) +{ + SetTransitionTime( 2 ); + Transition::CloseWipingLeft( send_when_done ); + UpdateSongText(); +} + +void TransitionOniFade::UpdateSongText() +{ + Song* pSong = GAMESTATE->m_pCurSong; + ASSERT( pSong ); + m_textSongInfo.SetText( pSong->GetFullTitle() + "\n" + pSong->m_sArtist + "\n"); +} diff --git a/stepmania/src/TransitionOniFade.h b/stepmania/src/TransitionOniFade.h new file mode 100644 index 0000000000..42b7690c71 --- /dev/null +++ b/stepmania/src/TransitionOniFade.h @@ -0,0 +1,44 @@ +#pragma once +/* +----------------------------------------------------------------------------- + Class: TransitionOniFade + + Desc: Fade to white and shows song title and artist info. + + Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. + Chris Danford +----------------------------------------------------------------------------- +*/ + + +#include "Transition.h" +#include "RageDisplay.h" +#include "RageSound.h" +#include "Sprite.h" +#include "Quad.h" +#include "TransitionFade.h" + + +class TransitionOniFade : public Transition +{ +public: + TransitionOniFade(); + ~TransitionOniFade(); + + virtual void DrawPrimitives(); + + virtual void OpenWipingRight( ScreenMessage send_when_done = SM_None ); + virtual void OpenWipingLeft( ScreenMessage send_when_done = SM_None ); + virtual void CloseWipingRight(ScreenMessage send_when_done = SM_None ); + virtual void CloseWipingLeft( ScreenMessage send_when_done = SM_None ); + +protected: + + void UpdateSongText(); + + Quad m_quadBackground; + Quad m_quadStrip; // background for song text + BitmapText m_textSongInfo; +}; + +