Commit Graph

68 Commits

Author SHA1 Message Date
helixhorned 26df580dac Lunatic: rewrite bitar to use arrays of int32, more convenience ops.
git-svn-id: https://svn.eduke32.com/eduke32@2872 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-10 19:11:43 +00:00
helixhorned 761c2d1c84 Lunatic: reflect the preceding rename in the sources.
git-svn-id: https://svn.eduke32.com/eduke32@2871 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-08 19:32:45 +00:00
helixhorned 00e99b2207 Rename a certain file to appease Windows file systems.
git-svn-id: https://svn.eduke32.com/eduke32@2870 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-08 19:32:40 +00:00
helixhorned 7f4eb4f5c3 Lunatic: implement a couple more 1.5 commands.
git-svn-id: https://svn.eduke32.com/eduke32@2869 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-08 19:32:35 +00:00
helixhorned f3970f9ac7 Lunatic: clean up handing of ac/mv internally, add control module.
git-svn-id: https://svn.eduke32.com/eduke32@2864 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:29 +00:00
helixhorned b983ec7b49 Lunatic: cleanup
git-svn-id: https://svn.eduke32.com/eduke32@2863 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-06 20:00:23 +00:00
helixhorned f4c7e3f77e Lunatic: 'bitar': rewrite ops for colon syntax, serialization, set ops.
git-svn-id: https://svn.eduke32.com/eduke32@2862 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:44 +00:00
helixhorned 86a3603edd Lunatic: fix hex literal parsing on Windows, add two comments.
git-svn-id: https://svn.eduke32.com/eduke32@2859 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:35 +00:00
helixhorned a00f411b3b Lunatic: add 'stat' module for running statistics.
Also, rewrite the mapastats iterator and the LIZTROOP hitscan timing
in terms of that.

git-svn-id: https://svn.eduke32.com/eduke32@2858 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:32 +00:00
helixhorned fdfcca557b Lunatic: add 'randgen' module, implementing an encapsulated JKISS PRNG.
Also fix error handling path in our_require(), i.e. when loadstring fails.

git-svn-id: https://svn.eduke32.com/eduke32@2857 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:28 +00:00
helixhorned e7d3dcba78 gethitickms(): replace division by multiplication.
git-svn-id: https://svn.eduke32.com/eduke32@2856 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:25 +00:00
helixhorned 69365f2a0b Lunatic: add 'geom' module, sporting a vec2 type and a general 'intersect' func.
git-svn-id: https://svn.eduke32.com/eduke32@2855 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:21 +00:00
helixhorned defe79216d Lunatic: update DukePlayer_t, fix build.
git-svn-id: https://svn.eduke32.com/eduke32@2854 1a8010ca-5511-0410-912e-c29ae57300e0
2012-08-02 10:52:17 +00:00
helixhorned 0e6c83bb1b Lunatic: build fix on Windows and translator fix with 32-bit archs?
erratum in r2844 commit message:
ydim vs. bytesperline --> xdim vs. bytesperline

git-svn-id: https://svn.eduke32.com/eduke32@2849 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-25 18:56:18 +00:00
helixhorned b47c18518f Lunatic: time every event and actor call and print summary at game exit.
git-svn-id: https://svn.eduke32.com/eduke32@2842 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:44 +00:00
helixhorned 528ccbca4a Lunatic: add "bit array" helper module, rewrite the bit test in terms of that.
git-svn-id: https://svn.eduke32.com/eduke32@2841 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:40 +00:00
helixhorned 3c5e36feb4 Lunatic: protect user modules from tampering, too.
git-svn-id: https://svn.eduke32.com/eduke32@2840 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:37 +00:00
helixhorned ee9991adbd Lunatic: more bitop profiling; make undeclared-var reads forbidden in modules
git-svn-id: https://svn.eduke32.com/eduke32@2839 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:34 +00:00
helixhorned 1ffab1bf1a Lunatic: override 'error' so that a string is always returned to C.
git-svn-id: https://svn.eduke32.com/eduke32@2838 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:31 +00:00
helixhorned 55d474990f Lunatic: module(), require() for custom modules, bit op test from LJ homepage.
git-svn-id: https://svn.eduke32.com/eduke32@2837 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-20 21:57:28 +00:00
helixhorned cd1401fb52 Lunatic: extend must-fail tests with a check for the expected error messages.
git-svn-id: https://svn.eduke32.com/eduke32@2829 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:40 +00:00
helixhorned 91b7a10bd0 Lunatic: overridden 'require', currently for base modules only.
git-svn-id: https://svn.eduke32.com/eduke32@2828 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:38 +00:00
helixhorned b86dbc0818 Lunatic: make baselib functions used in defs.c local, be more disciplined with stack.
Also, print a backtrace if we return to C with an error.

