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
|
|
|
|
2012-12-23 19:24:16 +00:00
|
|
|
// actor initialization data
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
con_move_t mov;
|
|
|
|
int16_t movflags;
|
|
|
|
int16_t strength;
|
|
|
|
con_action_t act;
|
|
|
|
uint8_t haveit; // shouldn't be used directly
|
|
|
|
} el_actor_t;
|
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-12-23 19:24:16 +00:00
|
|
|
extern el_actor_t g_elActors[MAXTILES];
|
2011-09-20 19:12:24 +00:00
|
|
|
|
2013-03-24 18:52:41 +00:00
|
|
|
extern int32_t g_elEventError;
|
|
|
|
|
2012-07-20 21:57:44 +00:00
|
|
|
extern uint32_t g_eventCalls[MAXEVENTS], g_actorCalls[MAXTILES];
|
2013-03-13 10:48:19 +00:00
|
|
|
extern double g_eventTotalMs[MAXEVENTS], g_actorTotalMs[MAXTILES], g_actorMinMs[MAXTILES], g_actorMaxMs[MAXTILES];
|
2012-07-20 21:57:44 +00:00
|
|
|
|
2011-09-20 19:12:24 +00:00
|
|
|
// -- functions --
|
2012-07-20 21:57:44 +00:00
|
|
|
void El_PrintTimes(void);
|
|
|
|
|
2012-12-25 16:13:41 +00:00
|
|
|
void El_ClearErrors(void);
|
|
|
|
void El_DisplayErrors(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);
|
|
|
|
|
2013-02-25 15:31:19 +00:00
|
|
|
int32_t El_CallEvent(L_State *estate, int32_t eventidx, int32_t iActor, int32_t iPlayer, int32_t lDist, int32_t *iReturn);
|
2012-11-10 20:59:00 +00:00
|
|
|
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; }
|
2012-12-23 19:24:16 +00:00
|
|
|
static inline int32_t El_HaveActor(int32_t actortile) { return g_elActors[actortile].haveit!=0; }
|
2011-09-20 19:12:24 +00:00
|
|
|
|
|
|
|
#endif
|