Commit Graph

3839 Commits

Author SHA1 Message Date
helixhorned e0e3973b47 Bounds-check the tile number gotten from EVENT_GETMENUTILE.
git-svn-id: https://svn.eduke32.com/eduke32@4034 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:14 +00:00
helixhorned 8d84706dc9 Mapster32: after auto-inserting inner sector, change sectnums for sprites now in it.
(Auto-insertion of an inner sector from a loop happens either because the loop
is created in an extended sector, or because it has been punched through a
ceiling/floor into the upper/lower neighbor sector.)

git-svn-id: https://svn.eduke32.com/eduke32@4033 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:13 +00:00
helixhorned 4f699a2f21 Lunatic: update documentation a bit.
- add gv.GET, gv.WEAPON, gv.RETURN
- specify that sprite[].x/y/z and wall[].x/y are 32-bit ints
- add an example for con.longjmp()
- add an appendix listing the RETURN usage of various events

git-svn-id: https://svn.eduke32.com/eduke32@4032 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:12 +00:00
helixhorned 15bcfe3f34 Lunatic: on the Lua side, rename gv.g_RETURN to the prettier gv.RETURN.
On the C side, keep the name g_RETURN. I'm still superstitious about
dropping the "g_".

git-svn-id: https://svn.eduke32.com/eduke32@4031 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:10 +00:00
helixhorned 55a3cda9e1 Lunatic: retire gv.*_WEAPON and gv.GET_* for gv.WEAPON.* and gv.GET.*.
git-svn-id: https://svn.eduke32.com/eduke32@4030 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-23 17:01:09 +00:00
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
terminx 008334e7a9 Slightly tweak r_usetileshades 1 visibility weighting. It's still not right (and it's impossible to ever truly be right) but at least things aren't pitch black now. I considered changing r_usetileshades to default to 2, but there are some areas where mode 2 is also noticeably darker than it should be... the exit area of E1L1 is a prime example.
git-svn-id: https://svn.eduke32.com/eduke32@4028 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-20 21:49:59 +00:00
terminx e8c2250d0a Rip out all traces of nedmalloc. Sorry, XP users--it's time to upgrade to something newer than an OS from 2001 if this affects you.
git-svn-id: https://svn.eduke32.com/eduke32@4027 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-20 21:49:44 +00:00
helixhorned d09096b254 Mapster32: allow inserting point on wall line even if a sprite is highlighted.
Note: the wall line will not light up periodically, but point insertion will
be possible nontheless. A bit inconsistent, but I didn't want to do a full
analysis of which side effects allowing a sprite highlight and a line highlight
to coexist at the same time would have.

git-svn-id: https://svn.eduke32.com/eduke32@4026 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-19 19:27:02 +00:00
helixhorned e53c50e6aa LunaCON: allow a certain type error present in 1.3D GAME.CON to pass.
git-svn-id: https://svn.eduke32.com/eduke32@4025 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-19 19:26:58 +00:00
helixhorned 77dc57aee7 When building Lunatic from synthesis, tell LuaJIT to generate PE object files.
BUILD_LUNATIC, third attempt.

git-svn-id: https://svn.eduke32.com/eduke32@4023 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 21:14:37 +00:00
helixhorned 9acb219721 Lunatic: a couple of trivial changes.
git-svn-id: https://svn.eduke32.com/eduke32@4021 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 19:24:25 +00:00
helixhorned bac4265a0b For Clang debugging build, only pass selected UBSanitizer options.
This makes CLANG=1 RELEASE=0 DEBUGANYWAY=2 OPTLEVEL=1 builds definitely pretty
playable (only Polymost tested) while having a decent amount of sanitization.

git-svn-id: https://svn.eduke32.com/eduke32@4020 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-18 19:24:15 +00:00
terminx ba4cfe704c Fix issue with PIPEBOMB_CONTROL mode 2, reported at http://forums.duke4.net/topic/6721-grenade-lifetime
git-svn-id: https://svn.eduke32.com/eduke32@4019 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-17 22:48:31 +00:00
terminx 7ed85ce888 MSVC build fix. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4018 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-13 01:07:41 +00:00
helixhorned 9f280bcaf2 polymer.c: remove redundant NULL pointer check in polymer_invalidateplanelights().
Redundant for the same reason as the preceding one: the pointer has already
been dereferenced at the point the check is made. Also, all 5 calls of that
function pass a valid pointer (provided the pointers from which the expressions
are derived are valid). Reported by Stack, too.