git-svn-id: https://svn.eduke32.com/eduke32@2827 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-13 18:20:35 +00:00
helixhorned 3697842bc5 Add ART loader for the LuaJIT BUILD struct loader module, 2 more examples.
The map iterator now has init/finish capability, making it possible to
write scripts that aggregate data over multiple map files.  One such example
calculates some statistics, the other loads art metadata and looks for
red walls with non-pow2 ysize tiles.

git-svn-id: https://svn.eduke32.com/eduke32@2814 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:11 +00:00
helixhorned 6b0f6176f6 Add LuaJIT-based BUILD map loader and batch processing script + example.
git-svn-id: https://svn.eduke32.com/eduke32@2813 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-08 21:47:06 +00:00
helixhorned 10de03aa7d Lunatic translator: a first codegen ansatz.
git-svn-id: https://svn.eduke32.com/eduke32@2792 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:17 +00:00
helixhorned 54721d7461 Make ksqrt take uint32_t, add helper function uint32_t uhypsq(int32_t,int32_t).
uhypsq calculates the hypotenuse using unsigned multiplication. This is
permissible since for arbitrary int32s a and b, the following holds in
two's complement arithmetic:
  (int32_t)((uint32_t)a * b) == (int32_t)((int64_t)a * b)
("Signed and unsigned multiplication is the same on the bit level.")

This fixes various overflows where wall lengths for walls of length > 46340
are calculated, but does not rid us of other overflows in the same vein
(usually dot products between vectors where one point is a wall vertex and
the other a position in a sector).

git-svn-id: https://svn.eduke32.com/eduke32@2791 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:14 +00:00
helixhorned 9431207c74 Lunatic: ksqrt, with timing and value test.
The latter shows that "int32_t ksqrt(int32_t)" also copes with values in the
range INT32_MIN..-1, effectively interpreting them as uint32_t (i.e. adding
2**32).  However, this should not be relied on from CON.

git-svn-id: https://svn.eduke32.com/eduke32@2790 1a8010ca-5511-0410-912e-c29ae57300e0
2012-07-01 22:11:07 +00:00
helixhorned 2d324c97be Lunatic: safety tweaks, expose more stuff
Arrays inside structs must not be accessible, since they're not bound-checked
by the FFI. Therefore, we flatten them into repeated scalar fields and need
to write accessor functions later.

git-svn-id: https://svn.eduke32.com/eduke32@2786 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-26 19:49:59 +00:00
helixhorned ff9cae033a Lunatic: various stuff
- hitscan & related types and constants
- profiling with gethitickms
- translator: eval the opening parts of block commands early
- fix getbunch

git-svn-id: https://svn.eduke32.com/eduke32@2779 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-22 21:40:01 +00:00
helixhorned cbb71c088a Lunatic translator: ai/move/action.
This exposes some problems in the default/in-the-wild CONs. As usual,
we'll have to retrofit sensible semantics :rolleyes:.

git-svn-id: https://svn.eduke32.com/eduke32@2765 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:43 +00:00
helixhorned 23e43886a8 Lunatic translator: define* et al
git-svn-id: https://svn.eduke32.com/eduke32@2764 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:41 +00:00
helixhorned 67dabd84f8 Lunatic t.: handle prefix-problematic commands for real, definelevelname, ...
git-svn-id: https://svn.eduke32.com/eduke32@2763 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:37 +00:00
helixhorned 5bdbd2eda5 Lunatic/LT: provide the predefined labels in con_lang, add "strict" from luajit.
The latter is only for development, since the embedded version already has a
undeclared-var-reference handling similar to that.  Also fix parm2memberpat.

git-svn-id: https://svn.eduke32.com/eduke32@2762 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-17 19:45:33 +00:00
helixhorned f2789ab90f Lunatic translator: fix dangling else and add a test file, tweak warnings
git-svn-id: https://svn.eduke32.com/eduke32@2756 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-13 23:13:26 +00:00
helixhorned c2c8b00a78 Lunatic translator: define, include, fix "music" parsing, ...
git-svn-id: https://svn.eduke32.com/eduke32@2749 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:21 +00:00
helixhorned 5531888c8b Lunatic: take a stab at semantic actions; tweaks
git-svn-id: https://svn.eduke32.com/eduke32@2748 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:18 +00:00
helixhorned 59df76f0b6 Lunatic: actors
git-svn-id: https://svn.eduke32.com/eduke32@2747 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:15 +00:00
helixhorned 90b169d8c8 Lunatic: in event interface, pass actor, player, dist.
git-svn-id: https://svn.eduke32.com/eduke32@2746 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-10 18:56:10 +00:00
hendricks266 d3a3c74112 Massive menu input control revamp/cleanup/factor. (added: input.[ch])
New Wii control defaults for the Wii Remote + Nunchuk and the Classic Controller. This includes new code added just so that the Home key brings up the menu in-game, reducing the need for a USB keyboard.

