[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27994] trunk/blender/source/blender/ blenkernel/intern/image.c: [#21910] Add Current Time to Render Stamps

Campbell Barton ideasman42 at gmail.com
Sun Apr 4 23:57:51 CEST 2010


Revision: 27994
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27994
Author:   campbellbarton
Date:     2010-04-04 23:57:51 +0200 (Sun, 04 Apr 2010)

Log Message:
-----------
[#21910] Add Current Time to Render Stamps
by Harley Acheson (harley) 

note from the submission
-snip-
While in there I removed the Win32 conditionals that made "_strdate" used to
get date on Windows. "localtime" works fine on Windows so the results are consistent on all platforms.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/image.c

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c	2010-04-04 19:50:22 UTC (rev 27993)
+++ trunk/blender/source/blender/blenkernel/intern/image.c	2010-04-04 21:57:51 UTC (rev 27994)
@@ -889,14 +889,9 @@
 static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
 {
 	char text[256];
-	
-#ifndef WIN32
 	struct tm *tl;
 	time_t t;
-#else
-	char sdate[9];
-#endif /* WIN32 */
-	
+
 	if (scene->r.stamp & R_STAMP_FILENAME) {
 		if (G.relbase_valid) {
 			if (do_prefix)		sprintf(stamp_data->file, "File %s", G.sce);
@@ -917,14 +912,11 @@
 	}
 	
 	if (scene->r.stamp & R_STAMP_DATE) {
-#ifdef WIN32
-		_strdate (sdate);
-		sprintf (text, "%s", sdate);
-#else
+
 		t = time (NULL);
 		tl = localtime (&t);
-		sprintf (text, "%04d-%02d-%02d", tl->tm_year+1900, tl->tm_mon+1, tl->tm_mday);
-#endif /* WIN32 */
+		sprintf (text, "%04d/%02d/%02d %02d:%02d:%02d", tl->tm_year+1900, tl->tm_mon+1, tl->tm_mday, tl->tm_hour, tl->tm_min, tl->tm_sec);
+
 		if (do_prefix)		sprintf(stamp_data->date, "Date %s", text);
 		else				sprintf(stamp_data->date, "%s", text);
 	} else {





More information about the Bf-blender-cvs mailing list