From 9822eff40b7976a5204043132f18fadd83f73934 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 23 Mar 2003 18:52:18 +0000 Subject: [PATCH] pull songs out of the header that don't really need to be there --- stepmania/src/Sprite.cpp | 22 ++++++++++++++++++++++ stepmania/src/Sprite.h | 35 +++++++++-------------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/stepmania/src/Sprite.cpp b/stepmania/src/Sprite.cpp index f7ce0c81fa..c844857c2f 100644 --- a/stepmania/src/Sprite.cpp +++ b/stepmania/src/Sprite.cpp @@ -41,6 +41,21 @@ Sprite::~Sprite() 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: @@ -139,6 +154,13 @@ void Sprite::UnloadTexture() 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 ) { if( !m_pTexture || !(m_pTexture->GetID() == ID) ) diff --git a/stepmania/src/Sprite.h b/stepmania/src/Sprite.h index 83530a3669..f9d6cc4bc3 100644 --- a/stepmania/src/Sprite.h +++ b/stepmania/src/Sprite.h @@ -28,35 +28,18 @@ public: 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 Update( float fDeltaTime ); - virtual void EnableAnimation( bool bEnable ) - { - Actor::EnableAnimation( bEnable ); - if(m_pTexture) - bEnable ? m_pTexture->Play() : m_pTexture->Pause(); - }; + /* Just a convenience function; load an image that'll be used in the + * background. */ + virtual bool LoadBG( RageTextureID ID ); + virtual bool Load( RageTextureID ID ); + + void UnloadTexture(); + RageTexture* GetTexture() { return m_pTexture; }; + + virtual void EnableAnimation( bool bEnable ); virtual void SetState( int iNewState ); int GetNumStates() { return m_iNumStates; };