nice filenames for server-stored demos

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3997 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2008-12-11 15:59:54 +00:00
parent ad399ea13a
commit 0c37ad857b
3 changed files with 12 additions and 1 deletions
+10
View File
@@ -40,6 +40,16 @@ char *getregszvalue(HKEY root, const char *keystr, const char *query)
}
#endif
const char *filenametime()
{
static string asciitime;
time_t t = time(NULL);
struct tm * timeinfo;
timeinfo = gmtime (&t);
strftime(asciitime, sizeof(string) - 1, "%Y%m%d_%H.%M.%S", timeinfo);
return asciitime;
}
char *path(char *s)
{
for(char *t = s; (t = strpbrk(t, "/\\")); *t++ = PATHDIV);