TextureTranslate method
Allow themes to duplicate the way noteskins are handled.
This commit is contained in:
@@ -127,6 +127,7 @@ void Actor::InitState()
|
|||||||
|
|
||||||
m_bTextureWrapping = false;
|
m_bTextureWrapping = false;
|
||||||
m_bTextureFiltering = true;
|
m_bTextureFiltering = true;
|
||||||
|
m_texTranslate = RageVector2( 0, 0 );
|
||||||
|
|
||||||
m_BlendMode = BLEND_NORMAL;
|
m_BlendMode = BLEND_NORMAL;
|
||||||
m_fZBias = 0;
|
m_fZBias = 0;
|
||||||
@@ -569,6 +570,12 @@ void Actor::BeginDraw() // set the world matrix
|
|||||||
DISPLAY->SkewY( m_pTempState->fSkewY );
|
DISPLAY->SkewY( m_pTempState->fSkewY );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( m_texTranslate.x != 0 || m_texTranslate.y != 0 )
|
||||||
|
{
|
||||||
|
DISPLAY->TexturePushMatrix();
|
||||||
|
DISPLAY->TextureTranslate( m_texTranslate.x, m_texTranslate.y );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::SetGlobalRenderStates()
|
void Actor::SetGlobalRenderStates()
|
||||||
@@ -600,6 +607,10 @@ void Actor::SetTextureRenderStates()
|
|||||||
void Actor::EndDraw()
|
void Actor::EndDraw()
|
||||||
{
|
{
|
||||||
DISPLAY->PopMatrix();
|
DISPLAY->PopMatrix();
|
||||||
|
|
||||||
|
if( m_texTranslate.x != 0 || m_texTranslate.y != 0 )
|
||||||
|
DISPLAY->TexturePopMatrix();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor::UpdateTweening( float fDeltaTime )
|
void Actor::UpdateTweening( float fDeltaTime )
|
||||||
@@ -1576,6 +1587,7 @@ public:
|
|||||||
static int pause( T* p, lua_State * ) { p->EnableAnimation(false); return 0; }
|
static int pause( T* p, lua_State * ) { p->EnableAnimation(false); return 0; }
|
||||||
static int setstate( T* p, lua_State *L ) { p->SetState(IArg(1)); return 0; }
|
static int setstate( T* p, lua_State *L ) { p->SetState(IArg(1)); return 0; }
|
||||||
static int GetNumStates( T* p, lua_State *L ) { LuaHelpers::Push( L, p->GetNumStates() ); return 1; }
|
static int GetNumStates( T* p, lua_State *L ) { LuaHelpers::Push( L, p->GetNumStates() ); return 1; }
|
||||||
|
static int texturetranslate( T* p, lua_State *L ) { p->SetTextureTranslate(FArg(1),FArg(2)); return 0; }
|
||||||
static int texturewrapping( T* p, lua_State *L ) { p->SetTextureWrapping(BIArg(1)); return 0; }
|
static int texturewrapping( T* p, lua_State *L ) { p->SetTextureWrapping(BIArg(1)); return 0; }
|
||||||
static int SetTextureFiltering( T* p, lua_State *L ) { p->SetTextureFiltering(BArg(1)); return 0; }
|
static int SetTextureFiltering( T* p, lua_State *L ) { p->SetTextureFiltering(BArg(1)); return 0; }
|
||||||
static int blend( T* p, lua_State *L ) { p->SetBlendMode( Enum::Check<BlendMode>(L, 1) ); return 0; }
|
static int blend( T* p, lua_State *L ) { p->SetBlendMode( Enum::Check<BlendMode>(L, 1) ); return 0; }
|
||||||
@@ -1795,6 +1807,7 @@ public:
|
|||||||
ADD_METHOD( pause );
|
ADD_METHOD( pause );
|
||||||
ADD_METHOD( setstate );
|
ADD_METHOD( setstate );
|
||||||
ADD_METHOD( GetNumStates );
|
ADD_METHOD( GetNumStates );
|
||||||
|
ADD_METHOD( texturetranslate );
|
||||||
ADD_METHOD( texturewrapping );
|
ADD_METHOD( texturewrapping );
|
||||||
ADD_METHOD( SetTextureFiltering );
|
ADD_METHOD( SetTextureFiltering );
|
||||||
ADD_METHOD( blend );
|
ADD_METHOD( blend );
|
||||||
|
|||||||
@@ -549,6 +549,7 @@ public:
|
|||||||
|
|
||||||
// render states
|
// render states
|
||||||
void SetBlendMode( BlendMode mode ) { m_BlendMode = mode; }
|
void SetBlendMode( BlendMode mode ) { m_BlendMode = mode; }
|
||||||
|
void SetTextureTranslate( float x, float y ) { m_texTranslate.x = x; m_texTranslate.y = y; }
|
||||||
void SetTextureWrapping( bool b ) { m_bTextureWrapping = b; }
|
void SetTextureWrapping( bool b ) { m_bTextureWrapping = b; }
|
||||||
void SetTextureFiltering( bool b ) { m_bTextureFiltering = b; }
|
void SetTextureFiltering( bool b ) { m_bTextureFiltering = b; }
|
||||||
void SetClearZBuffer( bool b ) { m_bClearZBuffer = b; }
|
void SetClearZBuffer( bool b ) { m_bClearZBuffer = b; }
|
||||||
@@ -685,6 +686,7 @@ protected:
|
|||||||
BlendMode m_BlendMode;
|
BlendMode m_BlendMode;
|
||||||
ZTestMode m_ZTestMode;
|
ZTestMode m_ZTestMode;
|
||||||
CullMode m_CullMode;
|
CullMode m_CullMode;
|
||||||
|
RageVector2 m_texTranslate;
|
||||||
bool m_bTextureWrapping;
|
bool m_bTextureWrapping;
|
||||||
bool m_bTextureFiltering;
|
bool m_bTextureFiltering;
|
||||||
bool m_bClearZBuffer;
|
bool m_bClearZBuffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user