mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
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:
parent
031055a91f
commit
cf40f5073d
3 changed files with 9 additions and 32 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue