aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-07-15 02:16:33 +0000
committerMax Horn2003-07-15 02:16:33 +0000
commitb05e7de7bb7d59647356d63ccb10e53bbec61bcd (patch)
tree9086c81565e5a46e912fd00a63239bc46b2bf342 /common
parentcc8334638b5f3f79e23b5580282a753f65b75ad5 (diff)
downloadscummvm-rg350-b05e7de7bb7d59647356d63ccb10e53bbec61bcd.tar.gz
scummvm-rg350-b05e7de7bb7d59647356d63ccb10e53bbec61bcd.tar.bz2
scummvm-rg350-b05e7de7bb7d59647356d63ccb10e53bbec61bcd.zip
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
svn-id: r9032
Diffstat (limited to 'common')
-rw-r--r--common/engine.cpp43
-rw-r--r--common/engine.h6
-rw-r--r--common/gameDetector.cpp3
-rw-r--r--common/main.cpp2
4 files changed, 48 insertions, 6 deletions
diff --git a/common/engine.cpp b/common/engine.cpp
index b00a3594b3..0600f3a0d8 100644
--- a/common/engine.cpp
+++ b/common/engine.cpp
@@ -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;
diff --git a/common/engine.h b/common/engine.h
index 462de8180c..f9d7fb9902 100644
--- a/common/engine.h
+++ b/common/engine.h
@@ -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,
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 88c9db6023..feef3aa2dc 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -437,8 +437,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) {
break;
case 'v':
CHECK_OPTION();
- printf("ScummVM " SCUMMVM_VERSION "\nBuilt on " __DATE__ " "
- __TIME__ "\n");
+ printf("%s\n", gScummVMFullVersion);
exit(1);
case 'w':
_saveconfig = true;
diff --git a/common/main.cpp b/common/main.cpp
index 07a93a46a3..ef5b2fe1a0 100644
--- a/common/main.cpp
+++ b/common/main.cpp
@@ -178,7 +178,7 @@ int main(int argc, char *argv[]) {
// 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;