2012-11-10 20:59:00 +00:00
|
|
|
/* The Lunatic Interpreter, part of EDuke32. Game-side stuff. */
|
2011-09-20 19:12:24 +00:00
|
|
|
|
|
|
|
#ifndef EDUKE32_LUNATIC_H_
|
|
|
|
#define EDUKE32_LUNATIC_H_
|
|
|
|
|
2012-11-10 20:59:00 +00:00
|
|
|
#include "lunatic.h"
|
|
|
|
#include "gameexec.h" // MAXEVENTS
|
2011-09-20 19:12:24 +00:00
|
|
|
|
2012-06-10 18:56:10 +00:00
|
|
|
|
2012-11-10 20:59:00 +00:00
|
|
|
extern L_State g_ElState;
|
2012-06-10 18:56:10 +00:00
|
|
|
|
2011-09-20 19:12:24 +00:00
|
|
|
|
2012-06-10 18:56:10 +00:00
|
|
|
extern uint8_t g_elEvents[MAXEVENTS]; // shouldn't be used directly
|
2012-06-10 18:56:15 +00:00
|
|
|
extern uint8_t g_elActors[MAXTILES]; // shouldn't be used directly
|
2011-09-20 19:12:24 +00:00
|
|
|
|
2012-07-20 21:57:44 +00:00
|
|
|
extern uint32_t g_eventCalls[MAXEVENTS], g_actorCalls[MAXTILES];
|
|
|
|
extern double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES];
|
|
|
|
|
2011-09-20 19:12:24 +00:00
|
|
|
// -- functions --
|
2012-07-20 21:57:44 +00:00
|
|
|
void El_PrintTimes(void);
|
|
|
|
|
2012-11-10 20:59:00 +00:00
|
|
|
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);
|
2012-06-10 18:56:15 +00:00
|
|
|
|
|
|
|
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; }
|
2011-09-20 19:12:24 +00:00
|
|
|
|
|
|
|
#endif
|