little endian fixes.
This commit is contained in:
@@ -630,14 +630,13 @@ SGTexture::ImageWriteOpen(const char *fileName)
|
|||||||
image->ysize = texture_height;
|
image->ysize = texture_height;
|
||||||
image->zsize = num_colors;
|
image->zsize = num_colors;
|
||||||
|
|
||||||
fwrite(image, 1, 12, file);
|
|
||||||
|
|
||||||
fseek(file, 512, SEEK_SET);
|
|
||||||
|
|
||||||
if (swapFlag) {
|
if (swapFlag) {
|
||||||
ConvertShort(&image->imagic, 6);
|
ConvertShort(&image->imagic, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fwrite(image, 1, 12, file);
|
||||||
|
fseek(file, 512, SEEK_SET);
|
||||||
|
|
||||||
image->tmp = new GLubyte[ image->xsize * 256 ];
|
image->tmp = new GLubyte[ image->xsize * 256 ];
|
||||||
if (image->tmp == 0) {
|
if (image->tmp == 0) {
|
||||||
errstr = OUT_OF_MEMORY;
|
errstr = OUT_OF_MEMORY;
|
||||||
@@ -654,8 +653,8 @@ SGTexture::ImageWriteOpen(const char *fileName)
|
|||||||
}
|
}
|
||||||
image->rleEnd = 512 + (2 * x);
|
image->rleEnd = 512 + (2 * x);
|
||||||
fseek(file, 512, SEEK_SET);
|
fseek(file, 512, SEEK_SET);
|
||||||
fwrite(image->rowStart, 1, x, file);
|
fread(image->rowStart, 1, x, file);
|
||||||
fwrite(image->rowSize, 1, x, file);
|
fread(image->rowSize, 1, x, file);
|
||||||
if (swapFlag) {
|
if (swapFlag) {
|
||||||
ConvertUint(image->rowStart, x/(int) sizeof(unsigned));
|
ConvertUint(image->rowStart, x/(int) sizeof(unsigned));
|
||||||
ConvertUint((unsigned *)image->rowSize, x/(int) sizeof(int));
|
ConvertUint((unsigned *)image->rowSize, x/(int) sizeof(int));
|
||||||
|
|||||||
Reference in New Issue
Block a user