summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-07-10 14:57:43 +0000
committertruelight <truelight@openttd.org>2005-07-10 14:57:43 +0000
commit48b3b8699d7db88ae9307e319535c8ec5b236824 (patch)
treed80479fbf61384ebe9e039f86a4290aefd69ff45 /openttd.c
parent84faec4c4341a2310d9e97bc75170231ba5b1d43 (diff)
downloadopenttd-48b3b8699d7db88ae9307e319535c8ec5b236824.tar.xz
(svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
support to OpenTTD in preperation of AIScripts (long term). It is OFF by default. Add GPMI:=1 to Makefile.config to enable.
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/openttd.c b/openttd.c
index 04c24adbd..8ec907162 100644
--- a/openttd.c
+++ b/openttd.c
@@ -37,6 +37,11 @@
#include <stdarg.h>
+#ifdef GPMI
+#include <gpmi.h>
+#include <gpmi/packages/paths.h>
+#endif /* GPMI */
+
void GenerateWorld(int mode, uint log_x, uint log_y);
void CallLandscapeTick(void);
void IncreaseDate(void);
@@ -593,6 +598,18 @@ int ttd_main(int argc, char* argv[])
DeterminePaths();
CheckExternalFiles();
+#ifdef GPMI
+ /* Set the debug proc */
+ gpmi_debug_proc = &gpmi_debug_openttd;
+
+ /* Initialize GPMI */
+ gpmi_init();
+
+ /* Add our paths so we can find our own packages */
+ gpmi_path_append(&gpmi_path_modules, "gpmi/modules");
+ gpmi_path_append(&gpmi_path_packages, "gpmi/packages");
+#endif /* GPMI */
+
#ifdef UNIX
// We must fork here, or we'll end up without some resources we need (like sockets)
if (_dedicated_forks)