void Intro::update( int rMSec )
{

	m_Accu += rMSec;
	m_Timer += rMSec;
	updateFrameBasedOnTime();


	for ( int i=0; i<m_RenderList.size; i++ )
	{

		float ratio = m_Accu / m_RenderList[i]->m_Image[m_RenderList[i]->m_TrackImage].m_Transition[m_TrackTrans].m_SpeedMillis;
		
		if ( ratio >= 1.0f )
		{
			m_Accu = 0.0f;
			ratio = 1.0f;
			//return;
		}

		int offset_x = m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_OffsetX;
		int offset_y = m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_OffsetY;
		int destination_x = m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_DestinationX;
		int destination_y = m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_DestinationY;

		float new_x = offset_x + ( ( destination_x - offset_x ) * ratio );
		float new_y = offset_y + ( ( destination_y - offset_y ) * ratio );
		
		DEBUG_WRITE ( "x  =  %d", new_x );
		DEBUG_WRITE ( "y  =  %d", new_y );

		setPosition( m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Sprite, new_x, new_y );

		
		//------------------------------
		// Alpha Blending
		//------------------------------
		if ( m_ToggleAlphaBlending )
		{
			m_AccuAlpha += rMSec;
			
			int alpha_time = m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_AlphaSpeed;
			if ( alpha_time == 0 )
			{
				m_ToggleAlphaBlending = false;
			}
			else
			{
				float alpha_ratio = m_AccuAlpha / (float)alpha_time;

				if ( alpha_ratio >= 1.0f )
				{
					m_AccuAlpha = 0.0f;
					alpha_ratio = 1.0f;
				}

				float offset_alpha = m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_AlphaOffset / 255.0f;
				float destination_alpha = m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_AlphaDestination / 255.0f;
				float new_alpha = offset_alpha + ( (destination_alpha - offset_alpha) * alpha_ratio );
				
				m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Sprite->GetDrawSpec().mAlpha = new_alpha;

				if (new_alpha == destination_alpha)
				{
					m_ToggleAlphaBlending = false;
					if ( strcmp( m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_Type, "FADE" ) == 0 )
					{
						moveToNext();
						return;
					}
				}
			}
		}

		//--------------------------------
		// Destination Reached
		//--------------------------------
		if ( destination_x == new_x && destination_y == new_y )
		{
			// reached the destination
			if ( strcmp( m_Frame[m_TrackFrame].m_Image[m_TrackImage].m_Transition[m_TrackTrans].m_Type, "FADE" ) == 0 )
				return;

			moveToNext();
			
		}

	}

	
	

}

