#include "wx/wfstream.h"
#include "wx/image.h"
#include "wx/gifdecod.h"
-#include "wx/animate/animate.h"
#include "wx/log.h"
+#include "wx/dcmemory.h"
+#include "wx/animate/animate.h"
#include "wx/dc.h"
#include "wx/dcclient.h"
-#include "wx/dcmemory.h"
/*
* wxAnimationPlayer
}
// Play
-bool wxAnimationPlayer::Play(wxWindow& window, const wxPoint& pos, bool looped)
+bool wxAnimationPlayer::Play(wxWindow& window, const wxPoint& pos, bool WXUNUSED(looped))
{
m_window = & window;
int i;
for (i = 0; i < n; i++)
{
- wxBitmap* bitmap = NULL;
wxImage* image = GetFrame(i);
if (image)
{
if (GetTransparentColour(transparentColour))
image->SetMaskColour(transparentColour.Red(), transparentColour.Green(), transparentColour.Blue());
- bitmap = new wxBitmap(* image);
+ wxBitmap* bitmap = new wxBitmap(* image);
delete image;
if (bitmap)
m_frames.Append(bitmap);
}
// Play the frame
-bool wxAnimationPlayer::PlayFrame(int frame, wxWindow& window, const wxPoint& pos)
+bool wxAnimationPlayer::PlayFrame(int frame, wxWindow& window, const wxPoint& WXUNUSED(pos))
{
wxMemoryDC dc;
dc.SelectObject(m_backingStore);
// Draw all intermediate frames that haven't been removed from the
// animation
int i;
- for (i = 0; i < (frame - 1); i++)
+ for (i = 0; i < frame; i++)
{
if ((GetDisposalMethod(i) == wxANIM_DONOTREMOVE) || (GetDisposalMethod(i) == wxANIM_UNSPECIFIED))
{
// Clear the wxImage cache
void wxAnimationPlayer::ClearCache()
{
- wxNode* node = m_frames.GetFirst();
+ wxList::compatibility_iterator node = m_frames.GetFirst();
while (node)
{
- wxNode* next = node->GetNext();
+ wxList::compatibility_iterator next = node->GetNext();
wxBitmap* bitmap = (wxBitmap*) node->GetData();
delete bitmap;
- delete node;
+ m_frames.Erase(node);
node = next;
}
}
{
wxASSERT_MSG( (m_animation != NULL), _T("Animation not present in wxAnimationPlayer"));
wxASSERT_MSG( (m_frames.GetCount() != 0), _T("Animation cache not present in wxAnimationPlayer"));
- wxASSERT_MSG( (m_frames.Item(frame) != (wxNode*) NULL), _T("Image not present in wxAnimationPlayer::DrawFrame"));
+ wxASSERT_MSG( !!m_frames.Item(frame), _T("Image not present in wxAnimationPlayer::DrawFrame"));
wxBitmap* bitmap = (wxBitmap*) m_frames.Item(frame)->GetData() ;
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
wxImage* image = new wxImage;
m_decoder->ConvertToImage(image);
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
int disposalMethod = m_decoder->GetDisposalMethod();
return (wxAnimationDisposal) disposalMethod;
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
wxRect rect(m_decoder->GetLeft(), m_decoder->GetTop(), m_decoder->GetWidth(), m_decoder->GetHeight());
return rect;
{
wxASSERT_MSG( (m_decoder != (wxGIFDecoder*) NULL), _T("m_decoder must be non-NULL"));
- m_decoder->GoFrame(i);
+ m_decoder->GoFrame(i + 1);
return m_decoder->GetDelay();
}
SetClientSize(sz);
}
-void wxAnimationCtrlBase::OnPaint(wxPaintEvent& event)
+void wxAnimationCtrlBase::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);