else
{
for (y = 0, line = inpixels + row_ofs; y < inputheight; y++, line += row_inc)
- for (x = 0, in = line + col_ofs; x < inputwidth; x++, in += col_inc, outpixels += 3)
+ for (x = 0, in = line + col_ofs; x < inputwidth; x++, in += col_inc, outpixels += numinputcomponents)
for (c = 0; c < numoutputcomponents; c++)
outpixels[c] = ((index = outputinputcomponentindices[c]) & 0x80000000) ? index : in[index];
}
else
{
for (y = 0, line = inpixels + row_ofs; y < inputheight; y++, line += row_inc)
- for (x = 0, in = line + col_ofs; x < inputwidth; x++, in += col_inc, outpixels += 3)
+ for (x = 0, in = line + col_ofs; x < inputwidth; x++, in += col_inc, outpixels += numinputcomponents)
for (c = 0; c < numoutputcomponents; c++)
outpixels[c] = in[outputinputcomponentindices[c]];
}
return rt;
}
-qboolean Image_WriteTGARGB_preflipped (const char *filename, int width, int height, const qbyte *data)
+qboolean Image_WriteTGARGB_preflipped (const char *filename, int width, int height, const qbyte *data, qbyte *buffer)
{
qboolean ret;
- qbyte *buffer, *out;
+ qbyte *out;
const qbyte *in, *end;
- buffer = Mem_Alloc(tempmempool, width*height*3 + 18);
-
memset (buffer, 0, 18);
buffer[2] = 2; // uncompressed type
buffer[12] = (width >> 0) & 0xFF;
}
ret = FS_WriteFile (filename, buffer, width*height*3 + 18 );
- Mem_Free(buffer);
return ret;
}