Scale background playback speed by song rate. This sync isn't very accurate though (because of inaccurate playback rate code in sound library?)
This commit is contained in:
@@ -44,6 +44,10 @@ NEW FEATURE: Courses can be organized into group folders. See
|
|||||||
README-FIRST.html for details.
|
README-FIRST.html for details.
|
||||||
NEW FEATURE: Switch current theme from TitleMenu with L,L,L,R,R,R,L,R.
|
NEW FEATURE: Switch current theme from TitleMenu with L,L,L,R,R,R,L,R.
|
||||||
NEW FEATURE: Switch current announcer from TitleMenu with L,L,R,R,L,R,L,R.
|
NEW FEATURE: Switch current announcer from TitleMenu with L,L,R,R,L,R,L,R.
|
||||||
|
NEW FEATURE: New parameters for background changes: rate, fade old, loop,
|
||||||
|
rewind.
|
||||||
|
CHANGE: Background playback speed scaled by song rate, so movies stay in
|
||||||
|
sync (although syncing isn't very accurate at some song rates).
|
||||||
|
|
||||||
----------------------- Version 3.01 ---------------------------
|
----------------------- Version 3.01 ---------------------------
|
||||||
CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to
|
CHANGE: Simplified NoteSkin tap graphic format. Old NoteSkins will need to
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ void BGAnimationLayer::Unload()
|
|||||||
void BGAnimationLayer::Init()
|
void BGAnimationLayer::Init()
|
||||||
{
|
{
|
||||||
Unload();
|
Unload();
|
||||||
|
|
||||||
|
m_fUpdateRate = 1;
|
||||||
|
|
||||||
// m_bCycleColor = false;
|
// m_bCycleColor = false;
|
||||||
// m_bCycleAlpha = false;
|
// m_bCycleAlpha = false;
|
||||||
// m_Effect = EFFECT_STRETCH_STILL;
|
// m_Effect = EFFECT_STRETCH_STILL;
|
||||||
@@ -593,6 +596,8 @@ float BGAnimationLayer::GetMaxTweenTimeLeft() const
|
|||||||
|
|
||||||
void BGAnimationLayer::Update( float fDeltaTime )
|
void BGAnimationLayer::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
|
fDeltaTime *= m_fUpdateRate;
|
||||||
|
|
||||||
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
const float fSongBeat = GAMESTATE->m_fSongBeat;
|
||||||
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@@ -869,6 +874,7 @@ void BGAnimationLayer::SetDiffuse( RageColor c )
|
|||||||
|
|
||||||
void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop )
|
void BGAnimationLayer::GainingFocus( float fRate, bool bRewindMovie, bool bLoop )
|
||||||
{
|
{
|
||||||
|
m_fUpdateRate = m_fRate;
|
||||||
m_Sprites.back()->GetTexture()->SetPlaybackRate(fRate);
|
m_Sprites.back()->GetTexture()->SetPlaybackRate(fRate);
|
||||||
if( bRewindMovie )
|
if( bRewindMovie )
|
||||||
m_Sprites[0]->GetTexture()->SetPosition( 0 );
|
m_Sprites[0]->GetTexture()->SetPosition( 0 );
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ protected:
|
|||||||
|
|
||||||
// common stuff
|
// common stuff
|
||||||
CString m_sCommand;
|
CString m_sCommand;
|
||||||
|
float m_fUpdateRate; // get by GainingFocus
|
||||||
|
|
||||||
// stretch stuff
|
// stretch stuff
|
||||||
float m_fStretchTexCoordVelocityX;
|
float m_fStretchTexCoordVelocityX;
|
||||||
|
|||||||
@@ -323,6 +323,9 @@ void Background::LoadFromSong( Song* pSong )
|
|||||||
// sort segments
|
// sort segments
|
||||||
SortBackgroundChangesArray( m_aBGChanges );
|
SortBackgroundChangesArray( m_aBGChanges );
|
||||||
|
|
||||||
|
// scale all rates by the current music rate
|
||||||
|
for( unsigned i=0; i<m_aBGChanges.size(); i++ )
|
||||||
|
m_aBGChanges[i].m_fRate *= GAMESTATE->m_SongOptions.m_fMusicRate;
|
||||||
|
|
||||||
|
|
||||||
for( map<CString,BGAnimation*>::iterator iter = m_BGAnimations.begin();
|
for( map<CString,BGAnimation*>::iterator iter = m_BGAnimations.begin();
|
||||||
|
|||||||
Reference in New Issue
Block a user