If down or over images are missing, they default to the up image. Yet, in case
of animated images, the animation gets played leading to undesirable artefacts.
This patch adds a comparison operator for animated images and do not restart the
animation if they are alike.
if( pImg == m_pImg )
return;
+ if( pImg && m_pImg && *pImg == *m_pImg )
+ return;
+
AnimBitmap *pOldImg = m_pImg;
m_pImg = pImg;
if( pImg == m_pImgCurrent )
return;
+ if( pImg && m_pImgCurrent && *pImg == *m_pImgCurrent )
+ return;
+
AnimBitmap *pOldImg = m_pImgCurrent;
m_pImgCurrent = pImg;
m_pParent->notify();
}
+bool AnimBitmap::operator ==( const AnimBitmap& rOther ) const
+{
+ return &m_rBitmap == &rOther.m_rBitmap
+ && m_nbFrames == rOther.m_nbFrames
+ && m_frameRate == rOther.m_frameRate
+ && m_nbLoops == rOther.m_nbLoops;
+}
virtual int getWidth() const;
virtual int getHeight() const;
+ /// compare two animated image
+ bool operator==( const AnimBitmap& other ) const;
+
private:
/// Bitmap stored
const GenericBitmap &m_rBitmap;