git-svn-id: https://svn.eduke32.com/eduke32@4017 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:22 +00:00
helixhorned 171226c7ac game.c: remove dead bounds check for cheatbuf[], add assertion.
The check is dead because it is made after the fact (oob access), but the
cheat string matching logic below actually assures that
cheatbuflen < sizeof(cheatbuf) at all times.
Exposed using the Stack tool from http://css.csail.mit.edu/stack/ .
Also, in gamedef.c's definecheat handling, print the string length (19), not
the buffer length (20) if the cheat was truncated.

git-svn-id: https://svn.eduke32.com/eduke32@4016 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:20 +00:00
helixhorned 7a9e9fada4 When issuing "setrendmode" OSD command with mismatched vidmode, auto-switch.
git-svn-id: https://svn.eduke32.com/eduke32@4015 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:19 +00:00
helixhorned 4b44063853 Fix taking address out of bounds of stack'd array, introduced in r3983.
Clang's UBSan reports this as undefined behavior. I think that the reason
is as follows: C99 6.5.3.2#1 (Constraints) says:

 The operand of the unary & operator shall be either a function designator, the
 result of a [] or unary * operator, or an lvalue that designates an object that
 is not a bit-field and is not declared with the register storage-class specifier.

But in case of an expression like "&array[-1]", the operand ("array[-1]") does
not designate a valid object.

Moral: check first -- assure that an expression is valid for a particular
operation before carrying it out. Keep in mind that otherwise, the compiler
is absolutely free to optimize out the *check*.

git-svn-id: https://svn.eduke32.com/eduke32@4014 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:18 +00:00
helixhorned 2aa55e5900 baselayer.c: remove baselayer_onvideomodechange, onvideomodechange.
git-svn-id: https://svn.eduke32.com/eduke32@4013 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:16 +00:00
helixhorned f7181722cc Mapster32/non-Lua: don't keep tags used for TROR nextwalls when c&p-ing sector.
Again, in case a bunch is discarded. The tags would appear as really tagging
the walls instead of being "hidden".

git-svn-id: https://svn.eduke32.com/eduke32@4012 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:15 +00:00
helixhorned d87da2c836 Mapster32/Lunatic: clear bunchnum and TROR nextwalls when c&p-ing sectors.
That is, if a bunch is discarded when copying a sector to the clipboard.
(This happens if not all sectors that are part of the bunch are copied.)

git-svn-id: https://svn.eduke32.com/eduke32@4011 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:13 +00:00
helixhorned 47e9e0be3c Polymost: fix my r_usetileshades==2 sub-method.
Don't touch TerminX's r_usetileshades==1 or it being the default.

git-svn-id: https://svn.eduke32.com/eduke32@4010 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:12 +00:00
helixhorned 41793193f5 checkdefs.sh: check first and second args, handle definelevelname.
git-svn-id: https://svn.eduke32.com/eduke32@4009 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:11 +00:00
helixhorned d095ebf9b2 net.c: move a necessary bound check to BEFORE the oob access happening.
Fixes the undefined behavior discussed here:
http://forums.duke4.net/topic/3857-the-crash-thread/page__view__findpost__p__152612

git-svn-id: https://svn.eduke32.com/eduke32@4008 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:10 +00:00
helixhorned ae65ba0013 Mapster32: Clean up "show height indicators" mode.
- For setting 1, don't draw them for red walls whose sector floors have equal
  height.
- Make setting 1 the default, because I consider drawing them for such walls
  (and white walls) noise (as opposed to information). The "verbose" setting 2
  is still available.

git-svn-id: https://svn.eduke32.com/eduke32@4007 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-12 15:18:05 +00:00
helixhorned ff05fb9b5c Retire MultiPsky_TileToIdx() in favor of engine-side getpskyidx().
DONT_BUILD, because there have been no significant changes of the non-Lua build.

