summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/main.cpp14
2 files changed, 16 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 490bd5b6..a48ca311 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -365,6 +365,11 @@
* src/beingmanager.cpp: Fixed a bug, thanks GCC 4.3!
+2008-04-20 Bjørn Lindeijer <bjorn@lindeijer.nl>
+
+ * src/main.cpp: Added --data parameter to be used to specify where to
+ get the data from when using --skipupdate.
+
2008-04-18 David Athay <ko2fan@gmail.com>
* src/game.cpp, src/openglgraphics.cpp: Mac now uses Apple key for
diff --git a/src/main.cpp b/src/main.cpp
index 25dbe127..373dc100 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -148,6 +148,7 @@ struct Options
std::string playername;
std::string configPath;
std::string updateHost;
+ std::string dataPath;
};
/**
@@ -257,6 +258,9 @@ void init_engine(const Options &options)
resman->addToSearchPath(homeDir, false);
// Add the main data directory to our PhysicsFS search path
+ if (!options.dataPath.empty()) {
+ resman->addToSearchPath(options.dataPath, true);
+ }
resman->addToSearchPath("data", true);
#if defined __APPLE__
CFBundleRef mainBundle = CFBundleGetMainBundle();
@@ -430,6 +434,7 @@ void printHelp()
<< " -h --help : Display this help" << std::endl
<< " -v --version : Display the version" << std::endl
<< " -u --skipupdate : Skip the update process" << std::endl
+ << " -d --data : Directory to load game data from" << std::endl
<< " -U --username : Login with this username" << std::endl
<< " -P --password : Login with this password" << std::endl
<< " -D --default : Bypass the login process with default settings" << std::endl
@@ -450,12 +455,13 @@ void printVersion()
void parseOptions(int argc, char *argv[], Options &options)
{
- const char *optstring = "hvuU:P:Dp:C:H:";
+ const char *optstring = "hvud:U:P:Dp:C:H:";
const struct option long_options[] = {
{ "help", no_argument, 0, 'h' },
{ "version", no_argument, 0, 'v' },
{ "skipupdate", no_argument, 0, 'u' },
+ { "data", required_argument, 0, 'd' },
{ "username", required_argument, 0, 'U' },
{ "password", required_argument, 0, 'P' },
{ "default", no_argument, 0, 'D' },
@@ -469,9 +475,8 @@ void parseOptions(int argc, char *argv[], Options &options)
int result = getopt_long(argc, argv, optstring, long_options, NULL);
- if (result == -1) {
+ if (result == -1)
break;
- }
switch (result) {
default: // Unknown option
@@ -484,6 +489,9 @@ void parseOptions(int argc, char *argv[], Options &options)
case 'u':
options.skipUpdate = true;
break;
+ case 'd':
+ options.dataPath = optarg;
+ break;
case 'U':
options.username = optarg;
break;