diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 21f7c6c45fd2a26aff061aba3df305a845adcca9..3fed07bcc2457ce00fcf7d571590b8d02f68cf2d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -103,6 +103,7 @@ add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 lua_hudlib_drawlist.c lua_colorlib.c lua_inputlib.c + lua_interceptlib.c ) # This updates the modification time for comptime.c at the diff --git a/src/Sourcefile b/src/Sourcefile index ad5eacfeb9e96f75316ce0d4c66ae8d1e31b4fe1..68ffe0f3f603b580c7c47fa3070909f5f3f82b15 100644 --- a/src/Sourcefile +++ b/src/Sourcefile @@ -97,3 +97,4 @@ lua_hudlib.c lua_hudlib_drawlist.c lua_inputlib.c lua_colorlib.c +lua_interceptlib.c diff --git a/src/deh_tables.c b/src/deh_tables.c index fa86518e2e0eaf51555d6ee334a97cad22b3afa3..3fdb1ab0bd3249185bc3f31823300b6840b14723 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -25,6 +25,7 @@ #include "g_game.h" // Joystick axes (for lua) #include "i_joy.h" #include "g_input.h" // Game controls (for lua) +#include "p_maputl.h" // P_PathTraverse constants (for lua) #include "deh_tables.h" @@ -5797,6 +5798,11 @@ struct int_const_s const INT_CONST[] = { {"MB_BUTTON8",MB_BUTTON8}, {"MB_SCROLLUP",MB_SCROLLUP}, {"MB_SCROLLDOWN",MB_SCROLLDOWN}, + + // P_PathTraverse constants + {"PT_ADDLINES",PT_ADDLINES}, + {"PT_ADDTHINGS",PT_ADDTHINGS}, + {"PT_EARLYOUT",PT_EARLYOUT}, {NULL,0} }; diff --git a/src/lua_baselib.c b/src/lua_baselib.c index b70c63ece13cfc10daa1d621506b55a5671afa77..26b86829092a49045e8ab768d4927fd55d081cad 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -222,6 +222,8 @@ static const struct { {META_KEYEVENT, "keyevent_t"}, {META_MOUSE, "mouse_t"}, + + {META_INTERCEPT, "intercept_t"}, {NULL, NULL} }; diff --git a/src/lua_libs.h b/src/lua_libs.h index a90d8ac7fb800c426e7bef94538803366a835b8b..5b4045f01646bae1322c9a4c943d9cc71eef0ca7 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -95,6 +95,8 @@ extern boolean ignoregameinputs; #define META_KEYEVENT "KEYEVENT_T*" #define META_MOUSE "MOUSE_T*" +#define META_INTERCEPT "INTERCEPT_T*" + boolean luaL_checkboolean(lua_State *L, int narg); int LUA_EnumLib(lua_State *L); @@ -115,3 +117,4 @@ int LUA_BlockmapLib(lua_State *L); int LUA_HudLib(lua_State *L); int LUA_ColorLib(lua_State *L); int LUA_InputLib(lua_State *L); +int LUA_InterceptLib(lua_State *L); diff --git a/src/lua_script.c b/src/lua_script.c index 11ced70f25a7ed2f2728e4f3d9816b1191b3a736..7db9624407818feaba654f6326690a79e5d243b6 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -62,6 +62,7 @@ static lua_CFunction liblist[] = { LUA_HudLib, // HUD stuff LUA_ColorLib, // general color functions LUA_InputLib, // inputs + LUA_InterceptLib, // intercept_t NULL }; diff --git a/src/p_local.h b/src/p_local.h index 8bdc89841fd28e60623ea00cdf575e48e3d87065..2be99ff4a50d43b59c76cea60e08b785dd46dee9 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -446,6 +446,8 @@ boolean PIT_PushableMoved(mobj_t *thing); boolean P_DoSpring(mobj_t *spring, mobj_t *object); +boolean PTR_SlideTraverse(intercept_t *in); + INT32 P_GetSectorLightNumAt(sector_t *sector, fixed_t x, fixed_t y, fixed_t z); INT32 P_GetLightLevelFromSectorAt(sector_t *sector, fixed_t x, fixed_t y, fixed_t z); INT32 P_GetSectorLightLevelAt(fixed_t x, fixed_t y, fixed_t z); diff --git a/src/p_map.c b/src/p_map.c index e28f4ae450f581e6006f0b65b2dbf88e7f97d46a..bfb3ccf10c6d54ab30de9a12ddab549057c3b2e7 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3535,7 +3535,7 @@ static void PTR_GlideClimbTraverse(line_t *li) } } -static boolean PTR_SlideTraverse(intercept_t *in) +boolean PTR_SlideTraverse(intercept_t *in) { line_t *li; diff --git a/src/p_maputl.c b/src/p_maputl.c index 9c30d3ead094bcbbcf7e3c98e90fc159285a36b0..2d9f23c7b9bce90d87f43af3ad0ff49b3ecebd95 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -1170,7 +1170,7 @@ static boolean P_TraverseIntercepts(traverser_t func, fixed_t maxfrac) if (dist > maxfrac) return true; // Checked everything in range. - + if (!func(in)) return false; // Don't bother going farther. diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index 7142cb64cb571e5b1c84489b1b38c9c48bdbf561..d282b3b4a1caee6d39a8746b6523d88b7443fadf 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -449,6 +449,7 @@ <ClCompile Include="..\lua_hudlib_drawlist.c" /> <ClCompile Include="..\lua_infolib.c" /> <ClCompile Include="..\lua_inputlib.c" /> + <ClCompile Include="..\lua_interceptlib.c" /> <ClCompile Include="..\lua_maplib.c" /> <ClCompile Include="..\lua_mathlib.c" /> <ClCompile Include="..\lua_mobjlib.c" /> diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters index 44c353ae29899fd561065a64b50d517cff34505b..4a2a5d5950924a079e2141359c96e3c88baa84c0 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj.filters +++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters @@ -779,6 +779,9 @@ </ClCompile> <ClCompile Include="..\lua_inputlib.c"> <Filter>LUA</Filter> + </ClCompile> + <ClCompile Include="..\lua_interceptlib.c"> + <Filter>LUA</Filter> </ClCompile> <ClCompile Include="..\lua_maplib.c"> <Filter>LUA</Filter>