jpg screenshot path fix

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5751 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Glen Masgai
2010-10-11 15:07:17 +00:00
parent fa20326423
commit 13bee35b85
2 changed files with 12 additions and 20 deletions
+6 -12
View File
@@ -362,16 +362,6 @@ void jpeg_screenshot_____(const char *imagepath, bool mapshot = false)
#include "jpegenc.h"
int save_jpeg(const char *filename, uchar *pixels, int iw, int ih, int jpegquality)
{
jpegenc *jpegencoder = new jpegenc;
if(jpegencoder->encode(filename, (colorRGB *)pixels, iw, ih, jpegquality) < 0) return -1;
conoutf("writing to file: %s", filename);
delete jpegencoder;
return 0;
}
void jpeg_screenshot(const char *imagepath, bool mapshot = false)
{
extern int minimaplastsize;
@@ -411,8 +401,12 @@ void jpeg_screenshot(const char *imagepath, bool mapshot = false)
}
}
const char *filename = screenshotpath(imagepath, "jpg");
if(save_jpeg(filename, pixels, iw, ih, jpegquality) < 0) conoutf("\f3Error saving jpeg file");
const char *filename = findfile(screenshotpath(imagepath, "jpg"), "wb");
conoutf("writing to file: %s", filename);
jpegenc *jpegencoder = new jpegenc;
jpegencoder->encode(filename, (colorRGB *)pixels, iw, ih, jpegquality);
delete jpegencoder;
delete[] pixels;
}
-2
View File
@@ -59,13 +59,11 @@
#ifdef __APPLE__
#include "INTL/libintl.h"
#include "JPEG/jpeglib.h"
#include "OpenAL/al.h"
#include "OpenAL/alc.h"
#include "Vorbis/vorbisfile.h"
#else
#include <libintl.h>
#include <jpeglib.h>
#include "AL/al.h"
#include "AL/alc.h"
#include "vorbis/vorbisfile.h"