Commit graph

272 commits

Author SHA1 Message Date
Daniel Gibson
b5e8db875e disable assert() with -DNDEBUG even if -D_DEBUG is set
the game code asserts all the time, but seems to work when disabling
assertions..
so make sure assertions are really disabled with NDEBUG, even if _DEBUG
is set (like it is in debug builds).
this way I can at least get an unoptimized debug build that can actually
be tested.
2018-09-02 01:19:37 +02:00
Daniel Gibson
b41ce2627c Fix Assertion in Engine when shooting Arrows
it was caused by decals of size 0 (when the arrow hits the floor)
2018-09-02 01:17:57 +02:00
Daniel Gibson
cdcb02b26e Make it build in Debugbuilds and only include sourcehook.h where needed 2018-08-27 22:15:30 +02:00
Daniel Gibson
bf931218cc Ruiner compiles 2018-08-27 15:13:36 +02:00
Daniel Gibson
0c717b0313 Import Ruiner source (doesn't build yet) 2018-08-27 15:13:17 +02:00
Daniel Gibson
d10891a24f
minor cosmetic changes to README 2018-08-27 03:01:18 +02:00
Daniel Gibson
35f9da4f2a Add README 2018-08-27 02:55:51 +02:00
Daniel Gibson
4dd278d6fb Make game dll names and compiler defines for mods configurable
so mod authors can tell cmake to call it mymod.dll instead of base.dll
or d3xp.dll

and the compiler defines are also easily configurable now

I also added a comment to EndLevel.cpp, which was released with the GPL
source (and in d3xp/ it already existed in the SDK), but has not been
used to build the dlls.
2018-08-26 04:47:00 +02:00
Daniel Gibson
53db277bae Make it build as SDK
I created this repo from the original dhewm3 repo, but I used
git filter-branch to kill all the files that are not needed to just
build base.dll and d3xp.dll (or .so or .dylib or whatever).
So this is basically just the files the original Doom3 SDK had, but
taken from dhewm3 instead (and thus GPL licensed and patched for
64bit-support etc) + some dhewm3 specific stuff + CMakeLists.txt
to build them.

The git filter-branch details:

filter-branch -f --prune-empty --tree-filter /tmp/killkill.sh @

## /tmp/killkill.sh:

#!/bin/sh

find . -exec /tmp/removeothers.sh {} \;

exit 0

## /tmp/removeothers.sh:

#!/bin/bash

FNAME="$1"

if [[ $FNAME == \./\.git* ]] || [[ $FNAME == \./d3xp/* ]] || [[ $FNAME == \./game/* ]]
then
	#echo "ignoring $FNAME"
	exit 0
fi

if ! grep -Fxq "$FNAME" /tmp/d3sdklist.txt
then
	#echo "REMOVING $FNAME"
	rm -rf "$FNAME"
fi

exit 0

## /tmp/d3sdklist.txt was is just a textfile with one path per line with
   all the files (and directories!) I wanted to keep, like:

.
..
./sys/platform.h
./framework/Game.h
./config.h.in
./CMakeLists.txt
## ... and all the relevant files from the SDK
2018-08-26 01:43:10 +02:00
Yamagi Burmeister
aa40145157 Lower release build optimizations from -O3 to -O2.
In the last few weeks I've played again through the game and kept an eye
on small oddities. And there're a lot of them. For example some GUIs and
videos getting stuck after the first frame (issue #192) or being unable
to protect the guy with the lamp in Alpha Labs 3. Some digging proved
that most - if not all - of these problems are caused by the compilers
optimization level. When build with -O2 both g++ 8.1 and clang 6.0.0 are
producing working code. g++ 8.1 with -O3 has some small, hard to notice
oddities, clang 6.0.0 with -O3 shows a lot of them. Since there's not
measurable difference between -O3 and -O2 just go down to the later:

x doom_o3.txt
+ doom_o2.txt
+----------------------------------------------------------------------+
|                                                               +      |
|                                      +                        *      |
|x                                     *           x            *      |
|                 |_____________________|___A______M__A_________M___|_||
+----------------------------------------------------------------------+

    N        Min           Max        Median           Avg        Stddev
x   5        173           178           177         176.4     2.0736441
+   5        176           178           178         177.2     1.0954451
2018-08-20 01:46:40 +02:00
Tobias Frost
84e5ef45bc Some spelling error fixes found during Debian build
- s/allready/already
- s/Uknown/Unknown
- s/thier/their
2018-08-20 01:46:40 +02:00
Kalamatee
b86dac5719 use the correct extension for x86 2018-08-20 01:46:40 +02:00
Kalamatee
2fb870b13f import AROS changes 2018-08-20 01:46:39 +02:00
Turo Lamminen
ae17dad2f9 Fix idStr self-assignment
Was calling memcpy with overlapping parameters which is inefficient,
undefined behavior and Valgrind complained about it.
2018-08-20 01:46:39 +02:00
Turo Lamminen
db977e6f75 Fix stack overflow in SSE code
This was checking the wrong variable so when count was < 4 it was writing
past the end of buffer and potentially breaking the stack.
2018-08-20 01:46:39 +02:00
David Carlier
45d826d31c make it compilable under openbsd 2018-08-20 01:46:39 +02:00
Daniel Gibson
b8b5f20154 Version 1.4.1 2018-08-20 01:46:39 +02:00
Daniel Gibson
4bb04c13ef 1.4.1 Release Candidate 1 2018-08-20 01:46:39 +02:00
Daniel Gibson
86c634b55c Fix new[]/delete missmatches and memory leaks found by clang's ASAN
Sometimes memory was allocated with new[] but freed with delete instead
of delete[], which is wrong.
And there were some small memory leaks, too.
Furtunately clang's AddressSanitizer detected all that so I could easily
fix it.

(There seem to be some more small memory leaks which are harder to fix,
though)
2018-08-20 01:46:39 +02:00
Daniel Gibson
018e13feef Unix: On failed assertion, break gracefully into debugger
__builtin_trap() causes an illegal instruction and thus the process
can't resume afterwards.
raise(SIGTRAP) only breaks into the debugger and thus allows to
"ignore" the assertion while debugging.
2018-08-20 01:46:39 +02:00
Daniel Gibson
4ad1349113 Fix crash by assert in last RoE level (and maybe elsewhere)
The assertion in idBounds::operator-(const idBounds&) was triggered
from idWeapon::Event_LaunchProjectiles() (ownerBounds - projBounds)
It only happened when using the BFG.
So I added a check to make sure calling operator- is legal.

I guess this also caused #122
2018-08-20 01:46:39 +02:00
leffmann
a5a46de8f9 make d3xp build with Visual Studio 14 2018-08-20 01:46:39 +02:00
leffmann
5baf5deca7 make base build with Visual Studio 14 2018-08-20 01:46:39 +02:00
leffmann
99bbd70af5 make idlib build with Visual Studio 14 2018-08-20 01:46:39 +02:00
Daniel Gibson
746f2cb454 change version number to 1.4.1pre
so hopefully people trying code from git won't report problems (that
might be new) as bugs in 1.4.0
2018-08-20 01:46:39 +02:00
Daniel Gibson
c2a36a8f13 Version 1.4.0
Thanks to all the testers!
Especially from http://idtechforums.fuzzylogicinc.com/
http://www.holarse-linuxgaming.de/ (special thanks to NoXPhasma!)
http://www.quakehaus.com/ and #iodoom3.

Also many thanks to everyone reporting bugs and sending pull requests
over the years.
And dhewg of course for starting this and doing all the hard work :-)
2018-08-20 01:46:39 +02:00
Daniel Gibson
cd87ba09f7 Release Candiate 1 preparations, other small fixes 2018-08-20 01:46:38 +02:00
svdijk
c95cce323a Win32: Add an icon to the dhewm3 executable 2018-08-20 01:46:38 +02:00
Daniel Gibson
c4fdd99443 print "dhewm 3 1.4.0" in the console, not "dhewm 1.4.0"
Thanks for pointing this out, svdijk!
2018-08-20 01:46:38 +02:00
Daniel Gibson
34490bb875 Fix some compiler warnings (wrong types, superfluous checks, printf-fuckup) 2018-08-20 01:46:38 +02:00
Daniel Gibson
5e13e6f36f (Hopefully) fix crashes in MP if r_aspectRatio = -1, fix #70
While I couldn't reproduce the crash, according to the bugreport it
happens if renderSystem->GetScreenWidth()/Height() returned 0 - and
that is indeed the only plausible reason I can imagine for it.

So I check for that case and handle it gracefully by defaulting to
4:3 FOV values.
2018-08-20 01:46:38 +02:00
Daniel Gibson
ff09de0aaa Prepare for 1.4.0 release, make SDL2 default, update README
The version will be 1.4.0 because it's not compatible with
Doom3 1.3.1 mod DLLs.

(Note that this commit doesn't mean 1.4.0 is done, I might do some
 minor changes before tagging the Release!)
2018-08-20 01:46:38 +02:00
Daniel Gibson
7e39919bd5 Remove jpeg_memory_src hack that worked around old libjpeg versions
Because Debian Squeeze's libjpeg6 didn't have jpeg_mem_src(), we added
jpeg_memory_src() to provide the functionality.
This shouldn't be needed anymore and without it we can drop libjpeg code
from our repo.

Fixes #110
2018-08-20 01:46:38 +02:00
Tobias Frost
7b7c7a5238 Fixing some spelling errors: s/unkown/unknown, s/seperate/separate. (#107) 2018-08-20 01:46:38 +02:00
Zohar Malamant
5a9cdc2ed8 fixed potential bug. 2018-08-20 01:46:38 +02:00
Daniel Gibson
b3dc1ee9c6 Replace custom unzip functions with standard ones
unz[SG]etCurrentFileInfoPosition() isn't needed anymore,
because newer minizip versions have unz[SG]etOffset() for
that purpose.
2018-08-20 01:46:38 +02:00
Daniel Gibson
6aea4b59fb Use updated minizip version for unzip
The implementation is now in framework/minizip/*
instead of framework/Unzip.cpp

This was version 0.15beta, now we use 1.1 from
zlib 1.2.7/contrib/minizip

Some code had to be adjusted for this, but it got
cleaner on the way
2018-08-20 01:46:38 +02:00
Kevin Doyon
44004d8bbc Fix SDL2 compile-errors, made it work on Win64
.. when compiled with MSVC2012
2018-08-20 01:46:37 +02:00
Daniel Gibson
1ea1a299fb Silence "unknown pragma" warning in MSVC
Appeared quite often due to the #pragma GCC diagnostic ...
stuff in Str.h and List.h
2018-08-20 01:46:37 +02:00
Daniel Gibson
63aa4b1036 3c96e19610 for d3xp/ - fix miscompilation with gcc 4.5
idAnimator::GetJointLocalTransform() miscompiles with gcc 4.5 and
-ftree-vrp (implied by -O2).

Reorder code to avoid the compiler bug, no functional change.

The original commit was for game/ only, but d3xp/ will have the same
issues..
2018-08-20 01:46:37 +02:00
Daniel Gibson
ba549be284 math.h should #include sys/platform.h
Similar to f317b05
2018-08-20 01:46:37 +02:00
Daniel Gibson
e19de75a99 CD-Key check for internet-games can now be disabled
with ID_ENFORCE_KEY_CLIENT 0

This patch is from Kot-in-Action Creative Artel

Fixes #55
2018-08-20 01:46:37 +02:00
Daniel Gibson
385a1965e7 Guess x/y FOV/aspectratio from resolution
Added r_aspectratio -1 which means "auto" (as new default).
This mode sets fov_x and fov_y according to screen-width/height.
=> No need to set r_aspectratio manually anymore (assuming your display's
   pixels are about square).

The standard aspect ratios can still be enforced as before, though.
2018-08-20 01:46:37 +02:00
Daniel Gibson
20879f6972 List.h needs sys/platform.h for ID_INLINE
Everytime List.h is included in a new file (and sys/platform.h isn't)
there are confusing compiler-errors..
So just #include sys/platform.h in List.h directly, because it uses
ID_INLINE which is defined there
2018-08-20 01:46:37 +02:00
Daniel Gibson
d1527301b0 Use current type for BT_CLOSED enum
doesn't really make a difference code-wise, but removes one compiler warning.
2018-08-20 01:46:37 +02:00
Daniel Gibson
01545faf94 Get rid of some compiler warnings
GCC had shitloads of superfluous warnings wherever List.h and Str.h were
included.. get rid of them by using #pragma GCC diagnostic at some places
in List.h and Str.h.
Also add some casts, initialize some variables for other warnings
2018-08-20 01:46:37 +02:00
Daniel Gibson
a1f72df989 Win32: Statically link libgcc and libstdc++
Else one needs to copy those files from mingw32.. and I see no reason
not to statically link them.
2018-08-20 01:46:37 +02:00
Daniel Gibson
4fc06760aa Fix dedicated server for Windows
* the OpenAL function definitions mustn't include __declspec(dllimport)
  => fixed by pretending to compile OpenAL statically
* glimp.cpp shouldn't be used in dedicated-only mode (as it was already
  the case on Linux and OSX)
  => No special handling for ID_DEDICATED needed in glimp.cpp, as it's not
   used anyway
* add APIENTRY to every gl function in stub_gl.cpp for compatibility
  with windows headers and MSVC
* remove GL/gl.h #include from win_local.h as it's not needed
* in qgl.h, when building dedicated server for windows, redefine WINGDIAPI
  to nothing for SDL_opengl.h #include to get rid off __declspec(dllimport)
  by using #pragma push_macro and pop_macro, because our stub is no dll.

Fixes https://github.com/dhewm/dhewm3/issues/39
2018-08-20 01:46:37 +02:00
Daniel Gibson
ed1ffa8060 Fix several bugs from iodoom3 bugtracker
Apply 94cd0ee5 to d3xp as well.
2018-08-20 01:46:37 +02:00
dhewg
a5f5270f8e Add SDL2 support for the build system
Defaults to off, tree doesn't yet compile with SDL2.
2018-08-20 01:46:36 +02:00