]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagiff.cpp
Fix horizontal mouse wheel scrolling in wxGTK.
[wxWidgets.git] / src / common / imagiff.cpp
index 428219853cf1198331ebca4791dade014a025795..196fe89938d7f9e6c4f62fe2865f65c5f6dc0952 100644 (file)
@@ -1,8 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/common/imagiff.h
+// Name:        src/common/imagiff.cpp
 // Purpose:     wxImage handler for Amiga IFF images
 // Author:      Steffen Gutmann, Thomas Meyer
-// RCS-ID:      $Id$
 // Copyright:   (c) Steffen Gutmann, 2002
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -81,7 +80,6 @@ private:
     IFFImage *m_image;        // image data
     wxInputStream *m_f;       // input stream
     unsigned char *databuf;
-    unsigned char *picptr;
     unsigned char *decomp_mem;
 
     void Destroy();
@@ -121,12 +119,9 @@ wxIFFDecoder::wxIFFDecoder(wxInputStream *s)
 
 void wxIFFDecoder::Destroy()
 {
-    delete m_image;
-    m_image = 0;
-    delete [] databuf;
-    databuf = 0;
-    delete [] decomp_mem;
-    decomp_mem = 0;
+    wxDELETE(m_image);
+    wxDELETEA(databuf);
+    wxDELETEA(decomp_mem);
 }
 
 //---------------------------------------------------------------------------
@@ -143,7 +138,7 @@ bool wxIFFDecoder::ConvertToImage(wxImage *image) const
     // create the image
     image->Create(GetWidth(), GetHeight());
 
-    if (!image->Ok())
+    if (!image->IsOk())
         return false;
 
     unsigned char *pal = GetPalette();
@@ -420,8 +415,7 @@ int wxIFFDecoder::ReadIFF()
         const byte *cmapptr = dataptr + 8;
         colors = chunkLen / 3;                  // calc no of colors
 
-        delete m_image->pal;
-        m_image->pal = 0;
+        wxDELETE(m_image->pal);
         m_image->colors = colors;
         if (colors > 0) {
         m_image->pal = new byte[3*colors];
@@ -479,8 +473,7 @@ int wxIFFDecoder::ReadIFF()
         decomprle(bodyptr, decomp_mem, chunkLen, decomp_bufsize);
         bodyptr = decomp_mem;                 // -> uncompressed BODY
         chunkLen = decomp_bufsize;
-        delete [] databuf;
-        databuf = 0;
+        wxDELETEA(databuf);
         }
 
         // the following determines the type of the ILBM file.
@@ -551,7 +544,7 @@ int wxIFFDecoder::ReadIFF()
         }
 
         m_image->p = new byte[bmhd_width * bmhd_height * 3];
-            byte *picptr = m_image->p;
+        byte *picptr = m_image->p;
         if (!picptr) {
         Destroy();
         return wxIFF_MEMERR;