Build 4139
SVN-
General
In exprs like "Bmemcpy(&p->pos.x, &sprite[i].x, sizeof(vec3_t))", drop the ".x".
SVN handles and Git names are merged into one person.
In exprs like "Bmemcpy(&p->pos.x, &sprite[i].x, sizeof(vec3_t))", drop the ".x".
when failing to load file, don't append '.m32' if already there.
So that there are no error messages like "M32 file `a.m32.m32' not found." Also, in build.c's 'save as' code, add a bound check that would probably always pass in practice, but looks a bit safer and may fail in very cornerly cases.
save r_usetileshades and r_pr_artmapping with mapster32.cfg.
take initial map file name from ExtPreInit()->G_CheckCommandLine().
Instead of directly in build.c:app_main(). Previously, it was possible that an argument to an option, e.g. "WGR2" with "-game_dir WGR2", would get interpreted as the initial map to load. This in turn would attempt to execute WGR2.cfg as sequence of OSD commands -- where that file is an EDuke32 config file instead! Now: maps are passed without any options, e.g. "mapster32 [opts...] debug.map". The map file name is not added to the "additional parameters" for map testing.
At end of G_RestoreMapState(), update g_player[].ps->i from STAT_PLAYER sprites.
This fixes a potential crash caused by violating the expected invariant sprite[g_player[player_index].ps->i].yvel == player_index otherwise.
Fix OpenGL texture cache "leak" and slightly tweak hash string construction.
The leak happened because a struct was hashed that had uninitialized bytes in padding inserted by the compiler. The hash string in now constructed as concatenation of three CRC32s as 8-byte hex strings, i.e. the individual CRC32s are padded with leading zeros. Note to users: because of the hash change, it's sensible to delete the 'textures' and 'textures.cache' files.
Revert "Move CONTROL_ProcessBinds() to CONTROL_GetInput()." [r3981]
That change confounded character-based input with e.g. HUD control under certain circumstances, see http://forums.duke4.net/topic/6845-eduke32-savegame-annoyances/ Also, BUILD_LUNATIC ... just for the hit.sect -> hit.sector change.
rename hitdata_t member 'sect' to 'sector' for consistency. DONT_BUILD.
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.
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.