Commit Graph

84 Commits

Author SHA1 Message Date
helixhorned 0a06ca29f2 Lunatic: fix passing some string members to con.action(), rewrite conststruct().
... by creating a struct with 'static const int' members, as recommended on
http://www.freelists.org/post/luajit/Performance-implications-of-large-FFI-constants,4

git-svn-id: https://svn.eduke32.com/eduke32@4029 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:04 +00:00
helixhorned b5c5513924 Lunatic: disable printing debug messages for the preview build. BUILD_LUNATIC.
git-svn-id: https://svn.eduke32.com/eduke32@3979 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:51 +00:00
helixhorned 3835019c70 Lunatic: replace 'idx >= BOUND+0ULL' idiom with 'not (idx >= 0 and idx < BOUND)'
git-svn-id: https://svn.eduke32.com/eduke32@3964 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:02 +00:00
helixhorned d7ad2c36d4 Lunatic: revamp sector changing/updating functions of sprites.
git-svn-id: https://svn.eduke32.com/eduke32@3953 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:57 +00:00
helixhorned 750fbb0a0e Lunatic: slight Makefile tweak for Windows preparation.
Add doc/how_to_build_lunatic.txt and doc/lpeg-lunatic.patch.

git-svn-id: https://svn.eduke32.com/eduke32@3938 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:14 +00:00
helixhorned 7f2175fcec Lunatic: retire per-sprite tsprite access for per-tile animation callback reg.
Don't yet make this official API though, since there are unresolved issues
with newly created tsprites potentially being fed back to the animation loop.
Add xmath.angvec(), xmath.bangvec(), tspr:set_sectnum(), tspr:setpos().

git-svn-id: https://svn.eduke32.com/eduke32@3937 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:10 +00:00
helixhorned f506e0f570 Rename the external 'gethitickms()' to 'gethiticks()'.
git-svn-id: https://svn.eduke32.com/eduke32@3935 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:05 +00:00
helixhorned d580c1e998 Lunatic: many changes, motivated by writing test "helixspawner".
- some renames of functions/methods
- con.actorvar: explicitly allow (for now) boolean and number values
- added gv.gametic, player.holdskey(), player.all(), actor.check*()/hit*(),
  gv.rendmode, gv.REND, <bitint>:mask(), spr:getheightofs()
- make read of nil var in "finalized" (live) module produce error, too
- add test/helixspawner.lua

git-svn-id: https://svn.eduke32.com/eduke32@3928 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:42 +00:00
helixhorned cb2edcf45e Lunatic: in con.action and con.move, allow mixed number/string key tables.
E.g. con.action{0, 4, delay=20}; for convenience, viewtype and incval are
initialized to 1 (not 0) here.

git-svn-id: https://svn.eduke32.com/eduke32@3923 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:54 +00:00
helixhorned e164bd7f1e Actor-related code cleanup part 2: give actor t_data[] indexes names.
Using macros like AC_COUNT(t). Clean up related code:
 - comment out the dead condition noted in the previous commit
 - Lunatic: use get_count() instead of get_t_data(0) in one place,
   rename to _get_t_data(), i.e. make that method internal

git-svn-id: https://svn.eduke32.com/eduke32@3920 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:48 +00:00
helixhorned fb0c13f9f2 Lunatic: serialization for cdata types, currently xmath.vec3 and ivec3.
git-svn-id: https://svn.eduke32.com/eduke32@3914 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-30 20:38:35 +00:00
helixhorned 5ea2eee072 Lunatic: merge updatesector and ~breadth, making the former accept a flag.
git-svn-id: https://svn.eduke32.com/eduke32@3910 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:43 +00:00
helixhorned 885036a6a3 Lunatic: retire 'geom' module, putting vector types into xmath.
git-svn-id: https://svn.eduke32.com/eduke32@3909 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-28 14:07:41 +00:00
helixhorned db7f820404 engine: consider a point inside() a sector in all border cases (literally).
In other words, for a test rectangular sector, a sprite would be inside the
sector in on all 4 edges and all 4 corners. Previously, it would have been
the lower right portion only (*excluding* LL and UR corners), which led to
map editing issues.

