diff options
author | Ton Roosendaal <ton@blender.org> | 2011-01-02 16:33:32 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-01-02 16:33:32 +0300 |
commit | 118667c1bfcbac12f38435f5e143ece41bb7a4fd (patch) | |
tree | aea89b8fa0122bcb0dcae1519362308ac8bf89f3 /source/blender/blenloader | |
parent | 939cf114bb4465fc9977620b84bad60047526fe8 (diff) |
Small feature for debugging pleasure:
The svn revision nr is saved in Blender file header now.
Can only be retrieved with running blender -d now.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 10 |
3 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/blenloader/CMakeLists.txt b/source/blender/blenloader/CMakeLists.txt index a9a89120b73..e51fb35a4ac 100644 --- a/source/blender/blenloader/CMakeLists.txt +++ b/source/blender/blenloader/CMakeLists.txt @@ -50,4 +50,8 @@ set(SRC intern/readfile.h ) +if(WITH_BUILDINFO) + add_definitions(-DNAN_BUILDINFO) +endif() + blender_add_lib(bf_blenloader "${SRC}" "${INC}") diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0dfdd46d17b..b4dfcdfb186 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5654,12 +5654,14 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead) bfd->main->subversionfile= fg->subversion; bfd->main->minversionfile= fg->minversion; bfd->main->minsubversionfile= fg->minsubversion; + bfd->main->revision= fg->revision; bfd->winpos= fg->winpos; bfd->fileflags= fg->fileflags; bfd->displaymode= fg->displaymode; bfd->globalf= fg->globalf; BLI_strncpy(bfd->filename, fg->filename, sizeof(bfd->filename)); + if(G.fileflags & G_FILE_RECOVER) BLI_strncpy(fd->relabase, fg->filename, sizeof(fd->relabase)); @@ -6642,7 +6644,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* WATCH IT!!!: pointers from libdata have not been converted */ if(G.f & G_DEBUG) - printf("read file %s\n Version %d sub %d\n", fd->relabase, main->versionfile, main->subversionfile); + printf("read file %s\n Version %d sub %d svn r%d\n", fd->relabase, main->versionfile, main->subversionfile, main->revision); if(main->versionfile == 100) { /* tex->extend and tex->imageflag have changed: */ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 34825af6c6a..f1e1d13a2d6 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2375,7 +2375,15 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar) fg.subversion= BLENDER_SUBVERSION; fg.minversion= BLENDER_MINVERSION; fg.minsubversion= BLENDER_MINSUBVERSION; - fg.pads= 0; /* prevent mem checkers from complaining */ +#ifdef NAN_BUILDINFO + { + extern char build_rev[]; + fg.revision= atoi(build_rev); + } +#else + fg.revision= 0; +#endif + fg.pads= fg.pad= 0; /* prevent mem checkers from complaining */ writestruct(wd, GLOB, "FileGlobal", 1, &fg); } |