diff --git a/stepmania/src/Actor.cpp b/stepmania/src/Actor.cpp index 8c8d48650a..e088d5606d 100644 --- a/stepmania/src/Actor.cpp +++ b/stepmania/src/Actor.cpp @@ -206,7 +206,7 @@ void Actor::Update( float fDeltaTime ) void Actor::BeginTweening( float time, TweenType tt ) { - StopTweening(); + StopTweening(); // cancel current tweens BeginTweeningQueued( time, tt ); } @@ -214,16 +214,25 @@ void Actor::BeginTweeningQueued( float time, TweenType tt ) { ASSERT( time > 0 ); + // add a new TweenState to the tail, and initialize it m_QueuedTweens.Add( TweenState() ); - TweenState &TS = m_QueuedTweens[m_QueuedTweens.GetSize()-1]; - // set our tween starting and ending values to the current position - TS.m_end_pos = m_pos; - TS.m_end_scale = m_scale; - TS.m_end_rotation = m_rotation; - for(int i=0; i<4; i++) TS.m_end_colorDiffuse[i] = m_colorDiffuse[i]; - TS.m_end_colorAdd = m_colorAdd; + if( m_QueuedTweens.GetSize() >= 2 ) // if there was already a TS on the stack + { + // initialize the new TS from the last TS in the list + TS = m_QueuedTweens[m_QueuedTweens.GetSize()-2]; + } + else + { + // This new TS is the only TS. + // Set our tween starting and ending values to the current position. + TS.m_end_pos = m_pos; + TS.m_end_scale = m_scale; + TS.m_end_rotation = m_rotation; + for(int i=0; i<4; i++) TS.m_end_colorDiffuse[i] = m_colorDiffuse[i]; + TS.m_end_colorAdd = m_colorAdd; + } TS.m_TweenType = tt; TS.m_fTweenTime = time; diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 38f634e7c9..d8d888b22d 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -54,10 +54,6 @@ Player::Player() this->AddActor( &m_Combo ); this->AddActor( &m_LifeMeter ); this->AddActor( &m_Score ); - - - // assist - m_soundAssistTick.Load( THEME->GetPathTo(SOUND_ASSIST) ); } @@ -249,11 +245,6 @@ void Player::RenderPrimitives() m_Score.Draw(); -} - -void Player::CrossedIndex( int iIndex ) -{ - } bool Player::IsThereANoteAtIndex( int iIndex ) @@ -268,13 +259,10 @@ void Player::HandlePlayerStep( float fSongBeat, TapStep player_step, float fMaxB { //RageLog( "Player::HandlePlayerStep()" ); - // update gray arrows int iColumnNum = m_Style.TapStepToColumnNumber( player_step ); - // For single player and two player, iColumnNum will be 4/5 or 8/9/10/11 for - // up-left and up-right hits. Seemed this was the simplest way to ignore them in game. - if (iColumnNum >= m_Style.m_iNumColumns) - return; - + if( iColumnNum == -1 ) // if this TapStep is not used in the current Style + return; // ignore the step + m_GrayArrows.Step( iColumnNum ); CheckForCompleteStep( fSongBeat, player_step, fMaxBeatDiff ); diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 6372a82dfb..fbcb1ddc6c 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -82,8 +82,6 @@ protected: LifeMeterPills m_LifeMeter; ScoreDisplayRollingWithFrame m_Score; - SoundSet m_soundAssistTick; - }; diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index d23d0e6f40..e649b785c6 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -22,6 +22,7 @@ LPRageSound SOUND = NULL; RageSound::RageSound( HWND hWnd ) { + RageLog( "RageSound::RageSound()" ); // save the HWND if( !hWnd ) RageError( "RageSound called with NULL hWnd." ); @@ -30,7 +31,7 @@ RageSound::RageSound( HWND hWnd ) if( BASS_GetVersion() != MAKELONG(1,3) ) RageError( "BASS version 1.3 DLL could not be loaded. Verify that Bass.dll exists in the program directory."); - if( !BASS_Init( -1, 44100, BASS_DEVICE_LEAVEVOL, m_hWndApp ) ) + if( !BASS_Init( -1, 44100, BASS_DEVICE_LEAVEVOL|BASS_DEVICE_LATENCY, m_hWndApp ) ) { RageError( "There was an error while initializing your sound card.\n\n" @@ -42,6 +43,29 @@ RageSound::RageSound( HWND hWnd ) } BASS_Start(); + + ZeroMemory( &m_info, sizeof(m_info) ); + m_info.size = sizeof(m_info); + BASS_GetInfo( &m_info ); + + + RageLog( + "Sound card info:\n" + " - play latency is %u ms\n" + " - total device hardware memory is %u bytes\n" + " - free device hardware memory is %u bytes\n" + " - number of free sample slots in the hardware is %u\n" + " - number of free 3D sample slots in the hardware is %u\n" + " - min sample rate supported by the hardware is %u\n" + " - max sample rate supported by the hardware is %u", + m_info.latency, + m_info.hwsize, + m_info.hwfree, + m_info.freesam, + m_info.free3d, + m_info.minrate, + m_info.maxrate + ); } RageSound::~RageSound() diff --git a/stepmania/src/RageSound.h b/stepmania/src/RageSound.h index d9930ac897..7956835444 100644 --- a/stepmania/src/RageSound.h +++ b/stepmania/src/RageSound.h @@ -25,10 +25,11 @@ public: RageSound( HWND hWnd ); ~RageSound(); + float GetPlayLatency() { return m_info.latency / 1000.0f; }; private: HWND m_hWndApp; // this is set on GRAPHICS_Create() - + BASS_INFO m_info; }; diff --git a/stepmania/src/Style.h b/stepmania/src/Style.h index b5203dda1d..3665539478 100644 --- a/stepmania/src/Style.h +++ b/stepmania/src/Style.h @@ -26,16 +26,13 @@ struct Style int TapStepToColumnNumber( TapStep tap_step ) { - //for (int i=0; i