git-svn-id: https://svn.eduke32.com/eduke32@4006 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:51 +00:00
helixhorned af243f1cd6 Lunatic util: add foreachmap module 'plax', looking for maps w/ multiple psky tiles.
In foreachmap.lua, make init() be able to return a start index for cmdline args,
for the case where the run worker script wants to handle options, for example.

git-svn-id: https://svn.eduke32.com/eduke32@4005 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:50 +00:00
helixhorned b6ea2a5c53 Lunatic: sync defs.ilua's user_defs with r3993, adding member MasterVolume.
git-svn-id: https://svn.eduke32.com/eduke32@4004 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:48 +00:00
helixhorned ee61ede092 Lunatic: add LuaJIT's jit/bcsave.lua and headers for synthesis build preparation.
git-svn-id: https://svn.eduke32.com/eduke32@4001 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:45 +00:00
helixhorned e947f1fe87 Lunatic: prepare Makefiles for synthesis build.
- libs and headers are expected in platform/Windows/* (not there yet)
- prefix Lua #includes with luajit-2.0/
- build bytecode objects with absolute path name (used for debug info)

git-svn-id: https://svn.eduke32.com/eduke32@4000 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-11 15:28:42 +00:00
terminx bf2c96c9a2 Fix keyboard layout issue reported at http://forums.duke4.net/topic/6683-eduke32-forces-my-keyboard-to-us-layout-rather-than-uk
git-svn-id: https://svn.eduke32.com/eduke32@3998 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-10 23:09:14 +00:00
terminx f2e5b77104 Enable ATI FBO color attachment workaround for Intel as well. Fixes some HD4000 issues.
git-svn-id: https://svn.eduke32.com/eduke32@3997 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-07 14:29:22 +00:00
terminx c9f43383a7 Fix net.h, dunno why MSVC accepts functions that don't match their prototypes without complaining... :p
git-svn-id: https://svn.eduke32.com/eduke32@3996 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-07 14:29:10 +00:00
terminx af287cf452 Revert "Silence FBO initialization failure message on Intel HD 4000 by moving the glCheckFramebufferStatusEXT() call to below the glBindFramebufferEXT() call. The error returned on HD 4000 previously was something to do with the framebuffer being incomplete, and this seems to fix it, so hopefully it's right."
This reverts commit 9a2617eb263e53a348e10c82bf1ba58feed65afc.

git-svn-id: https://svn.eduke32.com/eduke32@3995 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-07 00:56:37 +00:00
terminx 67d786f48f Factor some duplicate code into Net_SpawnPlayer(), adjust Net_ExtractPlayerUpdate() a bit.
git-svn-id: https://svn.eduke32.com/eduke32@3994 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:54:09 +00:00
terminx 3391de39be Implement a master volume control that functions separately from the sound effect and music volume controls. This is important because it allows waveform based music (like the SC-55 music pack, etc.) to play back at a louder volume than the sound effects if the end user so desires.
git-svn-id: https://svn.eduke32.com/eduke32@3993 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:55 +00:00
terminx e83927c2f8 Refactor projectiles a bit. Tested with all of the original weapons and with the weapons in the Duke 64 mod.
git-svn-id: https://svn.eduke32.com/eduke32@3992 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:34 +00:00
terminx 1d2a6bc9df Silence a MSVC warning
git-svn-id: https://svn.eduke32.com/eduke32@3991 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:21 +00:00
terminx 43414456a4 Add support for listing symbols of a specified prefix to the "listsymbols" console command
git-svn-id: https://svn.eduke32.com/eduke32@3990 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:12 +00:00
terminx c41efa2a09 Bring GROWSPARK a bit more in line with the other hard-coded hitscan projectiles, and give it the same sort of accuracy adjustment as the pistol gets when autoaim is disabled.
git-svn-id: https://svn.eduke32.com/eduke32@3989 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:53:00 +00:00
terminx af2e9e8cf1 Update ud.config.LastUpdateCheck even when G_GetVersionFromWebsite() fails. SourceForge was down today and it irritated me.
git-svn-id: https://svn.eduke32.com/eduke32@3988 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:49 +00:00
terminx 4a02ec7e9b Update win_printversion() to handle Windows 8.1/Server 2012 R2.
git-svn-id: https://svn.eduke32.com/eduke32@3987 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:39 +00:00
terminx 6ae675347b Fix http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__164747 (mikesnd error)
git-svn-id: https://svn.eduke32.com/eduke32@3986 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:27 +00:00
terminx f368bc1a03 Silence FBO initialization failure message on Intel HD 4000 by moving the glCheckFramebufferStatusEXT() call to below the glBindFramebufferEXT() call. The error returned on HD 4000 previously was something to do with the framebuffer being incomplete, and this seems to fix it, so hopefully it's right.
git-svn-id: https://svn.eduke32.com/eduke32@3985 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:16 +00:00
terminx b6ee86a8f3 Bump MAXSYMBOLS to 512. This was probably the cause for the savestate and restorestate debug commands not being registered with the OSD at startup.
git-svn-id: https://svn.eduke32.com/eduke32@3984 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:52:04 +00:00
terminx c34410b7ed Fix up a couple of functions to adhere better to unwritten code formatting standards. Should be zero functional changes in terms of what the functions actually do.
git-svn-id: https://svn.eduke32.com/eduke32@3983 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:51 +00:00
terminx a97c8c1bfd Revert "Polymost "use tile shades": don't confound shade and visibility." Temporarily add a r_usetileshades 2 to switch between Helixhorned and myself's ideas of how this should work.
git-svn-id: https://svn.eduke32.com/eduke32@3982 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:38 +00:00
terminx c06e4262da Move CONTROL_ProcessBinds() to CONTROL_GetInput(). I don't think this breaks anything; if it does, revert it!
git-svn-id: https://svn.eduke32.com/eduke32@3981 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:25 +00:00
terminx 17ba063736 Fix a weird problem where the arrow keys would sometimes send a shift keypress on Windows, manifesting in odd things like inconsistent turning speeds when using the keyboard, the grid helper lines showing up in Mapster32 when they weren't supposed to, etc. For some reason, an extra raw input keyboard event is generated with an out of bounds VKey value (0xFF) which must be filtered for proper operation. I wasn't able to find any official documentation regarding this but I did find it mentioned in a couple of random newsgroup/forum postings.
git-svn-id: https://svn.eduke32.com/eduke32@3980 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-06 23:51:10 +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 57822a2481 Polymer: slightly more complete handling of (multi-tile) ART skies.
- Use the proper tile sequence when multiple pskies are present in a map.
  However, there's still only *one* psky chosen at map load time.
- Handle three horizfrac cases:
 * 0, psky always at same level wrt screen
 * 65536, psky horiz follows camera horiz (e.g. E4L9)
 * otherwise, fall back to default hard-coded parallax implemented as an
   angle fraction

git-svn-id: https://svn.eduke32.com/eduke32@3977 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:49 +00:00
helixhorned a374a401be Clean up parallaxed sky functionality, part 2.
- Rename sky_t members: yscale -> horizfrac, bits -> lognumtiles.
- Add default sky (8 tiles, horizfrac=32768 (i.e. 1/2 the scene horiz), offsets
  all zero) and CLOUDYOCEAN sky (8 tiles, horizfrac=65536, offsets all zero)
  to multipsky[].
- Get rid of "psky_t g_psky", merely maintaining a g_pskyidx instead. Set it up
  at map load time so as to keep the behavior of the legacy per-map psky:
  the last sector index with a matching psky ceiling wins.
- In mapstate_t, save g_pskyidx too, not (former) pskybits and pskyoffs[].
- Make on-map-load global psky setup consistent for the game and editor by
  factoring it out into common.c: G_SetupGlobalPsky().
- Remove a couple of useless initializations, add some static assertions.

This commit is more likely to introduce subtle differences in behavior.
Specifically, getpsky() now always returns the default sky properties instead of
the global sky ones (but with all-zero offsets) when no match for a suiting
multi-psky is found. This is only likely to affect the yscale/horizfrac of
non-multi-pskies when a global non-default multi-psky has been set up.
Bump BYTEVERSION again.

git-svn-id: https://svn.eduke32.com/eduke32@3976 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:48 +00:00
helixhorned 46e8549b5e Clean up parallaxed sky functionality, part 1.
- Consolidate psky* arrays into a "typedef struct psky_t" "g_psky" and
  "multipsky[]".
- Factor out getting parallaxed sky properties into getpsky().
- Condense initial multi-psky setup by memcpy'ing from multipsky[].
- New function: MultiPsky_TileToIdx().
- Add new define PSKYOFF_MAX and related consistency-checking assertions.
- Lower MAXPSKYTILES to 8 to reflect current usage (was 256).
- Game: make multi-pskies consider dynamically-remapped MOONSKY1, BIGORBIT1
  and LA. (Not very useful as the editor will still only act for the static
  values -- 80, 84 and 89, respectively.)

An attempt has been made to preserve behavior even in strange cases, so this
commit is unlikely to introduce regressions. Because of point 6, BYTEVERSION
had to be bumped.

git-svn-id: https://svn.eduke32.com/eduke32@3975 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:45 +00:00
helixhorned 97dce0fe63 Lunatic: sanity-check some arguments passed to con.action().
git-svn-id: https://svn.eduke32.com/eduke32@3974 1a8010ca-5511-0410-912e-c29ae57300e0
2013-08-04 20:37:40 +00:00
hendricks266 af9a451f02 Updates to the processing of the tilefromtexture def command:
- Allow xoffset and yoffset to modified independently of a tile definition, much like texhitscan and nofullbright.
(Both still default to zero when a tile is specified, to keep current behavior, and because it makes sense.)
- Add actual detection of the "nofullbright" keyword, which appears to have been overlooked in r3230.
- Internal: Eliminate the need for one int32_t by condensing two variables into "flags".

git-svn-id: https://svn.eduke32.com/eduke32@3973 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:37:10 +00:00
hendricks266 62cdb8a9e6 Patch from johnnyonflame to fix the GCW and Dingoo build process.
git-svn-id: https://svn.eduke32.com/eduke32@3972 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:54 +00:00
hendricks266 e58035b51c Force orientation bit 2 for screentext in addition to qstrdim, to match all other screen drawing commands.
git-svn-id: https://svn.eduke32.com/eduke32@3971 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:28 +00:00
helixhorned 262acc7ab3 Lunatic: Add pre-compiled LPeg 0.12 for 32-bit Windows (MinGW).
git-svn-id: https://svn.eduke32.com/eduke32@3970 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:13 +00:00
helixhorned 9bbc5c52de Lunatic: rename test.elua to test.lua.
The old extension is an artifact from when I was thought that extensions
should label whether a Lunatic module is to be used in internal/external
contexts.
Also, change test.lua slightly and commit a little updated documentation.

git-svn-id: https://svn.eduke32.com/eduke32@3969 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:10 +00:00
helixhorned f4d74e4df8 Lose the 'packed' attribute on actor_t.
Its members are already laid out on the natural alignment boundaries.
Compilation tested with {32-bit, 64-bit} x {Lunatic, non-Lua} builds.

git-svn-id: https://svn.eduke32.com/eduke32@3968 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:08 +00:00
helixhorned a942a8f660 Lunatic: protect global environment.
git-svn-id: https://svn.eduke32.com/eduke32@3967 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:07 +00:00
helixhorned 7860fb8c01 Lunatic: remove DBG_ variable for _DEBUG_LUNATIC=0.
git-svn-id: https://svn.eduke32.com/eduke32@3966 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:06 +00:00
helixhorned ac3a6a1bd2 Lunatic: fix some must-fail tests and module()s without require'end_gamevars'.
git-svn-id: https://svn.eduke32.com/eduke32@3965 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-19 12:49:05 +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 4872adb3c8 Makefile.common: disable -Wstrict-overflow.
It didn't turn out that useful and was giving a warning with one of the
preceding changes.

git-svn-id: https://svn.eduke32.com/eduke32@3963 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:16 +00:00
helixhorned 2945a966e1 Polymer/ART mapping: fix formula for globalvisibility.
Also, very slightly tweak a factor toward a "brighter" (farther visible)
scene overall to account for the "circular" nature of the fragment distance
(as opposed to an "ortho" distance in Build).

git-svn-id: https://svn.eduke32.com/eduke32@3962 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:15 +00:00
helixhorned 4f88aaf4d2 Retire global 'lastvisinc'.
It was only ever used as upper bound to the time that a visibility change
decays, but since it does that in an exponential fashion, there's really
no point.

git-svn-id: https://svn.eduke32.com/eduke32@3961 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:13 +00:00
helixhorned 19b85dc5ee Make vis decay with time independent of FPS, treat p->visibility<0 like 0.
Now, if p->visibility differs from the constant visibility, the former converges
toward the latter by three-quartering the difference each second totalclock
increment (1/60th second).
Negative player visibilities are not handled consistently throughout the
different renderers, so make it look the same as 0 (can view to infinity).

git-svn-id: https://svn.eduke32.com/eduke32@3960 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:11 +00:00
helixhorned 66d126e9ff Polymodes: properly calc start/end fog dist for r_usenewshading=2, vis=0, shade>0
So there's no "jump" from vis!=0 to vis=0 making the texture appear brighter.

git-svn-id: https://svn.eduke32.com/eduke32@3959 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-18 18:08:10 +00:00
helixhorned ec2514a91d Apply patch by forum user "John Jendro" fixing OS X build.
git-svn-id: https://svn.eduke32.com/eduke32@3958 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:06 +00:00
helixhorned 8c9f0b740d Makefile.common: make LUNATIC be set to 0 if not set from env ("?=0").
Also override LTO to 0 in Lunatic builds.

git-svn-id: https://svn.eduke32.com/eduke32@3957 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:05 +00:00
helixhorned e7e8f00670 Lunatic: document previous additions and more of the existing stuff.
git-svn-id: https://svn.eduke32.com/eduke32@3956 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:04 +00:00
helixhorned d63939d820 Clean up some player.c code.
git-svn-id: https://svn.eduke32.com/eduke32@3955 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:05:01 +00:00
helixhorned 9ecbd633aa Lunatic: rework weapondata_t __newindex handling for the sound members.
Also, in test.elua, add a currently failing must-fail test (i.e. it wrongly
succeeds where it should not!).

git-svn-id: https://svn.eduke32.com/eduke32@3954 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:59 +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 b9dfcc902d game.c: read sprites-on-screen count for DNDEBUG at end of G_DoSpriteAnimations.
Because that function might have inserted tsprites itself, e.g. for the fake
floor shadow. Also add one "spritesortcnt < MAXSPRITESONSCREEN" bound check
in legacy ROR code.

git-svn-id: https://svn.eduke32.com/eduke32@3952 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:55 +00:00
helixhorned 36c03b8610 Lunatic: create game Lua state just before EVENT_NEWGAME, not in G_EnterLevel().
git-svn-id: https://svn.eduke32.com/eduke32@3951 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:53 +00:00
helixhorned d7e4d5afbf Factor out repeated few-liner into G_NewGame_EnterLevel(), misc. cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@3950 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:52 +00:00
helixhorned adbd6394fc LunaCON: add -ftrapv, -fwrapv opts, providing trapping/wrapping arith semantics.
Currently only for multiplication.

git-svn-id: https://svn.eduke32.com/eduke32@3949 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:50 +00:00
helixhorned 75204d782a Lunatic: call G_ShowView() using the Lua C API and not through the FFI.
G_ShowView() may call events. Ouch!

git-svn-id: https://svn.eduke32.com/eduke32@3948 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:49 +00:00
helixhorned e76348cc4b In DNCOORDS display, show execution time in ms for all actors (G_MoveActors).
Smoothed using an exponential moving average... with a time constant of 1 sec
if I didn't miscalculate things. Also, split BYTEVERSION_JF into Lunatic and
non-Lua.

git-svn-id: https://svn.eduke32.com/eduke32@3947 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:47 +00:00
helixhorned b243264d6b Lunatic: output timing results to CSV file, don't time unreg'd events/actors.
The base name is taken from the environment variable LUNATIC_TIMING_BASEFN,
which is suffixed with .actors.csv and .events.csv.

git-svn-id: https://svn.eduke32.com/eduke32@3946 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:45 +00:00
helixhorned e13cae69ce LunaCON: add forgotted "screensound" to keyword list in con_lang.lua.
Also, fix 'spriteflags' directive.

git-svn-id: https://svn.eduke32.com/eduke32@3945 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:43 +00:00
helixhorned b70779ba6f CON: Add predefined labels MAXSPRITES, MAXSTATUS and MAX_WEAPONS.
git-svn-id: https://svn.eduke32.com/eduke32@3944 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:41 +00:00
helixhorned e4849af91f LunaCON: implement 'tossweapon'.
git-svn-id: https://svn.eduke32.com/eduke32@3943 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-13 21:04:38 +00:00
helixhorned d53b976acf Lunatic: document more stuff (not too carefully), add red DRAFT marker.
git-svn-id: https://svn.eduke32.com/eduke32@3942 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:46 +00:00
helixhorned 3a0f2de877 Polymost "use tile shades": don't confound shade and visibility.
That is, for shade of objects, use shade tables. For visibility, use GL fog.
Mixing these two does not produce satisfactory results in areas where both
shade and visibility darkening are high, such as around the E1L1 restroom.

git-svn-id: https://svn.eduke32.com/eduke32@3941 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:44 +00:00
helixhorned 5e41c1604c LunaCON: handle system gamearrays for some array commands.
- 'copy' may have them as source, 'getarraysize' works fine
- 'setarray' and 'resizearray' are obviously forbidden
- 'readarrayfromfile' and 'writearrayfromfile' is not implemented for them
  (use case?)

Also, in the Makefile: don't use realpath on directories. It may give an empty
string.

git-svn-id: https://svn.eduke32.com/eduke32@3940 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:43 +00:00
helixhorned 1e26e640e4 Lunatic: swap first and second arg of con.spawn().
git-svn-id: https://svn.eduke32.com/eduke32@3939 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-09 18:23:41 +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 c243bab0e7 Remove one instance of duplicate code lines and now unused TSPR_MIRROR.
git-svn-id: https://svn.eduke32.com/eduke32@3936 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:07 +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 76a04c4a3a In Windows and SDL layers, rename *hitick* to *u64tick*.
git-svn-id: https://svn.eduke32.com/eduke32@3934 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:59:00 +00:00
helixhorned f37d845f02 Lunatic: various unrelated changes and more documentation.
- check map-text version on load
- LunaCON: don't allow (back)slash as identifier char
- LunaCON stand-alone: don't resort to default directory for root file names
- document non-local control flow functions and for LunaCON, ambigious lexical
  elements

git-svn-id: https://svn.eduke32.com/eduke32@3933 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-07 20:58:57 +00:00
helixhorned 6e443944c3 Lunatic: partially fix LTO=1 build with GCC.
Having to tag these few variables and functions as ATTRIBUTE((used))
seems sensible, but what follows is just strange. OSD_Printf? headspritesect?

git-svn-id: https://svn.eduke32.com/eduke32@3932 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:53 +00:00
helixhorned baebd63bac Lunatic: make g_playerWeapon an array of a corresponding bcarray type.
git-svn-id: https://svn.eduke32.com/eduke32@3931 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:50 +00:00
helixhorned 4c4cf5eecc Lunatic: document the additions of the preceding commits.
git-svn-id: https://svn.eduke32.com/eduke32@3930 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:48 +00:00
helixhorned 7c3f7909cc Lunatic: various changes.
- swap 2d and 3rd args in xmath.rotate() -- now rotate(point, ang, pivot)
- add vec3 method 'rotate', calling xmath.rotate
- store game tic count in savegames

git-svn-id: https://svn.eduke32.com/eduke32@3929 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-04 19:38:46 +00:00