Build 4083
SVN-
General
Fix the Classic renderer under SDL2.
SVN handles and Git names are merged into one person.
Fix the Classic renderer under SDL2.
rename hitdata_t member 'sect' to 'sector' for consistency. DONT_BUILD.
Clear GL depth buffer before drawing a frame in Polymost. This should fix the issue with skies in the Duke64 TC.
in model preprocessing, implement cos/sin by table lookup.
This reduces the proportion of time the trig calculations take of the whole preprocessing from 50% to about 13%.
make hitscan accept ray as vector, add xmath.kangvec.
Also, add hitscan test to test.lua -- a crosshair-like sprite is spawned and continuously updated to the position of where the player aims at.
make spriteext[].{x,y,z}off independent of xdimen/viewingrange/aspect.
The offsets (that will translate the axes for .pitch/.roll rotation) were calculated improperly with screen sizes other than 1280 x 1024 and were dependent on other related variables. The fix proceeded empirically, i.e. mostly trial, error, and some educated guesswork. (It's telling that the magic constant 1280 is needed.) A test for Lunatic is added to test.lua that will rotate SEENINES. Bug pointed out by Mblackwell.
add option -Lopts=... from command line.
Permitting to enable various debugging options. See "eduke32 -debughelp" for which ones those are: they were previously settable from defs_common.lua, and a new option 'strict' has been added that makes accesses to void sprites error. (That is, already "sprite[i]", not "sprite[i].some_member".)
A couple of minor changes.
- engine.c: comment out some unused decls with RELEASE=0 DEBUGANYWAY=1 - Lunatic: update dump.lua and v.lua - Lunatic: test/test_geom.lua: note a perf regression (wrt older LuaJIT, or I mis-configured / built something wrong)
fix _digitalnumber, remove player._INPUT_BITS, add sprite.all().
a.m32: add 'moveselsects', moving them so that each sector's 1st pt is at (0,0).
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.)
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
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.
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.
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.
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".
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.)
fix my r_usetileshades==2 sub-method.
Don't touch TerminX's r_usetileshades==1 or it being the default.
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.
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.
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.
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
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.
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.
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).
revamp sector changing/updating functions of sprites.
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.
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.
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().
retire an actor's sprite[].hitag/lotag for new actor[] members.
Fix loading maps in Mapster32, introduced in r3911.
Also, get rid of the strange filename[len]=255 hack in loadboard() and make its file name arg const char* at last.
Mapster32/Lunatic: ask when a <V10 map would be overwritten with a map-text one.
Also, clean up the saving/loading logic a bit: - On load failure, display message with purple color. - Take over the current file name ('boardfilename') only on success. - Check SaveBoard() return values in various places.
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.
engine.c: apply "usual readability transformations" on inside() and comment it.
The main thing to note is the "half-open" nature of the x/y range checks.
remove preceding assertion failure, continue loop then instead.
Interestingly, that test case then appears to be drawn fully. Heh. Also, move one clamp from r1874 one up in the data flow chain. Doesn't seem to break textured overhead map view with Last Pissed Time.
make fillpolygon() more readable with the usual code transformations.
Also add an assertion that currently sometimes fails when zooming in too much in Mapster32 textured 2D mode. Example: DNF's LADYKILLR.MAP at (46000,-14000).
fix construction of *_crash.map file name in crash handler.