Build 4089
SVN-
General
Merge a patch and suggestions from NY00123 improving SDL2 support. This fixes the flickering in OpenGL in SDL2 on Windows. It also provides a proper list of resolutions.
SVN handles and Git names are merged into one person.
Merge a patch and suggestions from NY00123 improving SDL2 support. This fixes the flickering in OpenGL in SDL2 on Windows. It also provides a proper list of resolutions.
Fix OpenGL under SDL && Windows. (Almost. SDL 1.2 works fine, but SDL2 has an unresolved problem where OpenGL screen updates flicker over a black background.)
Fix "warning: iteration 1461 invokes undefined behavior [-Waggressive-loop-optimizations]" in initkpeg() by promoting the variables in question to int64_t.
NOTE TO TEAM MEMBERS: Please review this, as I am not sure what is actually intended here.
Fix the RETURN and KP_ENTER keys under SDL2.
Fix the Classic renderer under SDL2.
Fix USE_OPENGL=0 build.
Fix the long-standing trivial warnings in net.c.
Cognitively, so much time has passed that these unused variables would offer little help indicating the roadmap for networking. In any case, I have taken care only to comment rather than remove anything that is more than just a throwaway loop counter. If this commit inconveniences anyone in any way, please contact me personally and I will make it right.
Fix ebacktrace1 under MinGW's GCC 4.8 and binutils 2.23.2.
We keep needing more and more hacks as libbfd keeps becoming dependent on additional libraries we don't need...
Build tools: Fix all compiler warnings and errors with MinGW/GCC 4.8 || SDL2.
Improve SDL2 support as much as I can, for now. The game compiles, links, and starts, but all three renderers either don't display correctly or crash.
To build with SDL2: make RENDERTYPE=SDL SDL_TARGET=2
Work around a bug in MinGW 4.8 / mingwrt-4.0 where a function named main() in misc/src/libcrt/gdtoa/qnan.c takes precedence over the proper one in src/libcrt/crt/main.c.
Fix building of astub.c with MinGW 4.8.
We have to work around namespace pollution in <sys/stat.h>.
In C++ build, fix "narrowing conversion inside { } is ill-formed" warning.
This also exposes an actual issue. The sound definitions may be dynamically remapped, in which case they are not necessarily <=255 any more. BUILD_LUNATIC.
Prevent calling function pointers cast to an incompatible type.
Most often, this had happened when casting comparison functions for qsort() like these: "int yax_cmpbunches(const int16_t *b1, const int16_t *b2)" to a function pointer type expecting "const void *". Alas, this is undefined behavior: see http://blog.frama-c.com/index.php?post/2013/08/24/Function-pointers-in-C and posts linked from it. At least two cases have not been fixed: - The savegame system maintains pointers which are either to data or a function in the generic "void *". This ought to be made into a union. - Probably also: #define OSD_ALIAS (int32_t (*)(const osdfuncparm_t*))0x1337
Add WIP x86_64 assembly texture mapping routines.
- Currently: only tvlineasm1 and tvlineasm2, but incomplete (no reverse translucency, nonpow2 textures will crash) - For System V AMD64 calling conventions; requires YASM
Additional fix for the shareware version
Fix shareware version breakage introduced in r3913
Clear GL depth buffer before drawing a frame in Polymost. This should fix the issue with skies in the Duke64 TC.
Revert "Prettify the DEF progress meter by relocating '\n' en masse."
This reverts commit c7e51147f1869d42fc8365f748bb8f6bd4c6fc2f. [r3835] Conflicts: eduke32/build/src/defs.c [Dunno what caused this, but I cleaned this out. Also, the change from build.c was not reverted.]
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.
Lunatic/util: fixes for Windows.
- Need to open some files in binary mode. - MinGW's "find" doesn't provide -L option, detect that.
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().
in control.lua, use C's fwrite() to write gamearray to disk, fix typo.
Fix "The latest builds show the same screenshot for every save game entry", reported at http://forums.duke4.net/topic/2961-paper-cuts-minor-bugs-and-annoyances/page__view__findpost__p__169847
fix passing some string members to con.action(), rewrite conststruct().
... by creating a struct with 'static const int' members, as recommended on http://www.freelists.org/post/luajit/Performance-implications-of-large-FFI-constants,4
Fix issue with PIPEBOMB_CONTROL mode 2, reported at http://forums.duke4.net/topic/6721-grenade-lifetime
MSVC build fix. DONT_BUILD.
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.
Fix taking address out of bounds of stack'd array, introduced in r3983.
Clang's UBSan reports this as undefined behavior. I think that the reason is as follows: C99 6.5.3.2#1 (Constraints) says: The operand of the unary & operator shall be either a function designator, the result of a [] or unary * operator, or an lvalue that designates an object that is not a bit-field and is not declared with the register storage-class specifier. But in case of an expression like "&array[-1]", the operand ("array[-1]") does not designate a valid object. Moral: check first -- assure that an expression is valid for a particular operation before carrying it out. Keep in mind that otherwise, the compiler is absolutely free to optimize out the *check*.
fix my r_usetileshades==2 sub-method.
Don't touch TerminX's r_usetileshades==1 or it being the default.
net.c: move a necessary bound check to BEFORE the oob access happening.
Fixes the undefined behavior discussed here: http://forums.duke4.net/topic/3857-the-crash-thread/page__view__findpost__p__152612
Fix keyboard layout issue reported at http://forums.duke4.net/topic/6683-eduke32-forces-my-keyboard-to-us-layout-rather-than-uk
Enable ATI FBO color attachment workaround for Intel as well. Fixes some HD4000 issues.
Fix net.h, dunno why MSVC accepts functions that don't match their prototypes without complaining... :p
Revert "Silence FBO initialization failure message on Intel HD 4000 by moving the glCheckFramebufferStatusEXT() call to below the glBindFramebufferEXT() call. The error returned on HD 4000 previously was something to do with the framebuffer being incomplete, and this seems to fix it, so hopefully it's right."
Silence FBO initialization failure message on Intel HD 4000 by moving the glCheckFramebufferStatusEXT() call to below the glBindFramebufferEXT() call. The error returned on HD 4000 previously was something to do with the framebuffer being incomplete, and this seems to fix it, so hopefully it's right.
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.
Patch from johnnyonflame to fix the GCW and Dingoo build process.