Build 2962
SVN-
General
Fix stack corruption when demo was attempted to be written with non-empty mod dir.
SVN handles and Git names are merged into one person.
Fix stack corruption when demo was attempted to be written with non-empty mod dir.
In G_DisplayRest, be sure to always un-apply a previously applied tint.
This fixes the screen keeping the bluish tint even after shattering a frozen player in the splitscreen mod.
Fix two "may be used uninitialized" warnings (they can't, as far as I can see).
Fake multi: fix display of item percentage and on/off states.
Restucture dorotspr_handle_bit2().
This also fixes the OSD with aspects < 4/3. I broke that, too.
In places where fullscreen tiles are drawn (logo etc.), use clearallviews().
This really fixes clearing the borders to the left and right with widescreen and hud_bgstretch=0. Also, it seems to fix glitches when the "screen size" is small (ud.screen_size is large).
player.c: fix a check of md_tilehasmodel return value against >0 (should be >=0)
In polymost_dorotatesprite, don't set [xy]dimen to [xy]dim temporarily.
This fixes stuff like the HUD chaingun with widescreen and small "screen sizes" (in-game viewport). It also makes rotatesprite behave more like classic overall. I have no idea why it was there in the first place.
OpenBSD build fix from Brad Smith (plus a couple of irrelevant changes to the same file from my local tree)
Fix mirrors in Polymost.
sounds.c: Factor out duplicate code into S_CalcDistAndAng().
The two instances in S_PlaySound3D() and S_Update() were slightly different as far as sequencing is concerned. However, I think making it the same has only benefits and may fix some popping sounds when starting to play a sound and updating it with a different distance value on the second buffer fill.
Fix tile CAMERA1+4 being not changed to a CAMERA1 on spawn.
Fix slimers not disappearing on dnmonsters cheat, display 2nd 'on' state.
fix build on OS X, pass LUNATIC define to build/ sources.
fix hex literal parsing on Windows, add two comments.
add 'randgen' module, implementing an encapsulated JKISS PRNG.
Also fix error handling path in our_require(), i.e. when loadstring fails.
update DukePlayer_t, fix build.
on x86 GCC asm builds, fix crash with floor sprites of (x or y) size 2.
The idiv instruction also signals an FPE when the resulting *signed* quotient overflows, so we simply use div instead.
build fix on Windows and translator fix with 32-bit archs?
erratum in r2844 commit message: ydim vs. bytesperline --> xdim vs. bytesperline
Fix SHOW MAP ON/OFF message in the game.
PNG screenshots: fix oob read of malloc'd mem on Windows.
These could manifest themselves as garbage lines on the bottom and happened because of the ydim vs. bytesperline discrepancy again.
fix underwalls being not animated (introduced in r2823).
Revert hightile factoring for now.
This should fix the "assignment discards 'const' qualifier" warning in music.c.
draw walls with non-pow2 ysizes in the old fashion for the time being.
I'm willing to make this one concession to correctness in the name of backward- compatibility. I think that one reason why this has never cause a crash is that tiles in BUILD are allocated in Ken's big allocache buffer, so oob accesses were dampened by that (though they hit uninitialized data).
factor out wall y panning coefficient calculation.
Non-pow2 wall/mask drawing in classic introduced cases where walls are drawn "incorrectly" because they were constructed with the old behavior in mind. Polymer appears to "correct" for it partially, but doesn't cover all cases. Specifically, now we have: - E1L1 first inside secret room (5000, 50000): Polymer draws like Duke 1.5, classic now draws with an offset. - E3L2 near the vault (-20000, 25000): both classic and Polymer draw with offsets compared to Duke 1.5, but they're different! This means that more research is needed into what makes these two cases diverge, even though both have the same root cause. !!! Also, mappers should abstain from using non-power-of two textures on walls until this issue is resolved in a satisfactory fashion !!!
fix glitches where stuff would be drawn transiently on sect change.
This was introduced with r2771, which fixed e.g. AMC TC city_si's mirrors, but instructed the base drawrooms inside yax_drawrooms to not correct the passed sectnum. Therefore, stuff would get drawn wrongly when passing sector boundaries, like from the platform to the rails in trueror1.map.
fix drawing mirrors, introduced by nonpow2-ysize wall/mask drawing.
Some more drawing glitches remain.
fix drawing of walls and maskwalls with non-pow2 y size tiles.
Related to that, it looks like out-of-bounds accesses when drawing such walls/ maskwalls or *sprites* are fixed, too. Sprites still show a stray lines on some occasions, but Valgrind doesn't complain then.
Fix disabling EVENT_DISPLAYCROSSHAIR by setting RETURN to 1. SECTOREFFECTOR is not a useful crosshair.
Fix for "undefined reference to `clock_gettime'" linking error on some Linux systems
Fix MinGW build.
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).