pull songs out of the header that don't really need to be there

This commit is contained in:
Glenn Maynard
2003-03-23 18:52:18 +00:00
parent d9eb60c98a
commit 9822eff40b
2 changed files with 31 additions and 26 deletions
+22
View File
@@ -41,6 +41,21 @@ Sprite::~Sprite()
UnloadTexture(); UnloadTexture();
} }
bool Sprite::LoadBG( RageTextureID ID )
{
ID.iMipMaps = 1;
ID.bDither = true;
return Load(ID);
}
bool Sprite::Load( RageTextureID ID )
{
if( ID.filename == "" ) return true;
if( ID.filename.Right(7) == ".sprite" )
return LoadFromSpriteFile( ID );
else
return LoadFromTexture( ID );
};
// Sprite file has the format: // Sprite file has the format:
@@ -139,6 +154,13 @@ void Sprite::UnloadTexture()
m_pTexture = NULL; m_pTexture = NULL;
} }
void Sprite::EnableAnimation( bool bEnable )
{
Actor::EnableAnimation( bEnable );
if(m_pTexture)
bEnable ? m_pTexture->Play() : m_pTexture->Pause();
}
bool Sprite::LoadFromTexture( RageTextureID ID ) bool Sprite::LoadFromTexture( RageTextureID ID )
{ {
if( !m_pTexture || !(m_pTexture->GetID() == ID) ) if( !m_pTexture || !(m_pTexture->GetID() == ID) )
+9 -26
View File
@@ -28,35 +28,18 @@ public:
Sprite(); Sprite();
virtual ~Sprite(); virtual ~Sprite();
/* Just a convenience function; load an image that'll be used in the
* background. */
virtual bool LoadBG( RageTextureID ID )
{
ID.iMipMaps = 1;
ID.bDither = true;
return Load(ID);
}
virtual bool Load( RageTextureID ID )
{
if( ID.filename == "" ) return true;
if( ID.filename.Right(7) == ".sprite" )
return LoadFromSpriteFile( ID );
else
return LoadFromTexture( ID );
};
void UnloadTexture();
RageTexture* GetTexture() { return m_pTexture; };
virtual void DrawPrimitives(); virtual void DrawPrimitives();
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
virtual void EnableAnimation( bool bEnable ) /* Just a convenience function; load an image that'll be used in the
{ * background. */
Actor::EnableAnimation( bEnable ); virtual bool LoadBG( RageTextureID ID );
if(m_pTexture) virtual bool Load( RageTextureID ID );
bEnable ? m_pTexture->Play() : m_pTexture->Pause();
}; void UnloadTexture();
RageTexture* GetTexture() { return m_pTexture; };
virtual void EnableAnimation( bool bEnable );
virtual void SetState( int iNewState ); virtual void SetState( int iNewState );
int GetNumStates() { return m_iNumStates; }; int GetNumStates() { return m_iNumStates; };