if (inputflipdiagonal)
{
for (x = 0, line = inpixels + col_ofs; x < inputwidth; x++, line += col_inc)
- for (y = 0, in = line + row_ofs; y < inputheight; y++, in += row_inc, outpixels += numinputcomponents)
+ for (y = 0, in = line + row_ofs; y < inputheight; y++, in += row_inc, outpixels += numoutputcomponents)
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 += numinputcomponents)
+ for (x = 0, in = line + col_ofs; x < inputwidth; x++, in += col_inc, outpixels += numoutputcomponents)
for (c = 0; c < numoutputcomponents; c++)
outpixels[c] = ((index = outputinputcomponentindices[c]) & 0x80000000) ? index : in[index];
}
if (inputflipdiagonal)
{
for (x = 0, line = inpixels + col_ofs; x < inputwidth; x++, line += col_inc)
- for (y = 0, in = line + row_ofs; y < inputheight; y++, in += row_inc, outpixels += numinputcomponents)
+ for (y = 0, in = line + row_ofs; y < inputheight; y++, in += row_inc, outpixels += numoutputcomponents)
for (c = 0; c < numoutputcomponents; c++)
outpixels[c] = in[outputinputcomponentindices[c]];
}
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 += numinputcomponents)
+ for (x = 0, in = line + col_ofs; x < inputwidth; x++, in += col_inc, outpixels += numoutputcomponents)
for (c = 0; c < numoutputcomponents; c++)
outpixels[c] = in[outputinputcomponentindices[c]];
}
{"override/%s.png", PNG_LoadImage_BGRA},
{"override/%s.jpg", JPEG_LoadImage_BGRA},
{"override/%s.pcx", LoadPCX_BGRA},
+ {"%s.tga", LoadTGA_BGRA},
+ {"%s.png", PNG_LoadImage_BGRA},
+ {"%s.jpg", JPEG_LoadImage_BGRA},
+ {"%s.pcx", LoadPCX_BGRA},
{NULL, NULL}
};
// now try all the formats in the selected list
for (format = firstformat;format->formatstring;format++)
{
- sprintf (name, format->formatstring, basename);
+ dpsnprintf (name, sizeof(name), format->formatstring, basename);
f = FS_LoadFile(name, tempmempool, true, &filesize);
if (f)
{
return data;
}
else
- {
- if (developer.integer >= 1)
- Con_DPrintf("Error loading image %s (file loaded but decode failed)\n", name);
- }
+ Con_DPrintf("Error loading image %s (file loaded but decode failed)\n", name);
}
}
if (complain)
Con_Printf("Couldn't load %s using ", filename);
for (format = firstformat;format->formatstring;format++)
{
- sprintf (name, format->formatstring, basename);
+ dpsnprintf (name, sizeof(name), format->formatstring, basename);
Con_Printf(format == firstformat ? "\"%s\"" : (format[1].formatstring ? ", \"%s\"" : " or \"%s\".\n"), format->formatstring);
}
}
+
+ // texture loading can take a while, so make sure we're sending keepalives
+ CL_KeepaliveMessage(false);
+
if (developer_memorydebug.integer)
Mem_CheckSentinelsGlobal();
return NULL;
int const FIXTRANS_HAS_U = 8;
int const FIXTRANS_HAS_D = 16;
int const FIXTRANS_FIXED = 32;
- unsigned char *fixMask = Mem_Alloc(tempmempool, w * h);
+ unsigned char *fixMask = (unsigned char *) Mem_Alloc(tempmempool, w * h);
int fixPixels = 0;
int changedPixels = 0;
int x, y;