diff options
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/client/graphics.cpp | 10 | ||||
| -rw-r--r-- | src/engine/shared/console.cpp | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp index 667ba213..e2f4ae4c 100644 --- a/src/engine/client/graphics.cpp +++ b/src/engine/client/graphics.cpp @@ -27,6 +27,7 @@ #include <engine/keys.h> #include <math.h> +#include <time.h> #include "graphics.h" @@ -868,10 +869,17 @@ void CGraphics_SDL::Swap() 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%05d.png", Index); + str_format(aFilename, sizeof(aFilename), "screenshots/screenshot%s-%05d.png", aDate, Index); io = m_pStorage->OpenFile(aFilename, IOFLAG_READ); if(io) io_close(io); diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index c545b7db..eacf9b78 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -273,7 +273,8 @@ CConsole::CCommand *CConsole::FindCommand(const char *pName) void CConsole::ExecuteLine(const char *pStr) { - CConsole::ExecuteLineStroked(1, pStr); + CConsole::ExecuteLineStroked(1, pStr); // press it + CConsole::ExecuteLineStroked(0, pStr); // then release it } |