1 // SONIC ROBO BLAST 2 2 //----------------------------------------------------------------------------- 3 // Copyright (C) 2012-2016 by John "JTE" Muniz. 4 // Copyright (C) 2012-2020 by Sonic Team Junior. 5 // 6 // This program is free software distributed under the 7 // terms of the GNU General Public License, version 2. 8 // See the 'LICENSE' file for more details. 9 //----------------------------------------------------------------------------- 10 /// \file lua_libs.h 11 /// \brief libraries for Lua scripting 12 13 extern lua_State *gL; 14 15 #define MUTABLE_TAGS 16 17 #define LREG_VALID "VALID_USERDATA" 18 #define LREG_EXTVARS "LUA_VARS" 19 #define LREG_STATEACTION "STATE_ACTION" 20 #define LREG_ACTIONS "MOBJ_ACTION" 21 #define LREG_METATABLES "METATABLES" 22 23 #define META_STATE "STATE_T*" 24 #define META_MOBJINFO "MOBJINFO_T*" 25 #define META_SFXINFO "SFXINFO_T*" 26 #define META_SKINCOLOR "SKINCOLOR_T*" 27 #define META_COLORRAMP "SKINCOLOR_T*RAMP" 28 #define META_SPRITEINFO "SPRITEINFO_T*" 29 #define META_PIVOTLIST "SPRITEFRAMEPIVOT_T[]" 30 #define META_FRAMEPIVOT "SPRITEFRAMEPIVOT_T*" 31 32 #define META_TAGLIST "TAGLIST" 33 34 #define META_MOBJ "MOBJ_T*" 35 #define META_MAPTHING "MAPTHING_T*" 36 37 #define META_PLAYER "PLAYER_T*" 38 #define META_TICCMD "TICCMD_T*" 39 #define META_SKIN "SKIN_T*" 40 #define META_POWERS "PLAYER_T*POWERS" 41 #define META_SOUNDSID "SKIN_T*SOUNDSID" 42 #define META_SKINSPRITES "SKIN_T*SPRITES" 43 #define META_SKINSPRITESLIST "SKIN_T*SPRITES[]" 44 45 #define META_VERTEX "VERTEX_T*" 46 #define META_LINE "LINE_T*" 47 #define META_SIDE "SIDE_T*" 48 #define META_SUBSECTOR "SUBSECTOR_T*" 49 #define META_SECTOR "SECTOR_T*" 50 #define META_FFLOOR "FFLOOR_T*" 51 #ifdef HAVE_LUA_SEGS 52 #define META_SEG "SEG_T*" 53 #define META_NODE "NODE_T*" 54 #endif 55 #define META_SLOPE "PSLOPE_T*" 56 #define META_VECTOR2 "VECTOR2_T" 57 #define META_VECTOR3 "VECTOR3_T" 58 #define META_MAPHEADER "MAPHEADER_T*" 59 60 #define META_POLYOBJ "POLYOBJ_T*" 61 62 #define META_CVAR "CONSVAR_T*" 63 64 #define META_SECTORLINES "SECTOR_T*LINES" 65 #ifdef MUTABLE_TAGS 66 #define META_SECTORTAGLIST "sector_t.taglist" 67 #endif 68 #define META_SIDENUM "LINE_T*SIDENUM" 69 #define META_LINEARGS "LINE_T*ARGS" 70 #define META_LINESTRINGARGS "LINE_T*STRINGARGS" 71 #define META_THINGARGS "MAPTHING_T*ARGS" 72 #define META_THINGSTRINGARGS "MAPTHING_T*STRINGARGS" 73 #define META_POLYOBJVERTICES "POLYOBJ_T*VERTICES" 74 #define META_POLYOBJLINES "POLYOBJ_T*LINES" 75 #ifdef HAVE_LUA_SEGS 76 #define META_NODEBBOX "NODE_T*BBOX" 77 #define META_NODECHILDREN "NODE_T*CHILDREN" 78 #endif 79 80 #define META_BBOX "BOUNDING_BOX" 81 82 #define META_HUDINFO "HUDINFO_T*" 83 #define META_PATCH "PATCH_T*" 84 #define META_COLORMAP "COLORMAP" 85 #define META_CAMERA "CAMERA_T*" 86 87 #define META_ACTION "ACTIONF_T*" 88 89 #define META_LUABANKS "LUABANKS[]*" 90 91 boolean luaL_checkboolean(lua_State *L, int narg); 92 93 int LUA_EnumLib(lua_State *L); 94 int LUA_SOCLib(lua_State *L); 95 int LUA_BaseLib(lua_State *L); 96 int LUA_MathLib(lua_State *L); 97 int LUA_HookLib(lua_State *L); 98 int LUA_ConsoleLib(lua_State *L); 99 int LUA_InfoLib(lua_State *L); 100 int LUA_MobjLib(lua_State *L); 101 int LUA_PlayerLib(lua_State *L); 102 int LUA_SkinLib(lua_State *L); 103 int LUA_ThinkerLib(lua_State *L); 104 int LUA_MapLib(lua_State *L); 105 int LUA_TagLib(lua_State *L); 106 int LUA_PolyObjLib(lua_State *L); 107 int LUA_BlockmapLib(lua_State *L); 108 int LUA_HudLib(lua_State *L); 109