summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-11-29 15:53:15 +0000
committertruelight <truelight@openttd.org>2005-11-29 15:53:15 +0000
commitc963c59b672b18e1b67eb859b83d69eb17eac647 (patch)
treea71d1010bc421c8702c2fb37e41c0ae1e8fb6d5c /openttd.c
parent2eb1c8a2151deef9155eb73a83873029d3b40f73 (diff)
downloadopenttd-c963c59b672b18e1b67eb859b83d69eb17eac647.tar.xz
(svn r3245) -Add: allow OpenTTD to give his GPMI-params to the GPMI modules
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/openttd.c b/openttd.c
index a26d2d14e..6330765ef 100644
--- a/openttd.c
+++ b/openttd.c
@@ -316,6 +316,9 @@ int ttd_main(int argc, char* argv[])
uint startdate = -1;
bool dedicated;
+#ifdef GPMI
+ _ai.gpmi_param[0] = 0;
+#endif /* GPMI */
musicdriver[0] = sounddriver[0] = videodriver[0] = 0;
_game_mode = GM_MENU;
@@ -330,9 +333,9 @@ int ttd_main(int argc, char* argv[])
// a ':' behind it means: it need a param (e.g.: -m<driver>)
// a '::' behind it means: it can optional have a param (e.g.: -d<debug>)
#if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32)
- optformat = "bm:s:v:hDfn::l:eit:d::r:g::G:p:c:";
+ optformat = "a:bm:s:v:hDfn::l:eit:d::r:g::G:p:c:";
#else
- optformat = "bm:s:v:hDn::l:eit:d::r:g::G:p:c:"; // no fork option
+ optformat = "a:bm:s:v:hDn::l:eit:d::r:g::G:p:c:"; // no fork option
#endif
MyGetOptInit(&mgo, argc-1, argv+1, optformat);
@@ -358,6 +361,11 @@ int ttd_main(int argc, char* argv[])
else
network_conn = NULL;
} break;
+#ifdef GPMI
+ case 'a': ttd_strlcpy(_ai.gpmi_param, mgo.opt, sizeof(_ai.gpmi_param)); break;
+#else
+ case 'a': DEBUG(misc, 0)("The -a option only works if GPMI is compiled with OpenTTD."); break;
+#endif /* GPMI */
case 'b': _ai.network_client = true; break;
case 'r': ParseResolution(resolution, mgo.opt); break;
case 'l': language = mgo.opt; break;