- int n = GetFrameCount();
- int i;
- for (i = 0; i < n; i++)
- {
- wxImage* image = GetFrame(i);
- if (image)
- {
- // If the frame has transparency,
- // set the colour so converting to a bitmap
- // will create a mask
- wxColour transparentColour;
- if (GetTransparentColour(transparentColour))
- image->SetMaskColour(transparentColour.Red(), transparentColour.Green(), transparentColour.Blue());
-
- wxBitmap* bitmap = new wxBitmap(* image);
- delete image;
- if (bitmap)
- m_frames.Append(bitmap);
- else
- return FALSE;
- }
- else
- return FALSE;
- }
- return TRUE;
+ wxImage* image = GetFrame(i);
+ if (image == NULL)
+ return false;
+
+ // If the frame has transparency,
+ // set the colour so converting to a bitmap
+ // will create a mask
+ wxColour transparentColour;
+ if (GetTransparentColour(transparentColour))
+ image->SetMaskColour(transparentColour.Red(), transparentColour.Green(), transparentColour.Blue());
+
+ wxBitmap* bitmap = new wxBitmap(*image);
+ delete image;
+ if (bitmap == NULL)
+ return false;
+
+ m_frames.Append(bitmap);