]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagpcx.cpp
compilation fix for DJGPP
[wxWidgets.git] / src / common / imagpcx.cpp
index 846130b6877f5c0f064a74e6a7b45f914e1e1105..17a9b54bd54037a0a8d35c0e81522a9ef4e6b352 100644 (file)
@@ -277,9 +277,10 @@ int ReadPCX(wxImage *image, wxInputStream& stream)
             *(p++) = pal[3 * index + 2];
         }
 
-        unsigned char* r = new unsigned char[256];
-        unsigned char* g = new unsigned char[256];
-        unsigned char* b = new unsigned char[256];
+#if wxUSE_PALETTE
+        unsigned char r[256];
+        unsigned char g[256];
+        unsigned char b[256];
         for (i = 0; i < 256; i++)
         {
             r[i] = pal[3*i + 0];
@@ -287,7 +288,7 @@ int ReadPCX(wxImage *image, wxInputStream& stream)
             b[i] = pal[3*i + 2];
         }
         image->SetPalette(wxPalette(256, r, g, b));
-        delete[] r; delete[] g; delete[] b;
+#endif // wxUSE_PALETTE
     }
 
     return wxPCX_OK;