mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-26 05:02:18 +00:00
624ff38926
- Use Q1DIR directly, instead of assigning it to DATADIR. Approved by: garga (mentor, implicitly)
47 lines
1.2 KiB
C
47 lines
1.2 KiB
C
--- ./image.c.orig Sun Oct 16 22:47:00 2005
|
|
+++ ./image.c Sat May 20 10:00:24 2006
|
|
@@ -422,6 +422,7 @@
|
|
buffer[i+2] = temp;
|
|
}
|
|
|
|
+ COM_CreatePath(filename);
|
|
if (!COM_WriteFile(filename, buffer, size + 18))
|
|
retval = false;
|
|
free (buffer);
|
|
@@ -585,17 +586,14 @@
|
|
Image_WritePNG
|
|
=============
|
|
*/
|
|
-int Image_WritePNG (char *filename, int compression, byte *pixels, int width, int height)
|
|
+int Image_WritePNG (char *name, int compression, byte *pixels, int width, int height)
|
|
{
|
|
- char name[MAX_OSPATH];
|
|
int i, bpp = 3, pngformat, width_sign;
|
|
FILE *fp;
|
|
png_structp png_ptr;
|
|
png_infop info_ptr;
|
|
png_byte **rowpointers;
|
|
|
|
- Q_snprintfz (name, MAX_OSPATH, "%s/%s", com_basedir, filename);
|
|
-
|
|
width_sign = (width < 0) ? -1 : 1;
|
|
width = abs(width);
|
|
|
|
@@ -816,15 +814,12 @@
|
|
Image_WriteJPEG
|
|
=============
|
|
*/
|
|
-int Image_WriteJPEG (char *filename, int compression, byte *pixels, int width, int height)
|
|
+int Image_WriteJPEG (char *name, int compression, byte *pixels, int width, int height)
|
|
{
|
|
- char name[MAX_OSPATH];
|
|
byte *scanline;
|
|
FILE *fout;
|
|
struct jpeg_compress_struct cinfo;
|
|
struct jpeg_error_mgr jerr;
|
|
-
|
|
- Q_snprintfz (name, MAX_OSPATH, "%s/%s", com_basedir, filename);
|
|
|
|
if (!(fout = fopen(name, "wb")))
|
|
{
|