Nuke QFS_WriteBuffers.

This function is too dangerous for my liking, and it's now unnecessary
since qfs has been locked down.
This commit is contained in:
Bill Currie 2010-08-24 16:50:33 +09:00
parent 031055a91f
commit cf40f5073d
3 changed files with 9 additions and 32 deletions

View file

@ -83,7 +83,6 @@ void QFS_Gamedir (const char *dir);
QFile *QFS_Open (const char *path, const char *mode);
QFile *QFS_WOpen (const char *path, int zip);
void QFS_WriteFile (const char *filename, const void *data, int len);
void QFS_WriteBuffers (const char *filename, int count, ...);
int _QFS_FOpenFile (const char *filename, QFile **gzfile,
struct dstring_s *foundname, int zip);

View file

@ -665,6 +665,7 @@ LoadTGA (QFile *fin)
VISIBLE void
WriteTGAfile (const char *tganame, byte *data, int width, int height)
{
QFile *qfile;
TargaHeader header;
memset (&header, 0, sizeof (header));
@ -673,6 +674,12 @@ WriteTGAfile (const char *tganame, byte *data, int width, int height)
header.height = LittleShort (height);
header.pixel_size = 24;
QFS_WriteBuffers (tganame, 2, &header, sizeof (header), data,
width * height * 3);
qfile = QFS_WOpen (tganame, 0);
if (!qfile) {
Sys_Printf ("Error opening %s", tganame);
return;
}
Qwrite (qfile, &header, sizeof (header));
Qwrite (qfile, data, width * height * 3);
Qclose (qfile);
}

View file

@ -669,35 +669,6 @@ QFS_WriteFile (const char *filename, const void *data, int len)
Qclose (f);
}
/*
QFS_WriteBuffers
The filename will be prefixed by the current game directory
*/
VISIBLE void
QFS_WriteBuffers (const char *filename, int count, ...)
{
va_list args;
QFile *f;
va_start (args, count);
f = QFS_WOpen (filename, 0);
if (!f) {
Sys_Error ("Error opening %s", filename);
}
Sys_DPrintf ("QFS_WriteBuffers: %s\n", filename);
while (count--) {
void *data = va_arg (args, void *);
int len = va_arg (args, int);
Qwrite (f, data, len);
}
Qclose (f);
va_end (args);
}
VISIBLE int
QFS_CreatePath (const char *path)
{