diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 7693a2c562..a3ac2ca8c0 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -348,7 +348,9 @@ InitCommand=horizalign,left;vertalign,top;shadowlength,2;zoom,0.5; [ScreenInstructions] NextScreenArcade=ScreenSelectMusic +NextScreenNonstop=ScreenSelectCourse NextScreenOni=ScreenSelectCourse +NextScreenEndless=ScreenSelectCourse NextScreenBattle=ScreenSelectMusic NextScreenRave=ScreenSelectCharacter HelpText=Press START to continue diff --git a/stepmania/src/BGAnimationLayer.cpp b/stepmania/src/BGAnimationLayer.cpp index 73718ef622..b969b8907a 100644 --- a/stepmania/src/BGAnimationLayer.cpp +++ b/stepmania/src/BGAnimationLayer.cpp @@ -453,25 +453,33 @@ void BGAnimationLayer::LoadFromIni( CString sAniDir, CString sLayer ) IniFile ini(sPathToIni); ini.ReadFile(); - CString sPath; - ini.GetValue( sLayer, "File", sPath ); + CString sFile; + ini.GetValue( sLayer, "File", sFile ); + + CString sPath = sAniDir+sFile; - bool bUseSongBG = false; - ini.GetValueB( sLayer, "UseSongBG", bUseSongBG ); - if( bUseSongBG ) { - /* Don't throw for missing song backgrounds. */ + if( sFile.CompareNoCase("songbackground")==0 ) + { Song *pSong = GAMESTATE->m_pCurSong; - if(pSong && pSong->HasBackground()) + if( pSong && pSong->HasBackground() ) sPath = pSong->GetBackgroundPath(); else sPath = THEME->GetPathToG("Common fallback background"); - } else { - if( sPath == "" ) - RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.GetString(), sLayer.GetString() ); + } + else if( sFile.CompareNoCase("songbanner")==0 ) + { + Song *pSong = GAMESTATE->m_pCurSong; + if( pSong && pSong->HasBanner() ) + sPath = pSong->GetBannerPath(); + else + sPath = THEME->GetPathToG("Common fallback banner"); + } + else if( sFile == "" ) + { + RageException::Throw( "In the ini file for BGAnimation '%s', '%s' is missing a the line 'File='.", sAniDir.GetString(), sLayer.GetString() ); - if( !DoesFileExist(sAniDir+sPath) ) - RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.GetString(), sPath.GetString() ); - sPath = sAniDir+sPath; + if( !DoesFileExist(sPath) ) + RageException::Throw( "In the ini file for BGAnimation '%s', the specified File '%s' does not exist.", sAniDir.GetString(), sFile.GetString() ); } ini.GetValueI( sLayer, "Type", (int&)m_Type ); diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index 015ea09031..4f4f715161 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -35,22 +35,21 @@ const float FADE_SECONDS = 1.0f; const CString STATIC_BACKGROUND = "static background"; -const int MAX_RANDOM_BACKGROUNDS = 5; +const int MAX_RANDOM_BACKGROUNDS = 4; const CString RANDOM_BACKGROUND[MAX_RANDOM_BACKGROUNDS] = { "__random1", "__random2", "__random3", "__random4", - "__random5" }; Background::Background() { - m_iCurBGChange = 0; m_bInDanger = false; + m_pCurrentBGA = NULL; m_pFadingBGA = NULL; m_fSecsLeftInFade = 0; @@ -83,7 +82,8 @@ void Background::Unload() m_BGAnimations.clear(); m_aBGChanges.clear(); - m_iCurBGChange = 0; + m_pCurrentBGA = NULL; + m_pFadingBGA = NULL; } void Background::LoadFromAniDir( CString sAniDir ) @@ -345,36 +345,42 @@ void Background::Update( float fDeltaTime ) if( GAMESTATE->m_fMusicSeconds == GameState::MUSIC_SECONDS_INVALID ) return; /* hasn't been updated yet */ + if( m_aBGChanges.size() == 0 ) + return; + /* If we're in a freeze, hold all animations (don't animate by calling Update). */ if( GAMESTATE->m_bFreeze ) return; // Find the BGSegment we're in - unsigned i; - for( i=0; im_fSongBeat < m_aBGChanges[i+1].m_fStartBeat ) break; - ASSERT( i >= 0 && i m_iCurBGChange ) + BGAnimation* pOld = m_pCurrentBGA; + CString sNewBGName = m_aBGChanges[i].m_sBGName; + BGAnimation* pNew = m_BGAnimations[sNewBGName]; + + if( pOld != pNew ) { - LOG->Trace( "new bga %d, %d, %f, %f", m_iCurBGChange, i, m_aBGChanges[i].m_fStartBeat, GAMESTATE->m_fSongBeat ); - BGAnimation* pOld = GetCurrentBGA(); - m_iCurBGChange = i; - BGAnimation* pNew = GetCurrentBGA(); + // LOG->Trace( "new bga %d, %d, %f, %f", m_iCurBGChange, i, m_aBGChanges[i].m_fStartBeat, GAMESTATE->m_fSongBeat ); + + m_pFadingBGA = pOld; + m_pCurrentBGA = pNew; - if( pOld != pNew ) - { + if( pOld ) pOld->LosingFocus(); + if( pNew ) pNew->GainingFocus(); - m_pFadingBGA = pOld; - bool bBGAnimsMode = PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_ANIMATIONS; - m_fSecsLeftInFade = bBGAnimsMode ? 0 : FADE_SECONDS; - } + bool bBGAnimsMode = PREFSMAN->m_BackgroundMode == PrefsManager::BGMODE_ANIMATIONS; + m_fSecsLeftInFade = bBGAnimsMode ? 0 : FADE_SECONDS; } - GetCurrentBGA()->Update( fDeltaTime ); + if( m_pCurrentBGA ) + m_pCurrentBGA->Update( fDeltaTime ); if( m_pFadingBGA ) { m_pFadingBGA->Update( fDeltaTime ); @@ -398,8 +404,9 @@ void Background::DrawPrimitives() m_BGADanger.Draw(); } else - { - GetCurrentBGA()->Draw(); + { + if( m_pCurrentBGA ) + m_pCurrentBGA->Draw(); if( m_pFadingBGA ) m_pFadingBGA->Draw(); } @@ -427,10 +434,3 @@ void Background::FadeOut() m_quadBGBrightness.SetDiffuse( RageColor(0,0,0,1-0.5f) ); } - -BGAnimation* Background::GetCurrentBGA() -{ - CString sBGName = m_aBGChanges[m_iCurBGChange].m_sBGName; - ASSERT( m_BGAnimations[ sBGName ] ); - return m_BGAnimations[ sBGName ]; -} diff --git a/stepmania/src/Background.h b/stepmania/src/Background.h index 62c5f560cc..605b9e8363 100644 --- a/stepmania/src/Background.h +++ b/stepmania/src/Background.h @@ -22,7 +22,6 @@ class Background : public ActorFrame { public: - Background(); ~Background(); @@ -46,14 +45,12 @@ protected: BGAnimation m_BGADanger; - BGAnimation* CreateSongBGA(const Song *pSong, CString sBGName) const; BGAnimation* CreateRandomBGA() const; map m_BGAnimations; vector m_aBGChanges; - int m_iCurBGChange; // starts at 0 and increases to m_aBGSegments.size()-1 - BGAnimation* GetCurrentBGA(); + BGAnimation* m_pCurrentBGA; BGAnimation* m_pFadingBGA; float m_fSecsLeftInFade; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index c90ed3fde7..543096807a 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -345,6 +345,8 @@ void Player::Step( int col ) //LOG->Trace( "iIndexStartLookingAt = %d, iNumElementsToExamine = %d", iIndexStartLookingAt, iNumElementsToExamine ); + bool bGrayArrowStep = true; + if( iIndexOverlappingNote != -1 ) { // compute the score for this hit @@ -384,8 +386,7 @@ void Player::Step( int col ) if( score==TNS_MARVELOUS && !PREFSMAN->m_bMarvelousTiming ) score = TNS_PERFECT; - if( score < TNS_GOOD ) - m_GrayArrowRow.Step( col ); + bGrayArrowStep = score < TNS_GOOD; LOG->Trace("Note offset: %f (fSecondsFromPerfect = %f), Score: %i", fNoteOffset, fSecondsFromPerfect, score); @@ -401,6 +402,9 @@ void Player::Step( int col ) if( IsRowCompletelyJudged(iIndexOverlappingNote) ) OnRowCompletelyJudged( iIndexOverlappingNote ); } + + if( bGrayArrowStep ) + m_GrayArrowRow.Step( col ); } void Player::HandleAutosync(float fNoteOffset) diff --git a/stepmania/src/RageBitmapTexture.cpp b/stepmania/src/RageBitmapTexture.cpp index e9a5440dad..8585afaa4f 100644 --- a/stepmania/src/RageBitmapTexture.cpp +++ b/stepmania/src/RageBitmapTexture.cpp @@ -154,7 +154,7 @@ SDL_Surface *RageBitmapTexture::CreateImg(int &pixfmt) /* XXX: Wait, we don't want to throw for all images; in particular, we * want to tolerate corrupt/unknown background images. */ if(img == NULL) - RageException::Throw( "Couldn't load %s: %s", GetFilePath().GetString(), SDL_GetError() ); + RageException::Throw( "RageBitmapTexture: Couldn't load %s: %s", GetFilePath().GetString(), SDL_GetError() ); if(m_ActualID.bHotPinkColorKey) { diff --git a/stepmania/src/RandomSample.cpp b/stepmania/src/RandomSample.cpp index 5e90e68e9d..54b6c43e26 100644 --- a/stepmania/src/RandomSample.cpp +++ b/stepmania/src/RandomSample.cpp @@ -23,13 +23,13 @@ RandomSample::RandomSample() m_iIndexLastPlayed = -1; } + RandomSample::~RandomSample() { for( unsigned i=0; iGetMetricF("ScreenDemonstration","SecondsToShow") diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 568fa83d39..7404fa58bf 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -90,7 +90,7 @@ const ScreenMessage SM_PlayGo = ScreenMessage(SM_User+1); // received while STATE_DANCING const ScreenMessage SM_NotesEnded = ScreenMessage(SM_User+10); -const ScreenMessage SM_BeginLoadingNextSong = ScreenMessage(SM_User+11); +const ScreenMessage SM_LoadNextSong = ScreenMessage(SM_User+11); // received while STATE_OUTRO const ScreenMessage SM_SaveChangedBeforeGoingBack = ScreenMessage(SM_User+20); @@ -185,6 +185,7 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS; + m_bZeroDeltaOnNextUpdate = false; @@ -245,8 +246,9 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay") this->AddChild(&m_TimingAssist); - m_OniFade.SetOpened(); - this->AddChild( &m_OniFade ); + this->AddChild( &m_NextSongIn ); + + this->AddChild( &m_NextSongOut ); const bool bExtra = GAMESTATE->IsExtraStage() || GAMESTATE->IsExtraStage2(); @@ -622,12 +624,6 @@ void ScreenGameplay::LoadNextSong() m_TimingAssist.Reset(); } - /* Set up song-specific graphics. */ - m_Background.LoadFromSong( GAMESTATE->m_pCurSong ); - m_Background.SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) ); - m_Background.BeginTweening( 2 ); - m_Background.SetDiffuse( RageColor(1,1,1,1) ); - m_textSongTitle.SetText( GAMESTATE->m_pCurSong->m_sMainTitle ); /* XXX: set it to the current BPM, not the range */ @@ -650,17 +646,35 @@ void ScreenGameplay::LoadNextSong() m_DifficultyIcon[p].SetXY( DIFFICULTY_X(p), DIFFICULTY_Y(p,bExtra,bReverse[p]) ); } + /* Load the Oni transitions */ + m_NextSongIn.Load( THEME->GetPathToB("ScreenGameplay next song in") ); + // Instead, load this right before it's used +// m_NextSongOut.Load( THEME->GetPathToB("ScreenGameplay next song out") ); + /* XXX: We want to put the lyrics out of the way, but it's likely that one * player is in reverse and the other isn't. What to do? */ m_LyricDisplay.SetXY( LYRICS_X, LYRICS_Y(bExtra,bReverse[GAMESTATE->m_MasterPlayerNumber]) ); - m_soundMusic.Load( GAMESTATE->m_pCurSong->GetMusicPath() ); - // Load lyrics // XXX: don't load this here LyricsLoader LL; if( GAMESTATE->m_pCurSong->HasLyrics() ) LL.LoadFromLRCFile(GAMESTATE->m_pCurSong->GetLyricsPath(), *GAMESTATE->m_pCurSong); + + + m_soundMusic.Load( GAMESTATE->m_pCurSong->GetMusicPath() ); + + /* Set up song-specific graphics. */ + m_Background.LoadFromSong( GAMESTATE->m_pCurSong ); + m_Background.SetDiffuse( RageColor(0.5f,0.5f,0.5f,1) ); + m_Background.BeginTweening( 2 ); + m_Background.SetDiffuse( RageColor(1,1,1,1) ); + + + /* m_soundMusic and m_Background take a very long time to load, + * so cap fDelta at 0 so m_NextSongIn will show up on screen. + * -Chris */ + m_bZeroDeltaOnNextUpdate = true; } float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic) @@ -813,7 +827,16 @@ void ScreenGameplay::Update( float fDeltaTime ) if(m_soundMusic.IsPlaying()) GAMESTATE->UpdateSongPosition(m_soundMusic.GetPositionSeconds()); - Screen::Update( fDeltaTime ); + if( m_bZeroDeltaOnNextUpdate ) + int sdkjfskdf = 0; + + if( m_bZeroDeltaOnNextUpdate ) + { + Screen::Update( 0 ); + m_bZeroDeltaOnNextUpdate = false; + } + else + Screen::Update( fDeltaTime ); if( GAMESTATE->m_pCurSong == NULL ) return; @@ -838,7 +861,7 @@ void ScreenGameplay::Update( float fDeltaTime ) // Check for end of song // float fSecondsToStop = GAMESTATE->m_pCurSong->GetElapsedTimeFromBeat( GAMESTATE->m_pCurSong->m_fLastBeat ) + 1; - if( GAMESTATE->m_fMusicSeconds > fSecondsToStop && !m_OniFade.IsClosing() ) + if( GAMESTATE->m_fMusicSeconds > fSecondsToStop && !m_NextSongOut.IsTransitioning() ) { GAMESTATE->m_fSongBeat = 0; this->PostScreenMessage( SM_NotesEnded, 0 ); @@ -1277,7 +1300,19 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) for( p=0; pIsPlayerEnabled(p) && !GAMESTATE->m_CurStageStats.bFailed[p] ) m_pLifeMeter[p]->OnSongEnded(); // give a little life back between stages - m_OniFade.CloseWipingRight( SM_BeginLoadingNextSong ); + + // HACK: Temporarily set the song pointer to the next song so that + // this m_NextSongOut will show the next song banner + Song* pCurSong = GAMESTATE->m_pCurSong; + + int iPlaySongIndex = GAMESTATE->GetCourseSongIndex()+1; + iPlaySongIndex %= m_apSongsQueue.size(); + GAMESTATE->m_pCurSong = m_apSongsQueue[iPlaySongIndex]; + + m_NextSongOut.Load( THEME->GetPathToB("ScreenGameplay next song out") ); + GAMESTATE->m_pCurSong = pCurSong; + + m_NextSongOut.StartTransitioning( SM_LoadNextSong ); } else // IsLastSong { @@ -1296,26 +1331,24 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) { m_Extra.StartTransitioning( SM_GoToStateAfterCleared ); SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay extra") ); -// this->PostScreenMessage( SM_ShowTryExtraStage, 1 ); } else { m_Cleared.StartTransitioning( SM_GoToStateAfterCleared ); SOUNDMAN->PlayOnceFromDir( ANNOUNCER->GetPathTo("gameplay cleared") ); -// this->PostScreenMessage( SM_ShowCleared, 1 ); } } } } break; - case SM_BeginLoadingNextSong: + case SM_LoadNextSong: LoadNextSong(); GAMESTATE->m_bPastHereWeGo = true; /* We're fading in, so don't hit any notes for a few seconds; they'll be * obscured by the fade. */ - StartPlayingSong( 3, 0 ); - m_OniFade.OpenWipingRight( SM_None ); + StartPlayingSong( m_NextSongIn.GetLengthSeconds()+2, 0 ); + m_NextSongIn.StartTransitioning( SM_None ); break; case SM_PlayToasty: @@ -1402,48 +1435,6 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM ) } break; - -/* // received while STATE_OUTRO - case SM_ShowCleared: - m_sprCleared.BeginTweening(1.0f); - m_sprCleared.SetDiffuse( RageColor(1,1,1,1) ); - m_sprCleared.BeginTweening(1.5f); // sleep - m_sprCleared.BeginTweening(0.7f); - m_sprCleared.SetDiffuse( RageColor(1,1,1,0) ); - SCREENMAN->PostMessageToTopScreen( SM_GoToStateAfterCleared, 4 ); - break; -*/ -/* case SM_ShowTryExtraStage: - { - m_soundTryExtraStage.PlayRandom(); - - // make the background invisible so we don't waste mem bandwidth drawing it - m_Background.BeginTweening( 1 ); - m_Background.SetDiffuse( RageColor(1,1,1,0) ); - - RageColor colorStage = GAMESTATE->GetStageColor(); - colorStage.a *= 0.7f; - - m_sprTryExtraStage.SetZoom( 4 ); - m_sprTryExtraStage.BeginBlurredTweening( 0.8f, TWEEN_DECELERATE ); - m_sprTryExtraStage.SetZoom( 0.4f ); // zoom out - m_sprTryExtraStage.SetDiffuse( colorStage ); // and fade in - m_sprTryExtraStage.BeginTweening( 0.2f ); - m_sprTryExtraStage.SetZoom( 0.8f ); // bounce - m_sprTryExtraStage.SetDiffuse( colorStage ); // and fade in - m_sprTryExtraStage.BeginTweening( 0.2f ); - m_sprTryExtraStage.SetZoom( 1.0f ); // come to rest - m_sprTryExtraStage.SetDiffuse( colorStage ); // and fade in - - colorStage.a = 0; - - m_sprTryExtraStage.BeginTweening( 2 ); // sleep - m_sprTryExtraStage.BeginTweening( 1 ); // fade out - m_sprTryExtraStage.SetDiffuse( colorStage ); - SCREENMAN->PostMessageToTopScreen( SM_GoToStateAfterCleared, 5 ); - } - break; -*/ case SM_SaveChangedBeforeGoingBack: if( m_bChangedOffsetOrBPM ) { diff --git a/stepmania/src/ScreenGameplay.h b/stepmania/src/ScreenGameplay.h index 2c133017e1..5523ff8ff6 100644 --- a/stepmania/src/ScreenGameplay.h +++ b/stepmania/src/ScreenGameplay.h @@ -14,7 +14,6 @@ #include "Screen.h" #include "Sprite.h" #include "TransitionBGAnimation.h" -#include "TransitionOniFade.h" #include "BitmapText.h" #include "Player.h" #include "RandomSample.h" @@ -98,7 +97,8 @@ protected: Background m_Background; - TransitionOniFade m_OniFade; // shows between songs in a course + TransitionBGAnimation m_NextSongIn; // shows between songs in a course + TransitionBGAnimation m_NextSongOut; // shows between songs in a course Sprite m_sprLifeFrame; LifeMeter* m_pLifeMeter[NUM_PLAYERS]; @@ -168,6 +168,7 @@ protected: RandomSample m_announcer1000Combo; RandomSample m_announcerComboStopped; + bool m_bZeroDeltaOnNextUpdate; bool m_bDemonstration; int m_iRowLastCrossed; diff --git a/stepmania/src/ScreenInstructions.cpp b/stepmania/src/ScreenInstructions.cpp index 7e489379e2..d97bddda45 100644 --- a/stepmania/src/ScreenInstructions.cpp +++ b/stepmania/src/ScreenInstructions.cpp @@ -22,12 +22,18 @@ #include "PrefsManager.h" -#define HELP_TEXT THEME->GetMetric("ScreenInstructions","HelpText") -#define TIMER_SECONDS THEME->GetMetricI("ScreenInstructions","TimerSeconds") -#define NEXT_SCREEN_ARCADE THEME->GetMetric("ScreenInstructions","NextScreenArcade") -#define NEXT_SCREEN_ONI THEME->GetMetric("ScreenInstructions","NextScreenOni") -#define NEXT_SCREEN_BATTLE THEME->GetMetric("ScreenInstructions","NextScreenBattle") -#define NEXT_SCREEN_RAVE THEME->GetMetric("ScreenInstructions","NextScreenRave") +#define HELP_TEXT THEME->GetMetric("ScreenInstructions","HelpText") +#define TIMER_SECONDS THEME->GetMetricI("ScreenInstructions","TimerSeconds") +CString Capitalize( CString s ) +{ + if( s.GetLength()==0 ) + return ""; + CString s1 = s.Left(1); + s1.MakeUpper(); + CString s2 = s.Right( s.GetLength()-1 ); + return s1+s2; +} +#define NEXT_SCREEN( pm ) THEME->GetMetric("ScreenInstructions","NextScreen"+Capitalize(PlayModeToString(pm)) ) ScreenInstructions::ScreenInstructions() : Screen("ScreenInstructions") @@ -118,25 +124,7 @@ void ScreenInstructions::HandleScreenMessage( const ScreenMessage SM ) SCREENMAN->SetNewScreen( "ScreenTitleMenu" ); break; case SM_GoToNextScreen: - switch( GAMESTATE->m_PlayMode ) - { - case PLAY_MODE_ARCADE: - SCREENMAN->SetNewScreen( NEXT_SCREEN_ARCADE ); - break; - case PLAY_MODE_NONSTOP: - case PLAY_MODE_ONI: - case PLAY_MODE_ENDLESS: - SCREENMAN->SetNewScreen( NEXT_SCREEN_ONI ); - break; - case PLAY_MODE_BATTLE: - SCREENMAN->SetNewScreen( NEXT_SCREEN_BATTLE ); - break; - case PLAY_MODE_RAVE: - SCREENMAN->SetNewScreen( NEXT_SCREEN_RAVE ); - break; - default: - ASSERT(0); - } + SCREENMAN->SetNewScreen( NEXT_SCREEN(GAMESTATE->m_PlayMode) ); break; } } diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 49334024ce..8013284d8c 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -17,6 +17,7 @@ #include "SongManager.h" #include "StepMania.h" #include "SDL_utils.h" +#include "ScreenManager.h" diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 3d37c3b64a..cbf66e4eee 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -223,7 +223,7 @@ ScreenNameEntry::ScreenNameEntry() : Screen("ScreenNameEntry") bAnyStillEntering |= m_bStillEnteringName[p]; if( !bAnyStillEntering ) { - this->PostScreenMessage( SM_GoToNextScreen, 0 ); + HandleScreenMessage( SM_GoToNextScreen ); return; } } diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index bc88b6eac7..67d21052e1 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -60,7 +60,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -95,7 +95,7 @@ IntDir=.\../Debug6 TargetDir=\stepmania\stepmania TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi # End Special Build Tool @@ -950,14 +950,6 @@ SOURCE=.\TransitionBGAnimation.cpp SOURCE=.\TransitionBGAnimation.h # End Source File -# Begin Source File - -SOURCE=.\TransitionOniFade.cpp -# End Source File -# Begin Source File - -SOURCE=.\TransitionOniFade.h -# End Source File # End Group # Begin Group "Actors" diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 8e6673f482..57a0f65ae8 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -1023,12 +1023,6 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ - - - - GetMetricF("TransitionOniFade","BannerWidth") -#define BANNER_HEIGHT THEME->GetMetricF("TransitionOniFade","BannerHeight") - - -TransitionOniFade::TransitionOniFade() -{ - SetDiffuse( RageColor(1,1,1,1) ); // white - - m_quadBackground.StretchTo( RectI(SCREEN_LEFT, SCREEN_TOP, SCREEN_RIGHT, SCREEN_BOTTOM) ); - - m_quadStrip.StretchTo( RectI(SCREEN_LEFT, int(CENTER_Y-30), SCREEN_RIGHT, int(CENTER_Y+30)) ); - - m_textSongInfo.LoadFromFont( THEME->GetPathToF("Common normal") ); - m_textSongInfo.EnableShadow( false ); - m_textSongInfo.SetZoom( 0.5f ); - m_textSongInfo.SetXY( CENTER_X, CENTER_Y ); - - m_Banner.SetCroppedSize( BANNER_WIDTH, BANNER_HEIGHT ); - m_Banner.SetXY( CENTER_X, CENTER_Y ); -} - -TransitionOniFade::~TransitionOniFade() -{ - -} - -void TransitionOniFade::DrawPrimitives() -{ - if( m_TransitionState == opened ) - return; - - if( m_TransitionState == closed ) - { - UpdateSongText(); - } - - m_quadBackground.SetDiffuse( RageColor(1,1,1,SCALE(GetPercentageClosed(),0,1,-1,1)) ); - m_quadBackground.Draw(); - - if( m_TransitionState == closed || m_TransitionState == opening_right ) - { - m_quadStrip.SetDiffuse( RageColor(0,0,0,SCALE(GetPercentageClosed(),0,1,0,2)) ); -// m_quadStrip.Draw(); - - m_textSongInfo.SetDiffuse( RageColor(1,1,1,SCALE(GetPercentageClosed(),0,1,0,2)) ); -// m_textSongInfo.Draw(); - - m_Banner.SetDiffuse( RageColor(1,1,1,SCALE(GetPercentageClosed(),0,1,0,2)) ); - m_Banner.Draw(); - } -} - - -void TransitionOniFade::OpenWipingRight( ScreenMessage send_when_done ) -{ - SetTransitionTime( 2.5f ); - Transition::OpenWipingRight( send_when_done ); - UpdateSongText(); -} - -void TransitionOniFade::OpenWipingLeft( ScreenMessage send_when_done ) -{ - SetTransitionTime( 2.5f ); - Transition::OpenWipingLeft( send_when_done ); - UpdateSongText(); -} - -void TransitionOniFade::CloseWipingRight(ScreenMessage send_when_done ) -{ - SetTransitionTime( 1 ); - Transition::CloseWipingRight( send_when_done ); - UpdateSongText(); -} - -void TransitionOniFade::CloseWipingLeft( ScreenMessage send_when_done ) -{ - SetTransitionTime( 1 ); - Transition::CloseWipingLeft( send_when_done ); - UpdateSongText(); -} - -void TransitionOniFade::UpdateSongText() -{ - Song* pSong = GAMESTATE->m_pCurSong; - ASSERT( pSong ); - m_textSongInfo.SetText( pSong->GetFullDisplayTitle() + "\n" + pSong->GetDisplayArtist(), - pSong->GetFullTranslitTitle() + "\n" + pSong->GetTranslitArtist() ); - m_Banner.LoadFromSong( pSong ); -} diff --git a/stepmania/src/TransitionOniFade.h b/stepmania/src/TransitionOniFade.h deleted file mode 100644 index 1c82b218a8..0000000000 --- a/stepmania/src/TransitionOniFade.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef TRANSITIONONIFADE_H -#define TRANSITIONONIFADE_H -/* ------------------------------------------------------------------------------ - 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 "Quad.h" -#include "Banner.h" -#include "BitmapText.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; - Banner m_Banner; -}; - - - -#endif