Build 2825
SVN-
General
Revert hightile factoring for now.
SVN handles and Git names are merged into one person.
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).
Fix the overlooking of EDUKE.CON in the absence of DUKE3D.GRP caused by r2726. Also, tweak a few string literals' use of quotation marks.
Fix actors at action 0 executing the action C code protion in gameexec.c.
The bug was introduced with SAMESIZE_ACTOR_T enabling in r2208. This fixes being unable to read the messages in A.Dream* by zykov eddy.
When teleporting silently, also set g_player[].ps->bobposx/y to the new position
This fixes an integer overflow when a distance is calculated later.
Integer Overflow Offensive continued: first round of -ftrapv - cleanness.
That is, "clang -ftrapv" builds don't abort almost immediately after entering a level. There are various classes of overflow bugs, needing different handling: - Some texture mapping code was written with signed integer wrapping semantics in mind. In some places, we're able to get away with unsigned casts. - sometimes, we really need a wider range, like when calculating distances or dot products - negating INT_MIN. Here, we cast to int64_t temporarily. Note that if the result is 32-bit wide, no 64-bit code may actually need to be generated. - shifting into a signed integer's sign bit. We cast to uint32 here. - in hitscan(), at the "abyss crash prevention code" comment, it's clearly the other code that is better... This is not merely done for pedantry, but rather makes it easier to track down overflow bugs having a real impact on the game.
Fix a thinko in a comment (about commenting) in build/Makefile.
Fix being unable to hit ENTER on VIDEO SETTINS -> RENDERER SETUP with classic.
various stuff
- hitscan & related types and constants - profiling with gethitickms - translator: eval the opening parts of block commands early - fix getbunch
Fix a single usage of S_IREAD instead of our BS_IREAD compatibility version
Fix useless "No error" message when loading palette.dat fails, change file casing in error message for failing to load tables.dat to reflect the filename actually passed to kopen4load().
Fix tweaking TROR wall links when flipping sectors ([X], [Y]).
This was actually broken all the time except when ALL sectors were selected (which was what I tested incidentally when I wrote the first "fix"). D'oh!
Fix a drawing glitch with mirrors and TROR in classic.
display zero-length walls as level-3 corruptions.
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.
Integer Overflow Offensive, First Act: rintersect, hitscan, neartag.
It's time to replace some int32s with 64-bit ints in core engine functions. The problem is that for example, the dot product is taken between vectors that may be the difference between two arbitrary points in a sector, so even if one sticks to the "no blue walls" rule, that doesn't guarantee freedom from overflows.
Fix a div by zero in polymost_internal_nonparallaxed.
fix a div by zero when drawing tile info for void tile in 3D mode.
This was exposed by Clang with -ftrapv, which apparently also traps those.
Lunatic translator: fix dangling else and add a test file, tweak warnings
Lunatic translator: define, include, fix "music" parsing, ...
Fix MSVC build error caused by the use of a C99 feature (that should have been added to the compiler about 13 years ago)
TROR/classic: same fix as r2739, intersecting case.
TROR/classic: fix a certain class of underdraw glitches.
Those were happening when wall drawing in an upper/lower layer "closed" too much of the "curtain" (umost/dmost) for subsequent drawing in that portal. Example: looking down the sewer manhole at the beginning of Retaliation will now render without HOM.