Commit b4482700 authored by Erwan Tulou's avatar Erwan Tulou

skins2: reuse graphics from generic bitmap cache (animbitmap)

parent 4166f7e8
...@@ -29,18 +29,13 @@ ...@@ -29,18 +29,13 @@
AnimBitmap::AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap ): AnimBitmap::AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap ):
SkinObject( pIntf ), m_rBitmap( rBitmap ), m_pImage( NULL ), SkinObject( pIntf ),
m_curFrame( 0 ), m_curLoop( 0 ), m_pTimer( NULL ), m_cmdNextFrame( this ) m_rBitmap( rBitmap ), m_pImage( rBitmap.getGraphics() ),
m_nbFrames( rBitmap.getNbFrames() ), m_frameRate( rBitmap.getFrameRate() ),
m_nbLoops( rBitmap.getNbLoops() ), m_curFrame( 0 ), m_curLoop( 0 ),
m_pTimer( NULL ), m_cmdNextFrame( this )
{ {
// Build the graphics
OSFactory *pOsFactory = OSFactory::instance( pIntf ); OSFactory *pOsFactory = OSFactory::instance( pIntf );
m_pImage = pOsFactory->createOSGraphics( rBitmap.getWidth(),
rBitmap.getHeight() );
m_pImage->drawBitmap( rBitmap, 0, 0 );
m_nbFrames = rBitmap.getNbFrames();
m_frameRate = rBitmap.getFrameRate();
m_nbLoops = rBitmap.getNbLoops();
// Create the timer // Create the timer
m_pTimer = pOsFactory->createOSTimer( m_cmdNextFrame ); m_pTimer = pOsFactory->createOSTimer( m_cmdNextFrame );
...@@ -49,7 +44,6 @@ AnimBitmap::AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap ): ...@@ -49,7 +44,6 @@ AnimBitmap::AnimBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap ):
AnimBitmap::~AnimBitmap() AnimBitmap::~AnimBitmap()
{ {
delete m_pImage;
delete m_pTimer; delete m_pTimer;
} }
......
...@@ -62,7 +62,7 @@ private: ...@@ -62,7 +62,7 @@ private:
/// Bitmap stored /// Bitmap stored
const GenericBitmap &m_rBitmap; const GenericBitmap &m_rBitmap;
/// Graphics to store the bitmap /// Graphics to store the bitmap
OSGraphics *m_pImage; const OSGraphics * const m_pImage;
/// Number of frames /// Number of frames
int m_nbFrames; int m_nbFrames;
/// Frame rate /// Frame rate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment