little endian fixes.

This commit is contained in:
ehofman 2005-01-14 14:27:57 +00:00
parent dfc23c3528
commit 1e24cc4643

View File

@ -630,14 +630,13 @@ SGTexture::ImageWriteOpen(const char *fileName)
image->ysize = texture_height;
image->zsize = num_colors;
fwrite(image, 1, 12, file);
fseek(file, 512, SEEK_SET);
if (swapFlag) {
ConvertShort(&image->imagic, 6);
}
fwrite(image, 1, 12, file);
fseek(file, 512, SEEK_SET);
image->tmp = new GLubyte[ image->xsize * 256 ];
if (image->tmp == 0) {
errstr = OUT_OF_MEMORY;
@ -654,8 +653,8 @@ SGTexture::ImageWriteOpen(const char *fileName)
}
image->rleEnd = 512 + (2 * x);
fseek(file, 512, SEEK_SET);
fwrite(image->rowStart, 1, x, file);
fwrite(image->rowSize, 1, x, file);
fread(image->rowStart, 1, x, file);
fread(image->rowSize, 1, x, file);
if (swapFlag) {
ConvertUint(image->rowStart, x/(int) sizeof(unsigned));
ConvertUint((unsigned *)image->rowSize, x/(int) sizeof(int));