Forgot the endianess.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1661 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2008-10-30 00:34:31 +00:00
parent ae15b94a7f
commit 6f09c6d2bf
1 changed files with 21 additions and 0 deletions

View File

@ -54,10 +54,19 @@ bool CImageWriterPCX::writeImage(io::IWriteFile *file, IImage *image,u32 param)
file->write(&d2, 2);
file->write(&d2, 2);
d2 = image->getDimension().Width-1; // width
#ifdef __BIG_ENDIAN__
d2 = os::Byteswap::byteswap(d2);
#endif
file->write(&d2, 2);
d2 = image->getDimension().Height-1; // height
#ifdef __BIG_ENDIAN__
d2 = os::Byteswap::byteswap(d2);
#endif
file->write(&d2, 2);
d2 = 300; // dpi
#ifdef __BIG_ENDIAN__
d2 = os::Byteswap::byteswap(d2);
#endif
file->write(&d2, 2);
file->write(&d2, 2);
d2 = 0; // palette (not used)
@ -72,12 +81,24 @@ bool CImageWriterPCX::writeImage(io::IWriteFile *file, IImage *image,u32 param)
d2 = image->getDimension().Width; // pitch
if (d2&0x0001) // must be even
++d2;
#ifdef __BIG_ENDIAN__
d2 = os::Byteswap::byteswap(d2);
#endif
file->write(&d2, 2);
d2 = 1; // color mode
#ifdef __BIG_ENDIAN__
d2 = os::Byteswap::byteswap(d2);
#endif
file->write(&d2, 2);
d2 = 800; // screen width
#ifdef __BIG_ENDIAN__
d2 = os::Byteswap::byteswap(d2);
#endif
file->write(&d2, 2);
d2 = 600; // screen height
#ifdef __BIG_ENDIAN__
d2 = os::Byteswap::byteswap(d2);
#endif
file->write(&d2, 2);
d2 = 0; // filler (not used)
for (i=0; i<27; ++i)