Add minor check (bg index != local mask) to avoid checking the whole image

This commit is contained in:
David Capello 2015-09-24 23:50:44 -03:00
parent 43881af1f2
commit dd87c2ef17

View File

@ -474,7 +474,8 @@ private:
// Check if we need an extra color equal to the bg color in a
// transparent frameImage.
bool needsExtraBgColor = false;
if (!m_opaque && m_sprite->pixelFormat() == IMAGE_INDEXED) {
if (m_sprite->pixelFormat() == IMAGE_INDEXED &&
!m_opaque && m_bgIndex != m_localTransparentIndex) {
for (const auto& i : LockImageBits<IndexedTraits>(frameImage)) {
if (i == m_bgIndex &&
i != m_localTransparentIndex) {