[Scummvm-cvs-logs] CVS: scummvm/common engine.cpp,1.22,1.23 engine.h,1.28,1.29 gameDetector.cpp,1.120,1.121 main.cpp,1.34,1.35

Max Horn fingolfin at users.sourceforge.net
Mon Jul 14 19:17:03 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv17891/common

Modified Files:
	engine.cpp engine.h gameDetector.cpp main.cpp 
Log Message:
replaced SCUMMVM_VERSION/SCUMMVM_CVS by gScummVMVersion/gScummVMBuildDate/gScummVMFullVersion; made engine.o depend on all other .o files, so that the build date in it is always up-to-date

Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- engine.cpp	13 Jul 2003 12:24:36 -0000	1.22
+++ engine.cpp	15 Jul 2003 02:16:33 -0000	1.23
@@ -25,6 +25,49 @@
 #include "timer.h"
 #include "sound/mixer.h"
 
+/*
+ * Version string and build date string. These can be used by anything that
+ * wants to display this information to the user (e.g. about dialog).
+ *
+ * Note: it would be very nice if we could instead of (or in addition to) the
+ * build date present a date which corresponds to the date our source files
+ * were last changed. To understand the difference, imagine that a user
+ * makes a checkout of CVS on January 1, then after a week compiles it
+ * (e.g. after doing a 'make clean'). The build date then will say January 8
+ * even though the files were last changed on January 1.
+ *
+ * Another problem is that __DATE__/__TIME__ depend on the local time zone.
+ *
+ * It's clear that such a "last changed" date would be much more useful to us
+ * for feedback purposes. After all, when somebody files a bug report, we
+ * don't care about the build date, we want to know which date their checkout
+ * was made. This is even more important now since anon CVS lags a few
+ * days behind developer CVS.
+ *
+ * So, how could we implement this? At least on unix systems, a special script
+ * could do it. Basically, that script would run over all .cpp/.h files and
+ * parse the CVS 'Header' keyword we have in our file headers.
+ * That line contains a date/time in GMT. Now, the script just has to collect
+ * all these times and find the latest. This time then would be inserted into
+ * a header file or so (common/date.h ?) which engine.cpp then could
+ * include and put into a global variable analog to gScummVMBuildDate.
+ *
+ * Drawback: scanning all source/header files will be rather slow. Also, this
+ * only works on systems which can run powerful enough scripts (so I guess
+ * Visual C++ would be out of the game here? don't know VC enough to be sure).
+ *
+ * Another approach would be to somehow get CVS to update a global file
+ * (e.g. LAST_CHANGED) whenever any checkins are made. That would be
+ * faster and work w/o much "logic" on the client side, in particular no
+ * scripts have to be run. The problem with this is that I am not even
+ * sure it's actually possible! Modifying files during commit time is trivial
+ * to setup, but I have no idea if/how one can also change files which are not
+ * currently being commit'ed.
+ */
+const char *gScummVMVersion = "0.5.0pre-cvs";
+const char *gScummVMBuildDate = __DATE__ " " __TIME__;
+const char *gScummVMFullVersion = "ScummVM 0.5.0pre-cvs (" __DATE__ " " __TIME__ ")";
+
 /* FIXME - BIG HACK for MidiEmu */
 OSystem *g_system = 0;
 SoundMixer *g_mixer = 0;

Index: engine.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- engine.h	5 Jul 2003 11:14:16 -0000	1.28
+++ engine.h	15 Jul 2003 02:16:33 -0000	1.29
@@ -24,9 +24,9 @@
 #include "scummsys.h"
 #include "system.h"
 
-#define SCUMMVM_VERSION "0.5.0pre-cvs"
-#define SCUMMVM_CVS "2003-07-xx"
-
+extern const char *gScummVMVersion;		// e.g. "0.4.1"
+extern const char *gScummVMBuildDate;	// e.g. "2003-06-24"
+extern const char *gScummVMFullVersion;	// e.g. "ScummVM 0.4.1 (2003-06-24)"
 
 enum GameId {
 	GID_SCUMM_FIRST = 1,

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- gameDetector.cpp	12 Jul 2003 03:40:44 -0000	1.120
+++ gameDetector.cpp	15 Jul 2003 02:16:33 -0000	1.121
@@ -437,8 +437,7 @@
 				break;
 			case 'v':
 				CHECK_OPTION();
-				printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " "
-							 __TIME__ "\n");
+				printf("%s\n", gScummVMFullVersion);
 				exit(1);
 			case 'w':
 				_saveconfig = true;

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/main.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- main.cpp	7 Jul 2003 23:11:19 -0000	1.34
+++ main.cpp	15 Jul 2003 02:16:33 -0000	1.35
@@ -178,7 +178,7 @@
 
 	// Read the config file
 	g_config = new Config(scummhome, "scummvm");
-	g_config->set("versioninfo", SCUMMVM_VERSION);
+	g_config->set("versioninfo", gScummVMVersion);
 
 	// Parse the command line information
 	detector._saveconfig = false;





More information about the Scummvm-git-logs mailing list