X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce7efe2d0f056042d86cc581a7ee3af694b1fd6b..369be443aa958ebce00f4d112f96ed7fa14c39b6:/src/common/anidecod.cpp diff --git a/src/common/anidecod.cpp b/src/common/anidecod.cpp index 76d2f9c0ba..7d502ae52a 100644 --- a/src/common/anidecod.cpp +++ b/src/common/anidecod.cpp @@ -14,7 +14,9 @@ #pragma hdrstop #endif -#if wxUSE_STREAMS && wxUSE_GIF +#if wxUSE_STREAMS && wxUSE_ICO_CUR + +#include "wx/anidecod.h" #ifndef WX_PRECOMP #include "wx/palette.h" @@ -22,13 +24,10 @@ #include #include -#include "wx/anidecod.h" // static wxCURHandler wxANIDecoder::sm_handler; - - //--------------------------------------------------------------------------- // wxANIFrameInfo //--------------------------------------------------------------------------- @@ -43,13 +42,11 @@ public: int m_imageIndex; }; -#include // this is a magic incantation which must be done! -WX_DEFINE_OBJARRAY(wxImageArray); - -#include // this is a magic incantation which must be done! -WX_DEFINE_OBJARRAY(wxANIFrameInfoArray); - +#include "wx/arrimpl.cpp" // this is a magic incantation which must be done! +WX_DEFINE_OBJARRAY(wxImageArray) +#include "wx/arrimpl.cpp" // this is a magic incantation which must be done! +WX_DEFINE_OBJARRAY(wxANIFrameInfoArray) //--------------------------------------------------------------------------- @@ -99,6 +96,18 @@ long wxANIDecoder::GetDelay(size_t frame) const return m_info[frame].m_delay; } +wxColour wxANIDecoder::GetTransparentColour(size_t frame) const +{ + size_t idx = m_info[frame].m_imageIndex; + + if (!m_images[idx].HasMask()) + return wxNullColour; + + return wxColour(m_images[idx].GetMaskRed(), + m_images[idx].GetMaskGreen(), + m_images[idx].GetMaskBlue()); +} + //--------------------------------------------------------------------------- // ANI reading and decoding @@ -330,7 +339,7 @@ bool wxANIDecoder::Load( wxInputStream& stream ) m_szAnimation.GetHeight() == 0) m_szAnimation = wxSize(m_images[0].GetWidth(), m_images[0].GetHeight()); - return m_szAnimation!=wxDefaultSize; + return m_szAnimation != wxDefaultSize; } -#endif // wxUSE_STREAMS && wxUSE_GIF +#endif // wxUSE_STREAMS && wxUSE_ICO_CUR