git-svn-id: https://svn.eduke32.com/eduke32@3898 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-22 11:31:16 +00:00
helixhorned e2859cd133 Lunatic: write more documentation, handle randomangle movflag in a:set_move().
git-svn-id: https://svn.eduke32.com/eduke32@3887 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-15 12:52:06 +00:00
helixhorned 9c1eeae751 Lunatic: clean up 'geom' module, make walls readable with pseudo-member 'z'.
git-svn-id: https://svn.eduke32.com/eduke32@3875 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:56 +00:00
helixhorned 9911e96fe8 Lunatic: rename spriteext[].*off->mdoff.*, actor[].actorstayput->stayputsect.
git-svn-id: https://svn.eduke32.com/eduke32@3874 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-12 17:49:55 +00:00
helixhorned dee8dbe092 Lunatic: rename bitint members to *bits instead of *x.
git-svn-id: https://svn.eduke32.com/eduke32@3864 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-09 16:37:13 +00:00
helixhorned f8c04673b4 Lunatic: tweak sector.STAT.* and other names a little.
git-svn-id: https://svn.eduke32.com/eduke32@3851 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-06 11:22:35 +00:00
helixhorned 185597d3b3 LunaCON: proper handling of dynamic remappings with weapon defaults.
That is, the gamevars named WEAPONx_* in CON will now have the remapped value
if they were not overridden from CON ('gamevar' at file scope).
For C-CON, everything except signaling an override from the CON parser is in
place.

git-svn-id: https://svn.eduke32.com/eduke32@3848 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-02 14:07:56 +00:00
helixhorned 882eb4cb8b LunaCON: hook up dynamicsoundremap.
git-svn-id: https://svn.eduke32.com/eduke32@3847 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-02 14:07:52 +00:00
helixhorned 75313a78c8 Lunatic: sector[].ceiling/.floor gets a reference to a ceiling-or-floor struct.
Also, make sector[].*stat a bitint type.

Now, a piece of code could look like this:
local sec = sector[i]
local ceil = sec.ceiling
ceil.statx:flip(sector.STAT.SMOOSH)

git-svn-id: https://svn.eduke32.com/eduke32@3844 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 20:09:43 +00:00
helixhorned 6f94af7399 LunaCON: implement dragpoint, clipmove*; fix gamearray serialization.
git-svn-id: https://svn.eduke32.com/eduke32@3812 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-24 13:54:37 +00:00
helixhorned e9844d2e51 Lunatic: reading of map-text prototype.
Also fixes a couple of oversights (introduced) with the saving.

git-svn-id: https://svn.eduke32.com/eduke32@3736 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:42 +00:00
helixhorned 34af7e6353 Lunatic: move readintostr() into defs_common.lua, fix an oversight.
git-svn-id: https://svn.eduke32.com/eduke32@3734 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:35 +00:00
helixhorned 3b65dc3a78 Lunatic: first prototype of map-text saving.
git-svn-id: https://svn.eduke32.com/eduke32@3733 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:34 +00:00
helixhorned 258e28bafb Map-int VX: rearrange members so that ceiling* and floor* are contiguous.
git-svn-id: https://svn.eduke32.com/eduke32@3731 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:28 +00:00
helixhorned 0dba35b207 build.lua: add .sectsperbunch to map table, useful for TROR stats w/ findmaps.sh
Also, sync MAXBUNCHES to new limit in lunatic/defs_common.lua.

git-svn-id: https://svn.eduke32.com/eduke32@3665 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:32 +00:00
helixhorned ec5cd930e0 Lunatic: fix test.elua after map-int VX and one rename, add one microbenchmark.
git-svn-id: https://svn.eduke32.com/eduke32@3664 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-12 11:59:29 +00:00
helixhorned 7b6bf4dda2 Lunatic: new-generation map format, in-memory representation ("map-int VX").
The Lunatic build compiles with new structures for sector and wall types.
They have separate members for TROR {up,down}{bunch,nextwall}, so there are
no conflicts with other uses of members into which they were previously
shoehorned.  Also, the maximum bunch limit is bumped to 512 in that build.

Currently, loading from V7/8/9 and saving to V7 and V8 are supported.

git-svn-id: https://svn.eduke32.com/eduke32@3658 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-09 17:35:11 +00:00
helixhorned bbdc035335 Lunatic: replace DukePlayer_t set-member methods with metatable magic.
So that members needing it are checked when they're assigned to using the
usual syntax. What kind of check to perform (sector, player, ... x whether
negative values are allowed) is written in a declarative fashion inside the
C declaration.

Also, make Lunatic's MAXQUOTES be C's OBITQUOTEINDEX and bound-check an
access of sprite[p->wackedbyplayer] in the C code.

git-svn-id: https://svn.eduke32.com/eduke32@3653 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:41 +00:00
helixhorned abcc98d5c1 Lunatic: access to show2dsector[], fix some permit-negative bound checks.
git-svn-id: https://svn.eduke32.com/eduke32@3650 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-07 15:20:28 +00:00
helixhorned 6ebe2d4745 Lunatic: custom integer types treated as bitfields.
Used for engine struct's (c)stat and actor[].flags members.

git-svn-id: https://svn.eduke32.com/eduke32@3643 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:10 +00:00
helixhorned 49290a090c Lunatic: make palette_t a bcarray-generated type, various tweaks.
- Increase LuaJIT max. machine code limit to 10 MiB

