From dd009ccdfd62f9153dbc72f5f5de5d5f72979690 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 22 Apr 2014 15:13:38 +1000 Subject: Move all source into the new src directory, and shuffle a few other things around. --- src/LuaSL/LuaSL.h | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/LuaSL/LuaSL.h (limited to 'src/LuaSL/LuaSL.h') diff --git a/src/LuaSL/LuaSL.h b/src/LuaSL/LuaSL.h new file mode 100644 index 0000000..d1f448e --- /dev/null +++ b/src/LuaSL/LuaSL.h @@ -0,0 +1,82 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#else +//#define PACKAGE_EXAMPLES_DIR "." +#define __UNUSED__ +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +typedef struct _script script; // Define this here, so LuaSL_threads.h can use it. +typedef struct _gameGlobals gameGlobals; // Define this here, so LuaSL_threads.h can use it. + +#include "LuaSL_threads.h" +#include "LumbrJack.h" + + +#define WIDTH (512) +#define HEIGHT (384) + + +#define TABLE_WIDTH 7 +#define TABLE_HEIGHT 42 + + +struct _gameGlobals +{ + Ecore_Evas *ee; // Our window. + Evas *canvas; // The canvas for drawing directly onto. + Evas_Object *bg; // Our background edje, also the game specific stuff. + Evas_Object *edje; // The edje of the background. + Ecore_Con_Server *server; + Eina_Hash *scripts, *names; + int logDom; + const char *address; + int port; + boolean ui; // Wether we actually start up the UI. +}; + +struct _script +{ + Eina_Clist node; + gameGlobals *game; + char SID[PATH_MAX]; + char fileName[PATH_MAX]; + lua_State *L; + struct timeval startTime; + float compileTime, timerTime; + int bugs, warnings; + boolean running; + int status; + int args; + Eina_Clist messages; + Ecore_Con_Client *client; + Ecore_Timer *timer; +}; + +typedef struct +{ + Eina_Clist node; + script *script; + const char message[PATH_MAX]; +} scriptMessage; + + +void scriptSendBack(void * data); +void sendBack(gameGlobals *ourGlobals, Ecore_Con_Client *client, const char *SID, const char *message, ...); +void sendForth(gameGlobals *ourGlobals, const char *SID, const char *message, ...); +float timeDiff(struct timeval *now, struct timeval *then); + +#include "LuaSL_LSL_tree.h" -- cgit v1.1