From: ehofman Date: Fri, 14 Jan 2005 14:27:57 +0000 (+0000) Subject: little endian fixes. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1e24cc4643a80e819efb33b3f7ce1fd52ca0623d;p=simgear.git little endian fixes. --- diff --git a/simgear/screen/texture.cxx b/simgear/screen/texture.cxx index f306bc76..a04242b4 100644 --- a/simgear/screen/texture.cxx +++ b/simgear/screen/texture.cxx @@ -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));