Build 2835
SVN-
fix underwalls being not animated (introduced in r2823).
Nickname SVN e nomi Git sono unificati per persona.
fix underwalls being not animated (introduced in r2823).
clamp GL texture to edge if possible, preventing potential stray lines
don't call I_ClearAllInput() before idle loop.
If input is cleared before, it can become impossible to cancel the video when decoding and displaying a frame takes longer than a frame.
collect times while playing the video and print a summary to the log afterwards.
Update LibVPX prebuilt library and headers to git commit 3eb4143fc3381497128d.
The library was built with GCC 4.6.1 and configured like ./configure --disable-vp8-encoder --disable-multithread --disable-spatial-resampling On the aforementioned AMD system, this reduces the mean time for decoding a frame from 18.2 to 15.4 ms, so IMO it's worth the somewhat hefty addition of 430 Kb.
unroll 3 planes -> packed conversion loop.
On an AMD Phenom II X4 system with generic memory modules, this brings down the mean time for this conversion from 16.5 to 10.5 ms. (GCC 4.6.1, optimized build)
Revert hightile factoring for now.
This should fix the "assignment discards 'const' qualifier" warning in music.c.
simplify some code while I'm at it (equivalence tranformations only)
bring the ypanning correction for non-pow2 walls closer to Pmost's, pt2
This changes a constant inside the panning calculation from 256 to 255 (making e.g. panning 255 and 0 the same in the "San Andreas fault" sign in E1L5) and uses the correct reference wall for the "do panning correction?" conditional. Now, the problematic walls should look the same as in Polymost.
bring the ypanning correction for non-pow2 walls closer to Pmost's, pt1
This makes the corrections conditional on where they appear in (under-, over-, white or mask wall).
a.m32: add some commented out example code for the screenshot functionality.
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).
EVENT_DRAW3DSCREEN, screenshot functonality.
The event is run after drawing the scene, but before the overlays. To make a screenshot from a script, set DOSCRSHOT to non-zero. It will then be scheduled to run once after the drawing but before the above-mentioned event. The screenshots will be called mcapXXXX.{png,tga}.
Comment out printext256's GL mode fallback code.
This would only hit when polymost_printext256 erred out (mem alloc failure, glGenTextures failure), i.e. "almost never". Also, tweak a bound check in polymost_printext256.
if printext256's <col> arg is negative, use editorcolors[-<col>].
The editor colors are the ones listed on page 9 of the Mapster32 built-in help.
Update our prebuilt MinGW libogg/libvorbis/libvorbisfile to the newest versions, courtesy of forum user LeoD
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.
Add description for 'remap' to mapster32.cfg, add 'setstartpos' to a.m32.
The latter is commented out, since it has to be *compiled* with script_expertmode enabled.
hook up non-power-of-two ysize wall/mask drawing in asm builds, too.
add {,m,t}vlineasm1nonpow2, currently unreferenced from high-level drawing.
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.
Minor adjustments to the joystick defaults for the Classic Controller.
Fix disabling EVENT_DISPLAYCROSSHAIR by setting RETURN to 1. SECTOREFFECTOR is not a useful crosshair.
Remove BUTTON(gamefunc_Jump) and KB_KeyPressed(sc_Space) from AdvanceTrigger so you can type spaces in savegame names.
Fix for "undefined reference to `clock_gettime'" linking error on some Linux systems
don't try to factor textures from fallback skins
enable the texture factoring code for all palettes
Fix MinGW build.
Makefile.common: add a couple of C warning flags.
Most notably, -Wdeclaration-after-statement. This and -Wpointer-arith give some warning on linux, but this is "harmless" as it's assumed that we'll be always compiling with GCC or Clang there. Also, erratum in the "Make ksqrt take uint32_t ..." commit: hypotenuse -> squared length of the hypotenuse
Constify various char* vars, parameters, etc. for more -Wwrite-strings cleanness
-Wwrite-strings is useful to detect code where string literals and e.g. alloc'd strings are used side-by-side, potentially creating dangerous situations, or to find uses of old, non-constified APIs. However, enabling it would still flood the log with too many warnings. Also, GCC wrongly warns for initializations of char arrays.
const char *scripthist -> char *, since it's alloc'd/freed
actors.c: factor out 4 almost identical code instances into proj_spawn_and_sound
Most differences are handled with function parameters, except that one instance checked SpriteProjectile[i].spawns for being >0 instead of >=0. The factored function always checks for >=0.
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.
some trivial mapster tweaks
safety tweaks, expose more stuff
Arrays inside structs must not be accessible, since they're not bound-checked by the FFI. Therefore, we flatten them into repeated scalar fields and need to write accessor functions later.
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 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
SDL layer: tweak high-resolution timers for profiling, add gethitickms().
For SDL 1.2 and when building on linux, the code using clock_gettime(CLOCK_MONOTINIC, ...) is taken over from SDL HG. gethitickms() is a convenience function that return milliseconds as doubles and isn't exposed in any header file, yet.
Add prototypical SDL 2.X support.
Doesn't work: indexed-color modes, gamma (at least for X11), mouse wheel, special keys like ENTER or BACKSPACE in the OSD, probably more... In build/Makefile.shared, we now have logic to autodetect an SDL2 installed in /usr/local, however OS X and Wii builds follow other Makefile code paths, it seems. Note that the matching SDL2_mixer must be used then, too. In source/jaudiolib/src/driver_sdl.c, change the #includes from <SDL/SDL_xxx.h> to "SDL_xxx.h". SDL wiki says this is the most portable way, hopefully this doesn't break builds for anyone.
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().
Relative-aligned non-flipped ceiling/floor texture alignment ([;]+[ENTER])
Flipped reference ceilings/floors aren't handled correctly yet.
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.
offset displayed quotes a bit from the top of the screen to deal with overscan