summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAaron Marks <nymacro@gmail.com>2005-04-19 09:30:43 +0000
committerAaron Marks <nymacro@gmail.com>2005-04-19 09:30:43 +0000
commite2ad3e13fb1163f53304bbdbab4c44f12c16731d (patch)
tree56ba9fbb5f89ad0e39d22497231cb09c044e38d0 /src/main.cpp
parent3370b59fe2c9544fddebb1281505ddec3d22c0e1 (diff)
downloadmanaserv-e2ad3e13fb1163f53304bbdbab4c44f12c16731d.tar.gz
manaserv-e2ad3e13fb1163f53304bbdbab4c44f12c16731d.tar.bz2
manaserv-e2ad3e13fb1163f53304bbdbab4c44f12c16731d.tar.xz
manaserv-e2ad3e13fb1163f53304bbdbab4c44f12c16731d.zip
Added basic object definition for reviewal.
Added basic scripting interface & Squirrel (squirrel.sf.net).
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 19e95520..56e0d693 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -27,6 +27,12 @@
#include <SDL.h>
#include <SDL_net.h>
+#ifdef SCRIPT_SUPPORT
+#define SCRIPT_SQUIRREL
+#include "script.h"
+#include "script-sq.h"
+#endif
+
#define TMW_WORLD_TICK SDL_USEREVENT
#define SERVER_PORT 9601
@@ -70,6 +76,16 @@ void initialize()
// Initialize world timer at 10 times per second
worldTimerID = SDL_AddTimer(100, worldTick, NULL);
+
+ // Initialize scripting subsystem
+#ifdef SCRIPT_SUPPORT
+#ifdef SCRIPT_SQUIRREL
+ script = new ScriptSquirrel();
+#else
+#error Scripting enabled, but no language defined.
+#endif
+ script->init();
+#endif
}
/**
@@ -82,6 +98,11 @@ void deinitialize()
// Quit SDL_net
SDLNet_Quit();
+
+ // Destroy scripting subsystem
+#ifdef SCRIPT_SUPPORT
+ delete script;
+#endif
}
/**
@@ -124,6 +145,9 @@ int main(int argc, char *argv[])
// - Handle all messages that are in the message queue
// - Update all active objects/beings
+#ifdef SCRIPT_SUPPORT
+ script->update();
+#endif
}
else if (event.type == SDL_QUIT)
{