Begin work on adding access to polyobjects in Lua:

* create new file lua_polyobjlib.c
* made a stub LUA_PolyObjLib function
* added META_POLYOBJ to lua_libs.h
* updated makefile, CMake and MSVC project files for lua_polyobjlib.c
This commit is contained in:
Monster Iestyn 2020-09-08 18:08:08 +01:00
parent 4959aa5614
commit d5beae9738
7 changed files with 32 additions and 0 deletions

View File

@ -261,6 +261,7 @@ set(SRB2_LUA_SOURCES
lua_mathlib.c
lua_mobjlib.c
lua_playerlib.c
lua_polyobjlib.c
lua_script.c
lua_skinlib.c
lua_thinkerlib.c

View File

@ -47,5 +47,6 @@ OBJS:=$(OBJS) \
$(OBJDIR)/lua_skinlib.o \
$(OBJDIR)/lua_thinkerlib.o \
$(OBJDIR)/lua_maplib.o \
$(OBJDIR)/lua_polyobjlib.o \
$(OBJDIR)/lua_blockmaplib.o \
$(OBJDIR)/lua_hudlib.o

View File

@ -50,6 +50,8 @@ extern lua_State *gL;
#define META_VECTOR3 "VECTOR3_T"
#define META_MAPHEADER "MAPHEADER_T*"
#define META_POLYOBJ "POLYOBJ_T*"
#define META_CVAR "CONSVAR_T*"
#define META_SECTORLINES "SECTOR_T*LINES"
@ -88,5 +90,6 @@ int LUA_PlayerLib(lua_State *L);
int LUA_SkinLib(lua_State *L);
int LUA_ThinkerLib(lua_State *L);
int LUA_MapLib(lua_State *L);
int LUA_PolyObjLib(lua_State *L);
int LUA_BlockmapLib(lua_State *L);
int LUA_HudLib(lua_State *L);

22
src/lua_polyobjlib.c Normal file
View File

@ -0,0 +1,22 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2020 by Iestyn "Monster Iestyn" Jealous.
// Copyright (C) 2016-2020 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file lua_polyobjlib.c
/// \brief polyobject library for Lua scripting
#include "doomdef.h"
#include "p_local.h"
#include "p_polyobj.h"
#include "lua_script.h"
#include "lua_libs.h"
int LUA_PolyObjLib(lua_State *L)
{
return 0;
}

View File

@ -50,6 +50,7 @@ static lua_CFunction liblist[] = {
LUA_SkinLib, // skin_t, skins[]
LUA_ThinkerLib, // thinker_t
LUA_MapLib, // line_t, side_t, sector_t, subsector_t
LUA_PolyObjLib, // polyobj_t
LUA_BlockmapLib, // blockmap stuff
LUA_HudLib, // HUD stuff
NULL

View File

@ -400,6 +400,7 @@
<ClCompile Include="..\lua_mathlib.c" />
<ClCompile Include="..\lua_mobjlib.c" />
<ClCompile Include="..\lua_playerlib.c" />
<ClCompile Include="..\lua_polyobjlib.c" />
<ClCompile Include="..\lua_script.c" />
<ClCompile Include="..\lua_skinlib.c" />
<ClCompile Include="..\lua_thinkerlib.c" />

View File

@ -720,6 +720,9 @@
<ClCompile Include="..\lua_playerlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_polyobjlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_script.c">
<Filter>LUA</Filter>
</ClCompile>