git-svn-id: https://svn.eduke32.com/eduke32@3641 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:03 +00:00
hendricks266 30f510d521 Add "rotatespritea" to CON and M32script.
I hope I didn't bruise Lunatic too much.

git-svn-id: https://svn.eduke32.com/eduke32@3610 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:33:03 +00:00
helixhorned 57416c541a Lunatic: add LuaJIT's 'dump' module, printing traced bytecode, IR and mcode.
git-svn-id: https://svn.eduke32.com/eduke32@3600 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:54:14 +00:00
helixhorned c5e76e73f3 Lunatic t.: don't error on changing stat/sect of sprite not in the game world.
git-svn-id: https://svn.eduke32.com/eduke32@3598 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:53:48 +00:00
helixhorned b7ea1cb205 Lunatic: in readgamearray support code, use engine file functions.
This is so that files residing in GRPs (or anywhere the engine looks for them)
can be read, too.

git-svn-id: https://svn.eduke32.com/eduke32@3594 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-24 18:52:52 +00:00
helixhorned ad55e2d424 Lunatic: make ivec3 and dvec3 types share same metatable, orthogonalize API.
Specifically, remove ivec3's blen1() method and add from/to BUILD coordinate
(z scaled by 16) conversion methods.

git-svn-id: https://svn.eduke32.com/eduke32@3591 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-21 10:20:27 +00:00
helixhorned 38ee330c93 Lunatic translator embedded: handle command line arguments.
Also, fix an error() call in control.lua:gamearray_file_common().

git-svn-id: https://svn.eduke32.com/eduke32@3572 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-17 18:11:58 +00:00
helixhorned c02199be48 Lunatic: g_tile access, rudimentary system gamearray support for the translator.
The only operation for which proper code is generated is reading a single value
from a system gamearray.

git-svn-id: https://svn.eduke32.com/eduke32@3562 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:11 +00:00
helixhorned 0173c0908a Lunatic: spritesof{stat,sect} iterators that allow deletion inside the loop.
Also,
 - an optimization for sprite[]:setpos(). Calls to get_sprite_index()
   seem to be pretty slow (at least when they're not compiled).
 - add getzrange to the dynsymlists

git-svn-id: https://svn.eduke32.com/eduke32@3560 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-15 16:56:03 +00:00
helixhorned f6d1af0532 Lunatic: replace some allocations by static data, some translator fixes.
Fix 'setsprite' and 'music'. A good timing test for actors performance is
the starfield of WGR2's E1L1 ("Nexus").

git-svn-id: https://svn.eduke32.com/eduke32@3558 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-13 10:48:23 +00:00
helixhorned deeb6306a9 Lunatic translator: fix some codegen and some commands.
git-svn-id: https://svn.eduke32.com/eduke32@3537 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:22 +00:00
helixhorned bad2da3026 Lunatic translator: in error tracebacks, show line numbers of the source file.
Instead of those of the translated code. Also some codegen tweaks and fixes.

git-svn-id: https://svn.eduke32.com/eduke32@3535 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-03 16:06:16 +00:00
helixhorned 1606c17a77 Lunatic: fixups and debugging helpers.
- add LuaJIT's 'v' module printing trace info
- translator: fix game function name definitions
- revert math.fmod -> math.modf, they are different!
- disable JIT compilation for a function we're getting strange crashes with
- Make some of DukePlayer_t's members 'bool' on the Lua side. It's way
  too easy to write something like "ps.jetpack_on" where "ps.jetpack_on~=0"
  was meant. [Background: Kyle873 observed that Duke was always floating.]
- Error out if looping in our_module(). I find this behavior more logical
  than returning true.
- fix a couple of missed FORBID variables

git-svn-id: https://svn.eduke32.com/eduke32@3530 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-28 17:30:04 +00:00
helixhorned f791b5af20 Lunatic: sector[]:zrangeat(), 'getzrange' command for the translator.
Also, fix quote commands there.

git-svn-id: https://svn.eduke32.com/eduke32@3524 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-25 15:31:13 +00:00
helixhorned b1320d0ab5 Lunatic: begin fixing up the code because it's now actually live!
git-svn-id: https://svn.eduke32.com/eduke32@3519 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-24 16:05:42 +00:00
helixhorned 185f0a8cc4 Lunatic translator: text rendering and other niceties.
git-svn-id: https://svn.eduke32.com/eduke32@3501 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:42 +00:00
helixhorned 2d61216758 Lunatic translator: sprite list commands, findnear*, protect player[].ftq.
git-svn-id: https://svn.eduke32.com/eduke32@3498 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 16:07:32 +00:00