#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
//-----------------------------------------------------------------------------
-void RLEencode(unsigned char *p, unsigned int size, wxOutputStream& s)
+void RLEencode(unsigned char *WXUNUSED(p), unsigned int WXUNUSED(size), wxOutputStream& WXUNUSED(s))
{
}
// 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;
if (!CanRead(stream))
{
if (verbose)
- wxLogError(_T("wxPCXHandler: this is not a PCX file"));
+ wxLogError(wxT("wxPCXHandler: this is not a PCX file"));
return FALSE;
}
{
switch (error)
{
- case E_FORMATO: wxLogError(_T("wxPCXHandler: image format unsupported")); break;
- case E_MEMORIA: wxLogError(_T("wxPCXHandler: couldn't allocate memory")); break;
- case E_VERSION: wxLogError(_T("wxPCXHandler: version number too low")); break;
- default: wxLogError(_T("wxPCXHandler: unknown error !!!"));
+ case E_FORMATO: wxLogError(wxT("wxPCXHandler: image format unsupported")); break;
+ case E_MEMORIA: wxLogError(wxT("wxPCXHandler: couldn't allocate memory")); break;
+ case E_VERSION: wxLogError(wxT("wxPCXHandler: version number too low")); break;
+ default: wxLogError(wxT("wxPCXHandler: unknown error !!!"));
}
}
image->Destroy();
return TRUE;
}
-bool wxPCXHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbose )
+bool wxPCXHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose )
{
if (verbose)
- wxLogError(_T("wxPCXHandler::SaveFile still not implemented"));
+ wxLogError(wxT("wxPCXHandler::SaveFile still not implemented"));
return FALSE;
}
return (c == 10);
}
-
-#endif // wxUSE_STREAMS
-
+#endif // wxUSE_STREAMS && wxUSE_PCX