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 Bgetcwd getcwd
# define Bgetenv getenv # define Bgetenv getenv
# define Btime() time(NULL) # define Btime() time(NULL)
# define Butime utime
#else #else

View File

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

View File

@ -5,7 +5,7 @@
enableevent all enableevent all
Open your map. 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. 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. Tip: With pk_quickmapcycling enabled, Ctrl-(LShift-)X loads the next (previous) map in a directory.