Commit Graph

118 Commits

Author SHA1 Message Date
hendricks266 0b91499ee0 Mac OS X: Add detection of the Steam and GOG releases of Duke 3D and the Steam release of NAM. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4801 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-08 04:31:57 +00:00
helixhorned 07bf374269 Fix build on platforms not magically #defining UNREFERENCED_PARAMETER. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4785 1a8010ca-5511-0410-912e-c29ae57300e0
2014-12-01 19:21:48 +00:00
terminx 89a9010db1 Fix warnings with VS2013 update 4. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4783 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-30 23:18:57 +00:00
hendricks266 4e664fe878 Some minor fixes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4768 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-28 08:14:00 +00:00
hendricks266 9268b9f0b6 Make a bunch of things extern "C". This should fix C++ builds on OS X and with Lunatic. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4766 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-26 04:39:23 +00:00
hendricks266 4e034e1331 Eliminate the printf_nowarn stuff that has long since been supplanted by TrackerCast. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4763 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-25 21:08:58 +00:00
hendricks266 f22e202d88 Fix some things when building on OS X. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4762 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-24 08:19:50 +00:00
terminx 99e21ffa94 Part 1 of attempting to adhere to C standard section 7.1.3. It turns out it's illegal to use identifiers that begin with _ or have __ anywhere in them. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4747 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:32:56 +00:00
terminx 272ac9abe6 Add FORCE_INLINE to compat.h and apply it to a couple of things we'd strongly prefer be inlined. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4743 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-22 12:28:34 +00:00
helixhorned b3f55d014e In release builds, #define Xaligned_alloc as xaligned_malloc.
Otherwise, the out-of-memory handler is not called in case of failure.

git-svn-id: https://svn.eduke32.com/eduke32@4736 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-07 22:07:13 +00:00
terminx e516fb0c8a A couple of additional compat.h formatting changes. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4716 1a8010ca-5511-0410-912e-c29ae57300e0
2014-11-02 05:35:36 +00:00
helixhorned 8605285f7f compat.h: pedantic whitespace formatting. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4708 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-30 04:59:23 +00:00
terminx 9c1a32c790 CPLUSPLUS mode build fix. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4705 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:07:35 +00:00
terminx 384aec522a Fix a couple of clang warnings. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4697 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:05:15 +00:00
terminx 021d1241eb Get rid of all the static arrays with sizes based on MAXXDIM and MAXYDIM
git-svn-id: https://svn.eduke32.com/eduke32@4695 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-29 17:04:28 +00:00
hendricks266 b4ef2d43e8 Improve fine-grained GCC and clang version detection, fixing recently introduced build issues. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4685 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 10:17:35 +00:00
terminx 8934226bb2 Another 5000 lines of pain and tears. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4680 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:36:34 +00:00
terminx 6c6b68d534 Various additional optimizations: add CLASSIC_SLICE_BY_4 mode to unroll some of the loops in a-c, replace integer divisions by a divisor unknown at compile time with usage of libdivide, clean up pragmas further by removing more old stuff that wasn't used anywhere. This is another one of those nasty commits that make people cry. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4658 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:29:21 +00:00
terminx dedadcb76e That's one hell of a typo
git-svn-id: https://svn.eduke32.com/eduke32@4651 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-25 03:26:13 +00:00
hendricks266 62b37ddb68 Further work on the Xcode project.
git-svn-id: https://svn.eduke32.com/eduke32@4648 1a8010ca-5511-0410-912e-c29ae57300e0
2014-10-20 07:37:29 +00:00
terminx 7c79d2ce80 Blrintf
git-svn-id: https://svn.eduke32.com/eduke32@4632 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:16:35 +00:00
terminx 3623645815 Clean up the "X" variants of malloc and friends to avoid unncessary function calls and parameter passing
git-svn-id: https://svn.eduke32.com/eduke32@4619 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:12:27 +00:00
terminx d279344697 Extra files to support previous commits. Change hashing stuff to intptr_t so it can be used as a dictionary of pointers, change brightness/gamma/contrast to float instead of double, other misc changes. None of these commits build on their own so don't even bother.
git-svn-id: https://svn.eduke32.com/eduke32@4606 1a8010ca-5511-0410-912e-c29ae57300e0
2014-09-30 04:06:32 +00:00
hendricks266 af28013f39 Lunatic fixes:
1 compiler error.
2 compiler warnings.
1 runtime warning.

