about summary refs log tree commit diff
path: root/src/engine/client/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/client/graphics.cpp')
-rw-r--r--src/engine/client/graphics.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp
index 48988800..fb994953 100644
--- a/src/engine/client/graphics.cpp
+++ b/src/engine/client/graphics.cpp
@@ -29,7 +29,6 @@
 #include <engine/console.h>
 
 #include <math.h>
-#include <time.h>
 
 #include "graphics.h"
 
@@ -883,28 +882,11 @@ void CGraphics_SDL::Swap()
 {
 	if(m_DoScreenshot)
 	{
-		// find filename
 		char aFilename[128];
-		static int Index = 1;
-
-		time_t Time;
 		char aDate[20];
 
-		time(&Time);
-		tm* TimeInfo = localtime(&Time);
-		strftime(aDate, sizeof(aDate), "%Y-%m-%d_%I-%M", TimeInfo);
-
-		for(; Index < 10000; Index++)
-		{
-			IOHANDLE io;
-			str_format(aFilename, sizeof(aFilename), "screenshots/screenshot%s-%05d.png", aDate, Index);
-			io = m_pStorage->OpenFile(aFilename, IOFLAG_READ, IStorage::TYPE_SAVE);
-			if(io)
-				io_close(io);
-			else
-				break;
-		}
-
+		str_timestamp(aDate, sizeof(aDate));
+		str_format(aFilename, sizeof(aFilename), "screenshots/screenshot_%s.png", aDate);
 		ScreenshotDirect(aFilename);
 		m_DoScreenshot = false;
 	}