qbyte *image_rgba;
const q2wal_t *inwal = (const void *)f;
- if (fs_filesize < sizeof(q2wal_t))
+ if (fs_filesize < (int) sizeof(q2wal_t))
{
Con_Printf("LoadWAL: invalid WAL file\n");
return NULL;
if ((matchwidth && image_width != matchwidth) || (matchheight && image_height != matchheight))
return NULL;
- if (fs_filesize < sizeof(q2wal_t) + LittleLong(inwal->offsets[0]) + image_width * image_height)
+ if ((int) fs_filesize < (int) sizeof(q2wal_t) + (int) LittleLong(inwal->offsets[0]) + image_width * image_height)
{
Con_Printf("LoadWAL: invalid WAL file\n");
return NULL;
if ((end - in) >= 4)
{
temp = end - 4;
- if (strcmp(temp, ".tga") == 0 || strcmp(temp, ".pcx") == 0 || strcmp(temp, ".lmp") == 0)
+ if (strcmp(temp, ".tga") == 0
+ || strcmp(temp, ".pcx") == 0
+ || strcmp(temp, ".lmp") == 0
+ || strcmp(temp, ".png") == 0
+ || strcmp(temp, ".jpg") == 0)
end = temp;
while (in < end)
*out++ = *in++;
int i;
qbyte *f, *data = NULL;
char basename[MAX_QPATH], name[MAX_QPATH], *c;
+ if (developer_memorydebug.integer)
+ Mem_CheckSentinelsGlobal();
Image_StripImageExtension(filename, basename); // strip filename extensions to allow replacement by other types
// replace *'s with #, so commandline utils don't get confused when dealing with the external files
for (c = basename;*c;c++)
{
Mem_Free(f);
Con_DPrintf("loaded image %s (%dx%d)\n", name, image_width, image_height);
+ if (developer_memorydebug.integer)
+ Mem_CheckSentinelsGlobal();
return data;
}
}
Con_Printf (i == 0 ? "\"%s\"" : (imageformats[i+1].formatstring ? ", \"%s\"" : " or \"%s\".\n"), imageformats[i].formatstring);
}
}
+ if (developer_memorydebug.integer)
+ Mem_CheckSentinelsGlobal();
return NULL;
}
}
}
-int image_loadskin(imageskin_t *s, char *name)
+int image_loadskin(imageskin_t *s, char *shadername)
{
int j;
qbyte *bumppixels;
int bumppixels_width, bumppixels_height;
+ char name[MAX_QPATH];
+ Image_StripImageExtension(shadername, name);
memset(s, 0, sizeof(*s));
s->basepixels = loadimagepixels(name, false, 0, 0);
if (s->basepixels == NULL)