Note that at this time, CPLUSPLUS=1 LUNATIC=1 fails to build due to C++ function mangling, and Win64 Lunatic crashes.

DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4540 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-10 09:01:48 +00:00
terminx 9378066660 lround for MSVC
git-svn-id: https://svn.eduke32.com/eduke32@4527 1a8010ca-5511-0410-912e-c29ae57300e0
2014-07-06 00:09:59 +00:00
hendricks266 a03f9bce40 Wrap most calls to exit() with a macro that will print the exit status, file name, line number, and function name to the log when using a debug build.
git-svn-id: https://svn.eduke32.com/eduke32@4502 1a8010ca-5511-0410-912e-c29ae57300e0
2014-06-13 09:02:37 +00:00
helixhorned 1d26121514 Add X{m,c,re}alloc and Xstrdup macros that call an out-of-memory handler on failure.
These wrap the x*alloc or xstrdup functions in compat.c. The handler gets passed
__FILE__, __LINE__ and __func__ (if available) in debugging builds.

Terminating the application process immediately in case of allocation failure
will let us prune many error handling paths and simplify a good portion of code.

git-svn-id: https://svn.eduke32.com/eduke32@4490 1a8010ca-5511-0410-912e-c29ae57300e0
2014-05-30 00:02:16 +00:00
terminx ced138b578 Move DO_FREE_AND_NULL macro to compat.h
git-svn-id: https://svn.eduke32.com/eduke32@4442 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-17 19:58:31 +00:00
terminx 82f5a3f39c Clamp macros for floats
git-svn-id: https://svn.eduke32.com/eduke32@4431 1a8010ca-5511-0410-912e-c29ae57300e0
2014-04-12 08:45:08 +00:00
hendricks266 c2cb6a9754 Networking updates.
- Added preprocessor value NETVERSION, to be incremented in the source whenever changes are made to the network protocol.
- Implemented proper server-side version verification of all clients upon connection.
- Implemented connection refusal when we reach MAXPLAYERS. (Should be expanded to implement server player caps.)
- Protected against OOB array accesses if an invalid player id is received.
- Renamed all "Recieve" to "Receive".

git-svn-id: https://svn.eduke32.com/eduke32@4322 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 11:00:25 +00:00
hendricks266 8f9ffcf23f MSVC: Add support for x64 building and all synthesis libs (libpng/zlib, libvpx, libFLAC).
External ogg/vorbis are no longer required.

git-svn-id: https://svn.eduke32.com/eduke32@4320 1a8010ca-5511-0410-912e-c29ae57300e0
2014-02-10 10:59:42 +00:00
hendricks266 62abd504ef Print "32-bit"/"64-bit" along with the version number in the log.
git-svn-id: https://svn.eduke32.com/eduke32@4274 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-27 10:31:39 +00:00
hendricks266 3b1b5bb41d For DISABLEINLINING=1, apply __fastcall to make up for the lack of inlining.
git-svn-id: https://svn.eduke32.com/eduke32@4247 1a8010ca-5511-0410-912e-c29ae57300e0
2014-01-12 14:04:02 +00:00
helixhorned ee9e84c356 Various stylistic cleanup.
- Move ARRAY_SIZE() macro to compat.h, add another one ARRAY_SSIZE()
- In A_RadiusDamage(): note maybe-unaligned access issue, prevent unlikely oob
- sector.c: use SPRITES_OF* macros where appropriate

