Changed BackgroundEffects files to apply the playback rate to videos. Added GetUpdateRate to ActorFrame and Get/SetDecodeMovie to Sprite. Hope nobody is caught off guard by checkerboard no longer playing videos back at 4x rate.
This commit is contained in:
@@ -609,6 +609,7 @@ public:
|
||||
virtual float GetAnimationLengthSeconds() const { return 0; }
|
||||
virtual void SetSecondsIntoAnimation( float ) {}
|
||||
virtual void SetUpdateRate( float ) {}
|
||||
virtual float GetUpdateRate() { return 1.0f; }
|
||||
|
||||
HiddenPtr<LuaClass> m_pLuaInstance;
|
||||
|
||||
|
||||
@@ -625,6 +625,7 @@ public:
|
||||
static int propagate( T* p, lua_State *L ) { p->SetPropagateCommands( BIArg(1) ); COMMON_RETURN_SELF; }
|
||||
static int fov( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
|
||||
static int SetUpdateRate( T* p, lua_State *L ) { p->SetUpdateRate( FArg(1) ); COMMON_RETURN_SELF; }
|
||||
DEFINE_METHOD(GetUpdateRate, GetUpdateRate());
|
||||
static int SetFOV( T* p, lua_State *L ) { p->SetFOV( FArg(1) ); COMMON_RETURN_SELF; }
|
||||
static int vanishpoint( T* p, lua_State *L ) { p->SetVanishPoint( FArg(1), FArg(2) ); COMMON_RETURN_SELF; }
|
||||
static int GetChild( T* p, lua_State *L )
|
||||
@@ -738,6 +739,7 @@ public:
|
||||
ADD_METHOD( propagate ); // deprecated
|
||||
ADD_METHOD( fov );
|
||||
ADD_METHOD( SetUpdateRate );
|
||||
ADD_METHOD( GetUpdateRate );
|
||||
ADD_METHOD( SetFOV );
|
||||
ADD_METHOD( vanishpoint );
|
||||
ADD_METHOD( GetChild );
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
virtual void HurryTweening( float factor );
|
||||
|
||||
void SetUpdateRate( float fUpdateRate ) { m_fUpdateRate = fUpdateRate; }
|
||||
float GetUpdateRate() { return m_fUpdateRate; }
|
||||
void SetFOV( float fFOV ) { m_fFOV = fFOV; }
|
||||
void SetVanishPoint( float fX, float fY) { m_fVanishX = fX; m_fVanishY = fY; }
|
||||
|
||||
|
||||
@@ -1114,6 +1114,7 @@ public:
|
||||
p->UpdateAnimationState(true);
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
DEFINE_METHOD(GetDecodeMovie, _decode_movie);
|
||||
static int SetDecodeMovie(T* p, lua_State *L)
|
||||
{
|
||||
p->_decode_movie= BArg(1);
|
||||
@@ -1182,6 +1183,7 @@ public:
|
||||
ADD_METHOD(GetQuadState);
|
||||
ADD_METHOD(SetQuadState);
|
||||
ADD_METHOD(ForceStateUpdate);
|
||||
ADD_METHOD(GetDecodeMovie);
|
||||
ADD_METHOD(SetDecodeMovie);
|
||||
|
||||
// Copy from RageTexture
|
||||
|
||||
+10
-4
@@ -765,10 +765,16 @@ void BackgroundImpl::Layer::UpdateCurBGChange( const Song *pSong, float fLastMus
|
||||
if( !change.m_sTransition.empty() )
|
||||
{
|
||||
map<RString,BackgroundTransition>::const_iterator lIter = mapNameToTransition.find( change.m_sTransition );
|
||||
ASSERT( lIter != mapNameToTransition.end() );
|
||||
const BackgroundTransition &bt = lIter->second;
|
||||
m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves );
|
||||
m_pFadingBGA->RunCommands( *bt.cmdRoot );
|
||||
if(lIter == mapNameToTransition.end())
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt("'%s' is not the name of a BackgroundTransition file.", change.m_sTransition.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
const BackgroundTransition &bt = lIter->second;
|
||||
m_pFadingBGA->RunCommandsOnLeaves( *bt.cmdLeaves );
|
||||
m_pFadingBGA->RunCommands( *bt.cmdRoot );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-1
@@ -26,6 +26,7 @@ Sprite::Sprite()
|
||||
m_bUsingCustomTexCoords = false;
|
||||
m_bUsingCustomPosCoords = false;
|
||||
m_bSkipNextUpdate = true;
|
||||
m_DecodeMovie= true;
|
||||
m_EffectMode = EffectMode_Normal;
|
||||
|
||||
m_fRememberedClipWidth = -1;
|
||||
@@ -62,6 +63,7 @@ Sprite::Sprite( const Sprite &cpy ):
|
||||
CPY( m_bUsingCustomTexCoords );
|
||||
CPY( m_bUsingCustomPosCoords );
|
||||
CPY( m_bSkipNextUpdate );
|
||||
CPY( m_DecodeMovie );
|
||||
CPY( m_EffectMode );
|
||||
memcpy( m_CustomTexCoords, cpy.m_CustomTexCoords, sizeof(m_CustomTexCoords) );
|
||||
memcpy( m_CustomPosCoords, cpy.m_CustomPosCoords, sizeof(m_CustomPosCoords) );
|
||||
@@ -408,7 +410,7 @@ void Sprite::Update( float fDelta )
|
||||
UpdateAnimationState();
|
||||
|
||||
// If the texture is a movie, decode frames.
|
||||
if( !bSkipThisMovieUpdate )
|
||||
if(!bSkipThisMovieUpdate && m_DecodeMovie)
|
||||
m_pTexture->DecodeSeconds( max(0, fTimePassed) );
|
||||
|
||||
// update scrolling
|
||||
@@ -1210,6 +1212,12 @@ public:
|
||||
p->SetAllStateDelays(FArg(-1));
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
DEFINE_METHOD(GetDecodeMovie, m_DecodeMovie);
|
||||
static int SetDecodeMovie(T* p, lua_State *L)
|
||||
{
|
||||
p->m_DecodeMovie= BArg(1);
|
||||
COMMON_RETURN_SELF;
|
||||
}
|
||||
|
||||
LunaSprite()
|
||||
{
|
||||
@@ -1235,6 +1243,8 @@ public:
|
||||
ADD_METHOD( SetEffectMode );
|
||||
ADD_METHOD( GetNumStates );
|
||||
ADD_METHOD( SetAllStateDelays );
|
||||
ADD_METHOD(GetDecodeMovie);
|
||||
ADD_METHOD(SetDecodeMovie);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -90,6 +90,8 @@ public:
|
||||
|
||||
void SetAllStateDelays(float fDelay);
|
||||
|
||||
bool m_DecodeMovie;
|
||||
|
||||
protected:
|
||||
void LoadFromTexture( RageTextureID ID );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user