From 3a33a226083949177d3363dc449255d7b57196f3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 16 Mar 2007 05:11:59 +0000 Subject: [PATCH] pan when 2 players --- stepmania/src/ScreenSelectMusic.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index c1a797a2e2..2d724a6b1b 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -171,9 +171,12 @@ void ScreenSelectMusic::Init() this->AddChild( &m_textHighScore[p] ); } + RageSoundLoadParams SoundParams; + SoundParams.m_bSupportPan = true; + m_soundStart.Load( THEME->GetPathS(m_sName,"start") ); - m_soundDifficultyEasier.Load( THEME->GetPathS(m_sName,"difficulty easier") ); - m_soundDifficultyHarder.Load( THEME->GetPathS(m_sName,"difficulty harder") ); + m_soundDifficultyEasier.Load( THEME->GetPathS(m_sName,"difficulty easier"), false, &SoundParams ); + m_soundDifficultyHarder.Load( THEME->GetPathS(m_sName,"difficulty harder"), false, &SoundParams ); m_soundOptionsChange.Load( THEME->GetPathS(m_sName,"options") ); m_soundLocked.Load( THEME->GetPathS(m_sName,"locked") ); @@ -320,6 +323,7 @@ void ScreenSelectMusic::Input( const InputEventPlus &input ) // TODO: Invalidate the CurSteps only if they are no longer playable. That way, // after music change will clamp to the nearest in the DifficultyList. + GAMESTATE->m_pCurSteps[GAMESTATE->m_MasterPlayerNumber].SetWithoutBroadcast( NULL ); FOREACH_ENUM( PlayerNumber, p ) GAMESTATE->m_pCurSteps[p].SetWithoutBroadcast( NULL ); @@ -646,10 +650,17 @@ void ScreenSelectMusic::ChangeDifficulty( PlayerNumber pn, int dir ) } AfterStepsOrTrailChange( vpns ); + float fBalance = GameSoundManager::GetPlayerBalance( pn ); if( dir < 0 ) - m_soundDifficultyEasier.Play(); + { + m_soundDifficultyEasier.SetProperty( "Pan", fBalance ); + m_soundDifficultyEasier.PlayCopy(); + } else - m_soundDifficultyHarder.Play(); + { + m_soundDifficultyHarder.SetProperty( "Pan", fBalance ); + m_soundDifficultyHarder.PlayCopy(); + } }