On the technical side, raw joystick access (comparable to what is available for keyboard and mouse) is now present in jmact, on the game side. (added: joystick.[ch])

Using this new raw joystick access, I replaced tueidj's hack to map A and B to LMB/RMB and D-Pad Up/Down to the scrollwheel.

I made the menus more friendly to mouse and joystick browsing by adding and unifying checks and clears for various buttons and gamefuncs. In fact, the majority of the time spent on this commit was tracking down problems that appeared with the factoring and trying to understand the menu system and the way input checks are precariously executed.

In addition, "Press any key or button to continue" now truly means what it says.

As a result of incorporating proper raw access into control.c instead of it directly accessing the implementaiton, the program *may* no longer be affected by joystick input when it is out of focus. This follows the pattern set by the mouse, and I think this is a positive change.

A small bonus: In the classic/old keyboard preset, the key for Show_Console has been changed from '`' to 'C' because '`' is taken by Quick_Kick.

git-svn-id: https://svn.eduke32.com/eduke32@2728 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 16:11:22 +00:00
helixhorned 59fa419506 Lunatic: pack actor/move parameters into t_data, which is enlarged to 14 elements.
(LUNATIC build only.)
Also, a minor problem is identified.  sizeof(actor_t) is 124 on 64-bit platforms,
while the expected size is 128 bytes.  This needs to be corrected whenever the
next savegame version bump happens.

git-svn-id: https://svn.eduke32.com/eduke32@2724 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 15:46:08 +00:00
helixhorned b3a6b0a93b Lunatic: one const char * --> char *, since we alloc/free it.
git-svn-id: https://svn.eduke32.com/eduke32@2722 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-03 15:46:02 +00:00
helixhorned fc23045675 Lunatic: fix one stack index, comment on a problem with ffi.C access.
git-svn-id: https://svn.eduke32.com/eduke32@2710 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-29 20:01:58 +00:00
hendricks266 7f920c5541 Add EVENT_LOADGAME and EVENT_SAVEGAME, self-explanatory. Also make EVENT_NEWGAME use myconnectindex for player ID instead of screenpeek.
git-svn-id: https://svn.eduke32.com/eduke32@2688 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-25 05:14:19 +00:00
helixhorned 165c569cbe Lunatic: v7 engine support, event updates
git-svn-id: https://svn.eduke32.com/eduke32@2668 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-18 12:45:52 +00:00
helixhorned 88ca3a913a Lunatic: embed lpeg and the translator into the binary
git-svn-id: https://svn.eduke32.com/eduke32@2650 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-13 16:05:16 +00:00
helixhorned ebe227ec1b Lunatic translator: better line numbering
git-svn-id: https://svn.eduke32.com/eduke32@2649 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-13 16:04:45 +00:00
helixhorned 9786e7e625 Lunatic: better initial environment setup, preventing textual repetitions
git-svn-id: https://svn.eduke32.com/eduke32@2648 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-13 16:04:28 +00:00
helixhorned 4d14fe184c Lunatic translator: a bit more syntax
git-svn-id: https://svn.eduke32.com/eduke32@2644 1a8010ca-5511-0410-912e-c29ae57300e0
2012-05-06 20:22:56 +00:00
helixhorned f5ee6ca7eb Lunatic translator: nearing syntax completion while treading in murky waters.
- bump lpeg stack limit to 1024 (hack) for long if/if/if...else chains
- lexical: newline, EOF and whitespace; "bad" identifiers; hex literals,
           newline terminated strings (allow empty string)
- syntax: allow nesting of array expressions, it's easier than special-casing;
          handle issues with structs expecting parm2 (hackish); userdef;
          switch/case/default
- fix parsing some commands; mind prefixes!
- frontend: if failing match, print last keyword and its position; warn on
  "bad" identifiers (one per such); batch processing from command line
- Files that locate finds from my linux box now pass (except where there are
  really syntax errors).

git-svn-id: https://svn.eduke32.com/eduke32@2616 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-29 20:54:06 +00:00