From 40ae9f64e508768e12a2f58b49919a99db160c08 Mon Sep 17 00:00:00 2001
From: ARembo <ARembo@gmail.com>
Date: Tue, 26 Jul 2011 05:03:19 -0400
Subject: [PATCH] =?utf8?q?=D0=A1=D0=BA=D1=80=D0=B8=D0=BD=D1=88=D0=BE=D1=82?=
 =?utf8?q?=D1=8B=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D1=81=D0=BE?=
 =?utf8?q?=D1=85=D1=80=D0=B0=D0=BD=D1=8F=D1=8E=D1=82=D1=81=D1=8F=20=D0=B2?=
 =?utf8?q?=20$HOME/.doom2d-rembo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 src/menu.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/menu.c b/src/menu.c
index baada01..ff6932d 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -36,7 +36,8 @@
 #include "menu.h"
 #include "misc.h"
 
-#include "SDL.h"
+#include <SDL.h>
+#include <sys/stat.h>
 extern SDL_Surface *screen;
 
 #define QSND_NUM 14
@@ -418,8 +419,16 @@ extern byte shot_vga;
 
 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;
 }
-- 
2.29.2