From 1168414cf0aa1e1f57e6a1de0f7b4c2babb6a3c8 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 10 Oct 2005 04:36:04 +0000 Subject: [PATCH] m_bPastHereWeGo -> !m_bGameplayLeadIn, default false. This is more natural; !m_bPastHereWeGo was the usual case. --- stepmania/src/Background.cpp | 2 +- stepmania/src/DancingCharacters.cpp | 8 ++++---- stepmania/src/GameState.cpp | 6 ++++-- stepmania/src/GameState.h | 2 +- stepmania/src/MessageManager.cpp | 1 + stepmania/src/MessageManager.h | 2 +- stepmania/src/ScreenDemonstration.cpp | 2 +- stepmania/src/ScreenEdit.cpp | 6 +++--- stepmania/src/ScreenGameplayLesson.cpp | 2 +- stepmania/src/ScreenHowToPlay.cpp | 2 +- stepmania/src/ScreenJukebox.cpp | 2 +- stepmania/src/ScreenNameEntry.cpp | 2 +- 12 files changed, 20 insertions(+), 17 deletions(-) diff --git a/stepmania/src/Background.cpp b/stepmania/src/Background.cpp index ad63c1917f..6fbeedb2cd 100644 --- a/stepmania/src/Background.cpp +++ b/stepmania/src/Background.cpp @@ -969,7 +969,7 @@ void BrightnessOverlay::Update( float fDeltaTime ) ActorFrame::Update( fDeltaTime ); /* If we're actually playing, then we're past fades, etc; update the background * brightness to follow Cover. */ - if( GAMESTATE->m_bPastHereWeGo ) + if( !GAMESTATE->m_bGameplayLeadIn ) SetActualBrightness(); } diff --git a/stepmania/src/DancingCharacters.cpp b/stepmania/src/DancingCharacters.cpp index 38be2df941..7b491b00e7 100644 --- a/stepmania/src/DancingCharacters.cpp +++ b/stepmania/src/DancingCharacters.cpp @@ -188,15 +188,15 @@ void DancingCharacters::Update( float fDelta ) } } - static bool bWasHereWeGo = false; - bool bIsHereWeGo = GAMESTATE->m_bPastHereWeGo; - if( !bWasHereWeGo && bIsHereWeGo ) + static bool bWasGameplayStarting = false; + bool bGameplayStarting = GAMESTATE->m_bGameplayLeadIn; + if( !bWasGameplayStarting && bGameplayStarting ) { FOREACH_PlayerNumber( p ) if( GAMESTATE->IsPlayerEnabled(p) ) m_pCharacter[p]->PlayAnimation( "warmup" ); } - bWasHereWeGo = bIsHereWeGo; + bWasGameplayStarting = bGameplayStarting; static float fLastBeat = GAMESTATE->m_fSongBeat; diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index aa4575ca09..19e9ddfaa3 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -73,7 +73,7 @@ GameState::GameState() : m_pCurSteps( Message_CurrentStepsP1Changed ), m_pCurCourse( Message_CurrentCourseChanged ), m_pCurTrail( Message_CurrentTrailP1Changed ), - m_bPastHereWeGo( Message_HereWeGoChanged ), + m_bGameplayLeadIn( Message_GameplayLeadInChanged ), m_stEdit( Message_EditStepsTypeChanged ), m_pEditSourceSteps( Message_EditSourceStepsChanged ), m_stEditSource( Message_EditSourceStepsTypeChanged ), @@ -583,7 +583,7 @@ void GameState::ResetMusicStatistics() m_fSongBeat = 0; m_fCurBPS = 10; m_bFreeze = false; - m_bPastHereWeGo.Set( false ); + m_bGameplayLeadIn.Set( false ); Actor::SetBGMTime( 0, 0 ); } @@ -2007,6 +2007,7 @@ public: static int IsEventMode( T* p, lua_State *L ) { lua_pushboolean(L, p->IsEventMode() ); return 1; } static int GetNumPlayersEnabled( T* p, lua_State *L ) { lua_pushnumber(L, p->GetNumPlayersEnabled() ); return 1; } static int GetSongBeat( T* p, lua_State *L ) { lua_pushnumber(L, p->m_fSongBeat ); return 1; } + static int GetGameplayStarting( T* p, lua_State *L ) { lua_pushnumber(L, p->m_bGameplayLeadIn ); return 1; } static int PlayerUsingBothSides( T* p, lua_State *L ) { lua_pushboolean(L, p->PlayerUsingBothSides() ); return 1; } static int GetCoins( T* p, lua_State *L ) { lua_pushnumber(L, p->m_iCoins ); return 1; } static int IsSideJoined( T* p, lua_State *L ) { lua_pushboolean(L, p->m_bSideIsJoined[(PlayerNumber)IArg(1)] ); return 1; } @@ -2087,6 +2088,7 @@ public: ADD_METHOD( IsEventMode ); ADD_METHOD( GetNumPlayersEnabled ); ADD_METHOD( GetSongBeat ); + ADD_METHOD( GetGameplayStarting ); ADD_METHOD( PlayerUsingBothSides ); ADD_METHOD( GetCoins ); ADD_METHOD( IsSideJoined ); diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 2319893091..52578bac6a 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -160,7 +160,7 @@ public: float m_fLightSongBeat; // g_fLightsFalloffSeconds ahead bool m_bFreeze; // in the middle of a freeze RageTimer m_LastBeatUpdate; // time of last m_fSongBeat, etc. update - BroadcastOnChange m_bPastHereWeGo; + BroadcastOnChange m_bGameplayLeadIn; int m_BeatToNoteSkinRev; /* hack: incremented whenever m_BeatToNoteSkin changes */ void ResetNoteSkins(); diff --git a/stepmania/src/MessageManager.cpp b/stepmania/src/MessageManager.cpp index 59fc388a73..d29f0a4e34 100644 --- a/stepmania/src/MessageManager.cpp +++ b/stepmania/src/MessageManager.cpp @@ -20,6 +20,7 @@ static const CString MessageNames[] = { "CurrentCourseChanged", "CurrentTrailP1Changed", "CurrentTrailP2Changed", + "GameplayLeadInChanged", "EditStepsTypeChanged", "EditSourceStepsChanged", "EditSourceStepsTypeChanged", diff --git a/stepmania/src/MessageManager.h b/stepmania/src/MessageManager.h index cb61264766..1dfac1d412 100644 --- a/stepmania/src/MessageManager.h +++ b/stepmania/src/MessageManager.h @@ -35,7 +35,7 @@ enum Message Message_CurrentCourseChanged, Message_CurrentTrailP1Changed, Message_CurrentTrailP2Changed, - Message_HereWeGoChanged, + Message_GameplayLeadInChanged, Message_EditStepsTypeChanged, Message_EditSourceStepsChanged, Message_EditSourceStepsTypeChanged, diff --git a/stepmania/src/ScreenDemonstration.cpp b/stepmania/src/ScreenDemonstration.cpp index 0082d17b52..1633bae422 100644 --- a/stepmania/src/ScreenDemonstration.cpp +++ b/stepmania/src/ScreenDemonstration.cpp @@ -66,7 +66,7 @@ void ScreenDemonstration::Init() ClearMessageQueue(); // remove all of the messages set in ScreenGameplay that drive "ready", "go", etc. - GAMESTATE->m_bPastHereWeGo.Set( true ); + GAMESTATE->m_bGameplayLeadIn.Set( false ); m_DancingState = STATE_DANCING; this->PostScreenMessage( SM_BeginFadingOut, SECONDS_TO_SHOW ); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 5f3d392b60..708fa2bafa 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -602,7 +602,7 @@ void ScreenEdit::Init() m_fBeatToReturnTo = 0; - GAMESTATE->m_bPastHereWeGo.Set( false ); + GAMESTATE->m_bGameplayLeadIn.Set( true ); GAMESTATE->m_EditMode = EDIT_MODE.GetValue(); GAMESTATE->m_fSongBeat = 0; m_fTrailingBeat = GAMESTATE->m_fSongBeat; @@ -1927,7 +1927,7 @@ void ScreenEdit::TransitionEditState( EditState em ) SOUND->StopMusic(); m_soundMusic.StopPlaying(); m_soundAssistTick.StopPlaying(); - GAMESTATE->m_bPastHereWeGo.Set( false ); + GAMESTATE->m_bGameplayLeadIn.Set( true ); switch( old ) { @@ -1988,7 +1988,7 @@ void ScreenEdit::TransitionEditState( EditState em ) float fSeconds = m_pSong->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(m_iStartPlayingAt) ) - 1; GAMESTATE->UpdateSongPosition( fSeconds, m_pSong->m_Timing ); - GAMESTATE->m_bPastHereWeGo.Set( true ); + GAMESTATE->m_bGameplayLeadIn.Set( false ); /* Reset the note skin, in case preferences have changed. */ GAMESTATE->ResetNoteSkins(); diff --git a/stepmania/src/ScreenGameplayLesson.cpp b/stepmania/src/ScreenGameplayLesson.cpp index d34101ea81..e8a8ac885a 100644 --- a/stepmania/src/ScreenGameplayLesson.cpp +++ b/stepmania/src/ScreenGameplayLesson.cpp @@ -24,7 +24,7 @@ void ScreenGameplayLesson::Init() ClearMessageQueue(); // remove all of the messages set in ScreenGameplay that animate "ready", "here we go", etc. - GAMESTATE->m_bPastHereWeGo.Set( true ); + GAMESTATE->m_bGameplayLeadIn.Set( false ); m_DancingState = STATE_DANCING; diff --git a/stepmania/src/ScreenHowToPlay.cpp b/stepmania/src/ScreenHowToPlay.cpp index 25004453e5..955dda90da 100644 --- a/stepmania/src/ScreenHowToPlay.cpp +++ b/stepmania/src/ScreenHowToPlay.cpp @@ -149,7 +149,7 @@ void ScreenHowToPlay::Init() pStyle->GetTransformedNoteDataForStyle( PLAYER_1, tempNoteData, m_NoteData ); GAMESTATE->m_pCurSong.Set( &m_Song ); - GAMESTATE->m_bPastHereWeGo.Set( true ); + GAMESTATE->m_bGameplayLeadIn.Set( false ); GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerController = PC_AUTOPLAY; m_pPlayer = new Player; diff --git a/stepmania/src/ScreenJukebox.cpp b/stepmania/src/ScreenJukebox.cpp index 7363e82ecf..207fccdaa0 100644 --- a/stepmania/src/ScreenJukebox.cpp +++ b/stepmania/src/ScreenJukebox.cpp @@ -237,7 +237,7 @@ void ScreenJukebox::Init() ClearMessageQueue(); // remove all of the messages set in ScreenGameplay that animate "ready", "here we go", etc. - GAMESTATE->m_bPastHereWeGo.Set( true ); + GAMESTATE->m_bGameplayLeadIn.Set( false ); m_DancingState = STATE_DANCING; } diff --git a/stepmania/src/ScreenNameEntry.cpp b/stepmania/src/ScreenNameEntry.cpp index 561b055fd4..8ea9da3613 100644 --- a/stepmania/src/ScreenNameEntry.cpp +++ b/stepmania/src/ScreenNameEntry.cpp @@ -154,7 +154,7 @@ ScreenNameEntry::ScreenNameEntry( CString sClassName ) : Screen( sClassName ) } - GAMESTATE->m_bPastHereWeGo.Set( true ); // enable the gray arrows + GAMESTATE->m_bGameplayLeadIn.Set( false ); // enable the gray arrows FOREACH_PlayerNumber( p ) {