#pragma hdrstop
#endif
+#ifndef WX_PRECOMP
+# include "wx/defs.h"
+#endif
+
+#if wxUSE_STREAMS && wxUSE_PCX
+
#include "wx/image.h"
#include "wx/wfstream.h"
#include "wx/module.h"
#include "wx/log.h"
+
//-----------------------------------------------------------------------------
// PCX decoding
//-----------------------------------------------------------------------------
// 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.
//
IMPLEMENT_DYNAMIC_CLASS(wxPCXHandler,wxImageHandler)
#endif
-#if wxUSE_STREAMS
-
bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose )
{
int error;
return (c == 10);
}
-
-#endif // wxUSE_STREAMS
-
+#endif // wxUSE_STREAMS && wxUSE_PCX