const qbyte *palette, *fin, *enddata;
int x, y, x2, dataByte;
- if (loadsize < (int)sizeof(pcx) + 768)
+ if (fs_filesize < (int)sizeof(pcx) + 768)
{
Con_Printf ("Bad pcx file\n");
return NULL;
image_width = pcx.xmax+1;
image_height = pcx.ymax+1;
- palette = f + loadsize - 768;
+ palette = f + fs_filesize - 768;
image_rgba = Mem_Alloc(tempmempool, image_width*image_height*4);
if (!image_rgba)
TargaHeader targa_header;
unsigned char palette[256*4], *p;
- if (loadsize < 19)
+ if (fs_filesize < 19)
return NULL;
- enddata = f + loadsize;
+ enddata = f + fs_filesize;
targa_header.id_length = f[0];
targa_header.colormap_type = f[1];
qbyte *image_rgba;
int width, height;
- if (loadsize < 9)
+ if (fs_filesize < 9)
{
Con_Printf("LoadLMP: invalid LMP file\n");
return NULL;
if ((matchwidth && width != matchwidth) || (matchheight && height != matchheight))
return NULL;
- if (loadsize < 8 + width * height)
+ if (fs_filesize < 8 + width * height)
{
Con_Printf("LoadLMP: invalid LMP file\n");
return NULL;
qbyte *image_8bit;
int width, height;
- if (loadsize < 9)
+ if (fs_filesize < 9)
{
Con_Printf("LoadLMPAs8Bit: invalid LMP file\n");
return NULL;
if ((matchwidth && width != matchwidth) || (matchheight && height != matchheight))
return NULL;
- if (loadsize < 8 + width * height)
+ if (fs_filesize < 8 + width * height)
{
Con_Printf("LoadLMPAs8Bit: invalid LMP file\n");
return NULL;
if (*c == '*')
*c = '#';
sprintf (name, "override/%s.tga", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = LoadTGA (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "override/%s.jpg", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = JPEG_LoadImage (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "textures/%s.tga", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = LoadTGA (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "textures/%s.jpg", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = JPEG_LoadImage (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "textures/%s.pcx", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = LoadPCX (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "%s.tga", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = LoadTGA (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "%s.jpg", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = JPEG_LoadImage (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "%s.pcx", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = LoadPCX (f, matchwidth, matchheight);
goto loaded;
}
sprintf (name, "%s.lmp", basename);
- f = COM_LoadFile(name, true);
+ f = FS_LoadFile(name, true);
if (f)
{
data = LoadLMP (f, matchwidth, matchheight);
return NULL;
loaded:
Mem_Free(f);
- Con_DPrintf("loaded image %s (%dx%d)\n", name);
+ Con_DPrintf("loaded image %s (%dx%d)\n", name, image_width, image_height);
if (image_width == 0 || image_height == 0)
{
Con_Printf("error loading image %s - it is a %dx%d pixel image!\n", name);
*out++ = in[1];
*out++ = in[0];
}
- ret = COM_WriteFile (filename, buffer, width*height*3 + 18 );
+ ret = FS_WriteFile (filename, buffer, width*height*3 + 18 );
Mem_Free(buffer);
return ret;
*out++ = in[0];
}
}
- COM_WriteFile (filename, buffer, width*height*3 + 18 );
+ FS_WriteFile (filename, buffer, width*height*3 + 18 );
Mem_Free(buffer);
}
*out++ = in[3];
}
}
- COM_WriteFile (filename, buffer, width*height*4 + 18 );
+ FS_WriteFile (filename, buffer, width*height*4 + 18 );
Mem_Free(buffer);
}