kextract: Propagate the GRP file's modification time to all extracted files.

git-svn-id: https://svn.eduke32.com/eduke32@3293 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-12-14 23:10:10 +00:00
parent d7132e587f
commit 54195d8135
3 changed files with 18 additions and 1 deletions

View file

@ -587,6 +587,7 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff
# define Bgetcwd getcwd
# define Bgetenv getenv
# define Btime() time(NULL)
# define Butime utime
#else

View file

@ -7,6 +7,8 @@
#include "compat.h"
#include <utime.h>
#define MAXFILES 4096
static char buf[65536];
@ -36,6 +38,7 @@ void findfiles(const char *dafilespec)
int main(int argc, char **argv)
{
int i, j, k, l, fil, fil2;
struct Bstat stbuf;
int onlylist = (argc==2);
@ -126,6 +129,9 @@ int main(int argc, char **argv)
return(0);
}
if (Bfstat(fil, &stbuf) == -1)
stbuf.st_mtime = 0;
for(i=0;i<numfiles;i++)
{
if (marked4extraction[i] == 0) continue;
@ -152,6 +158,16 @@ int main(int argc, char **argv)
}
}
Bclose(fil2);
if (stbuf.st_mtime != 0)
{
struct utimbuf times;
times.modtime = stbuf.st_mtime;
times.actime = Btime();
Butime(filelist[i],&times);
}
}
Bclose(fil);

View file

@ -5,7 +5,7 @@
enableevent all
Open your map.
In 2D mode, press CTRL+C to search for the tiles and sounds used in the current map.
In 2D mode, press CTRL+V to search for the tiles and sounds used in the current map.
You can set the gamevar "verbose" to 1 if you want verbose .csv formatted information that would normally clog up the output.
Tip: With pk_quickmapcycling enabled, Ctrl-(LShift-)X loads the next (previous) map in a directory.