raze-gles/polymer/eduke32/source/lunatic/lunatic_game.h
helixhorned 3bcdc5acb8 Lunatic reorganization part 2: split into engine and editor/game parts.
On the engine side (functions starting with L_), there are now the basic
parts like state creation and running code from strings and files.
The game and editor can add to that by e.g. loading whatever they please
into the state. Their functions start with El_ and Em_, respectively.
The Lua scripts still reside in source/lunatic, even for the common ones.
This is because they will be embedded into the binaries as bytecode or
compressed source eventually, so their location on disk will be irrelevant.

git-svn-id: https://svn.eduke32.com/eduke32@3148 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-10 20:59:00 +00:00

31 lines
1 KiB
C

/* The Lunatic Interpreter, part of EDuke32. Game-side stuff. */
#ifndef EDUKE32_LUNATIC_H_
#define EDUKE32_LUNATIC_H_
#include "lunatic.h"
#include "gameexec.h" // MAXEVENTS
extern L_State g_ElState;
extern uint8_t g_elEvents[MAXEVENTS]; // shouldn't be used directly
extern uint8_t g_elActors[MAXTILES]; // shouldn't be used directly
extern uint32_t g_eventCalls[MAXEVENTS], g_actorCalls[MAXTILES];
extern double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES];
// -- functions --
void El_PrintTimes(void);
int32_t El_CreateState(L_State *estate, const char *name);
void El_DestroyState(L_State *estate);
int32_t El_CallEvent(L_State *estate, int32_t eventidx, int32_t iActor, int32_t iPlayer, int32_t lDist);
int32_t El_CallActor(L_State *estate, int32_t actortile, int32_t iActor, int32_t iPlayer, int32_t lDist);
static inline int32_t El_HaveEvent(int32_t eventidx) { return g_elEvents[eventidx]!=0; }
static inline int32_t El_HaveActor(int32_t actortile) { return g_elActors[actortile]!=0; }
#endif