]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagpcx.cpp
Modifed ShowModal() function so that you can have dialogs with yes, no and cancel...
[wxWidgets.git] / src / common / imagpcx.cpp
index 7c8c0c0c05efeb1e42357ba60ab8c86bef8b76e0..f8c036362462c51b42a90070b898492422a9b202 100644 (file)
@@ -142,14 +142,17 @@ int ReadPCX(wxImage *image, wxInputStream& stream)
     // palette at the end of the file. Read it now before
     // proceeding.
     //
-    pos = stream.TellI();
-    stream.SeekI(-769, wxFromEnd);
+    if (format == IMAGE_8BIT)
+    {
+        pos = stream.TellI();
+        stream.SeekI(-769, wxFromEnd);
 
-    if (stream.GetC() != 12)
-        return E_FORMATO;
+        if (stream.GetC() != 12)
+            return E_FORMATO;
 
-    stream.Read(pal, 768);
-    stream.SeekI(pos, wxFromStart);
+        stream.Read(pal, 768);
+        stream.SeekI(pos, wxFromStart);
+    }
 
     // Allocate memory for a scanline and resize the image.
     //