git-svn-id: https://svn.eduke32.com/eduke32@4199 1a8010ca-5511-0410-912e-c29ae57300e0
2013-12-12 19:22:16 +00:00
hendricks266 e7c9a0be5d Iron out all errors and warnings when compiling with MinGW-w64, targeting either 32-bit or 64-bit.
git-svn-id: https://svn.eduke32.com/eduke32@4078 1a8010ca-5511-0410-912e-c29ae57300e0
2013-10-07 10:03:11 +00:00
hendricks266 62cdb8a9e6 Patch from johnnyonflame to fix the GCW and Dingoo build process.
git-svn-id: https://svn.eduke32.com/eduke32@3972 1a8010ca-5511-0410-912e-c29ae57300e0
2013-07-20 03:36:54 +00:00
terminx 2f883eaed1 Apparently VS2013 doesn't like redefining "inline" either
git-svn-id: https://svn.eduke32.com/eduke32@3905 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:05:24 +00:00
terminx b1dd4ffc6c MSVC build fix (looks like the compiler version shipped with VS2013 has nearbyintf now...)
git-svn-id: https://svn.eduke32.com/eduke32@3900 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-27 23:04:11 +00:00
helixhorned 51e021e810 Mapster32: fix construction of *_crash.map file name in crash handler.
git-svn-id: https://svn.eduke32.com/eduke32@3876 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-13 17:10:56 +00:00
hendricks266 ced47cf9fc Add qstrdim and screentext, powerful new functions for HUD text.
git-svn-id: https://svn.eduke32.com/eduke32@3833 1a8010ca-5511-0410-912e-c29ae57300e0
2013-06-01 06:55:00 +00:00
helixhorned b1f58387db Mapster32: when 3D-inserting sprite higher than z extent, position at floor...
... when aiming at the floor.

git-svn-id: https://svn.eduke32.com/eduke32@3780 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-16 21:54:59 +00:00
helixhorned 82d6c2d5f7 Factor out four instances of duplicate code into append_ext_UNSAFE().
git-svn-id: https://svn.eduke32.com/eduke32@3735 1a8010ca-5511-0410-912e-c29ae57300e0
2013-05-06 19:43:38 +00:00
helixhorned 203bd1e9e9 Take over and use static assertion macro found in LuaJIT sources.
git-svn-id: https://svn.eduke32.com/eduke32@3644 1a8010ca-5511-0410-912e-c29ae57300e0
2013-04-05 17:53:14 +00:00
hendricks266 624841257c Wii: Fix most warnings. Three remain: two are labeled with FIXMEs; the third consists of signed/unsigned comparisons involving LSWAPIB() in kplib.c.
git-svn-id: https://svn.eduke32.com/eduke32@3496 1a8010ca-5511-0410-912e-c29ae57300e0
2013-02-18 08:50:08 +00:00
terminx 2d4ec23b2b MSVC doesn't have ssize_t
git-svn-id: https://svn.eduke32.com/eduke32@3411 1a8010ca-5511-0410-912e-c29ae57300e0
2013-01-20 01:00:00 +00:00
helixhorned 7d1879b777 Fix LTO=1 RELEASE=1 Lunatic build.
git-svn-id: https://svn.eduke32.com/eduke32@3341 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-29 15:21:16 +00:00
hendricks266 54195d8135 kextract: Propagate the GRP file's modification time to all extracted files.
git-svn-id: https://svn.eduke32.com/eduke32@3293 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-14 23:10:10 +00:00
hendricks266 dac94ce284 Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)

To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.

All compiler and linker warnings when building in 64-bit mode have been fixed.

Remaining 64-bit to-do:
 - The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
 - RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
 - DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
 - Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)

This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.

In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.

git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
hendricks266 b6f41b6ae5 Add FORCEWARNINGS Makefile flag to prevent disabling compiler warnings within the source.
git-svn-id: https://svn.eduke32.com/eduke32@3237 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-26 08:25:26 +00:00
terminx 65104593e1 Revert "compat.h: slightly reformat the NOWARN-related preprocessor directives."
Commit breaks MSVC builds by failing to provide NOWARN macros to MSVC.

git-svn-id: https://svn.eduke32.com/eduke32@3232 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-25 13:54:33 +00:00