Merge branch 'lua-additions' into 'master'
Lua additions Thought I'd may as well make a merge request so I can remind people of all the various Lua-related changes here (and because it's about time some of them got in): * Added `P_PointOnLineSide(x, y, line)`. Allows you to quickly determine which side of a line faces the point. *line* can be a real line_t or a custom defined line (just like with P_ClosestPointOnLine). * Added seg_t and node_t support to Lua (note: these are disabled for now, due to complications with OpenGL that we all know something of by now. Bit of a shame really :( ) - of note is node.children and node.bbox: * node.children[] is an array that takes 0 or 1 as indexes (or "right" and "left", alternatively) * node.bbox(child,bboxcoord) is a two-arg function: child can be 0 or 1 (or "right" and "left", alternatively), bbox coord can be 0,1,2 or 3 (or "top", "bottom", "left" and "right", alternatively) * aside from the above, segs[] and nodes[] store the segs/nodes of the current map; segs.iterate and nodes.iterate iterates through segs/nodes * NF_SUBSECTOR is also available for usage with node.children * You can now get the palette indexes (i.e. colormap[n]) of colormap userdata from `v.getColormap`, where n is a palette index number between 0 and 255. Useful for finding out which palette colors turned into what, if they changed at all * ffloor_t userdata can now save to and be read from $$$.sav in netgames properly; this means custom mobj/player variables and NetVars can both send/recieve them directly if you wanted * **IMPORTANT** Blockmap search library! (with a new file: lua_blockmaplib.c) * Format of iteration function: `searchBlockmap(searchtype, function, mobj, [x1, x2, y1, y2])`. Returns true if search was uninteruppted, false if the iteration function returned true at any point * *searchtype* can be either "objects" or "lines", for looking for mobj_t and line_t stuff in the blockmap respectively * *function* is a function of your choice to iterate with: (sorry I can't get the next two bullets to be one indent further to the side) - format of function needed: `funcname(mobj, foundmobj)` or `funcname(mobj, foundline)` (for searching for objects and lines, respectively) - return value of *function* affects searching somewhat: nil doesn't change searching, false ends searching in a block (but doesn't stop searching, it just moves onto the next), and true ends the full search. Both returning true or false ultimately makes `searchBlockmap` return false. * *mobj* is the reference mobj that you're checking around (if you don't supply x/y ranges to search in, it defaults to checking within the mobj's radius in both axes). If *mobj* was removed mid-search the search stops and `searchBlockmap` returns false * (optional) *x1, x2, y1, y2* are coordinates on the map to search the blockmap between, if given See merge request !54
Showing
- SRB2.cbp 15 additions, 0 deletionsSRB2.cbp
- src/CMakeLists.txt 1 addition, 0 deletionssrc/CMakeLists.txt
- src/blua/Makefile.cfg 1 addition, 0 deletionssrc/blua/Makefile.cfg
- src/dehacked.c 5 additions, 0 deletionssrc/dehacked.c
- src/lua_baselib.c 36 additions, 1 deletionsrc/lua_baselib.c
- src/lua_blockmaplib.c 266 additions, 0 deletionssrc/lua_blockmaplib.c
- src/lua_hudlib.c 6 additions, 1 deletionsrc/lua_hudlib.c
- src/lua_libs.h 11 additions, 0 deletionssrc/lua_libs.h
- src/lua_maplib.c 483 additions, 0 deletionssrc/lua_maplib.c
- src/lua_script.c 97 additions, 0 deletionssrc/lua_script.c
- src/lua_script.h 3 additions, 0 deletionssrc/lua_script.h
- src/p_spec.c 27 additions, 0 deletionssrc/p_spec.c
- src/p_spec.h 2 additions, 0 deletionssrc/p_spec.h
- src/sdl/Srb2SDL-vc10.vcxproj 1 addition, 0 deletionssrc/sdl/Srb2SDL-vc10.vcxproj
- src/sdl/Srb2SDL-vc10.vcxproj.filters 3 additions, 0 deletionssrc/sdl/Srb2SDL-vc10.vcxproj.filters
- src/win32/Srb2win-vc10.vcxproj 1 addition, 0 deletionssrc/win32/Srb2win-vc10.vcxproj
- src/win32/Srb2win-vc10.vcxproj.filters 3 additions, 0 deletionssrc/win32/Srb2win-vc10.vcxproj.filters
Loading
Please register or sign in to comment