summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a619272)
raw | patch | inline | side by side (parent: a619272)
author | ARembo <ARembo@gmail.com> | |
Tue, 26 Jul 2011 09:03:19 +0000 (05:03 -0400) | ||
committer | ARembo <ARembo@gmail.com> | |
Tue, 26 Jul 2011 09:03:19 +0000 (05:03 -0400) |
src/menu.c | patch | blob | history |
diff --git a/src/menu.c b/src/menu.c
index baada0153986310e393d5a96a4c311175e736abf..ff6932df60e4741b38dab3450fb49940762fe20c 100644 (file)
--- a/src/menu.c
+++ b/src/menu.c
#include "menu.h"
#include "misc.h"
-#include "SDL.h"
+#include <SDL.h>
+#include <sys/stat.h>
extern SDL_Surface *screen;
#define QSND_NUM 14
static void shot(void) {
static int num=1;
- char fn[13];
+ char fn[100];//...
+#ifndef WIN32
+ char *e = getenv("HOME");
+ strncpy(fn, e, 60);
+ sprintf(&fn[strlen(fn)],"/.doom2d-rembo",num);
+ mkdir(fn, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+ sprintf(&fn[strlen(fn)],"/shot%04d.bmp",num);
+#else
sprintf(fn,"shot%04d.bmp",num);
+#endif
SDL_SaveBMP(screen, fn);
++num;
}