Commit graph

72 commits

Author SHA1 Message Date
dhewg
d832144482 Use _exit() in AssertFailed()
Ensure application exit.
2018-08-20 01:46:35 +02:00
dhewg
575668da57 Replace "__asm int 0x03" with __debugbreak()
Fixes compilation with msvc 64bit.
2018-08-20 01:46:35 +02:00
dhewg
d16d3a5534 Only compile msvc style asm with 32bit msvc
The 64bit compiler doesn't support __asm.
2018-08-20 01:46:35 +02:00
dhewg
a385bbeb29 Fixes issues with MacOSX.
- Fixes compiler errors with mismatching types in DoomController.mm
- Adds PPC_INTRINSICS fix to Simd_Altivec.h
2018-08-20 01:46:33 +02:00
dhewg
8dfc6df02a s/ReadDeltaLong/ReadDeltaInt/
to match the argument type
2018-08-20 01:46:33 +02:00
dhewg
8cd1580d60 s/WriteDeltaLong/WriteDeltaInt/
to match the return type
2018-08-20 01:46:33 +02:00
dhewg
ae319dbe4a s/ReadDeltaLongCounter/ReadDeltaIntCounter/
to match the return type
2018-08-20 01:46:33 +02:00
dhewg
c971755d98 s/WriteDeltaLongCounter/WriteDeltaIntCounter/
to match the argument type.
2018-08-20 01:46:33 +02:00
dhewg
431415c51c s/ReadLong/ReadInt/ to match the return type 2018-08-20 01:46:33 +02:00
dhewg
814abb55b9 s/WriteLong/WriteInt/ to match the argument type 2018-08-20 01:46:33 +02:00
dhewg
a9ffb336f6 s/BigLong/BigInt/ to match the return type 2018-08-20 01:46:33 +02:00
dhewg
420783b151 s/LittleLong/LittleInt/ to match the return type 2018-08-20 01:46:33 +02:00
Daniel Gibson
a9a6042a04 Remove usage of long type from idlib/
Apart from some minor stuff, this changes the signature of some methods
of Parser and Token classes and of the (unused) Random2 class.
That no problem though, because the calling code uses normal ints
anyway.
2018-08-20 01:46:33 +02:00
Daniel Gibson
d51c05c768 Fix idMatX::IsOrthonormal()
The original implementation was pretty broken (but not used anyway),
it is now fixed and improved a bit (got rid of one inner loop).
This (at least part of the problem) was detected by PVS-Studio,
see http://www.viva64.com/en/b/0120/ Fragment 3
2018-08-20 01:46:33 +02:00
dhewg
c5c5762ae4 Fix "unreachable code" warnings 2018-08-20 01:46:32 +02:00
dhewg
5fa6e06748 Use SDL GLimp and input implementations on Windows
The DirectX SDK is not required anymore.
2018-08-20 01:46:30 +02:00
spiral
3dc6127529 Remove MWERKS stuff 2018-08-20 01:46:29 +02:00
dhewg
01b5e365e8 Fix alignment issue with idBlockAlloc::Free()
Bug introduced with e97d3288. This doesn't work with MinGW, since
the struct members might not be aligned to the native pointer
size (in this case idSampleDecoderLocal was aligned to a 8 byte
boundary on win32).
Just switch the two members to avoid ugly code.
2018-08-20 01:46:29 +02:00
dhewg
27c5fd76ff Fix -Woverloaded-virtual warnings
We want to use the SIMD functions of the base class if the
deriving class does not implement every overloaded variant.

Added missing idLight::SetColor(idVec3) which is declared in
idEntity.
2018-08-20 01:46:29 +02:00
dhewg
a86defb0ca Change another _WIN32 to _MSC_VER for MinGW
Older MinGW versions do not know about __assume().
Change _WIN32 in comments too to match their opening #if.

Reported by serpentine.
2018-08-20 01:46:29 +02:00
dhewg
84d64029e5 New define IDSTR_NO_REDIRECT
The defines in idlib/Str.h won't be set to redirect the low
level c string functions to idStr when IDSTR_NO_REDIRECT is
set.

Fixes compilation for MSVC:
error C2761: 'Cmp' : member function redeclaration not allowed

Reported by spiral.
2018-08-20 01:46:29 +02:00
spiral
139726bc37 Add missing includes for MSVC
- MSVC doesn't provide C99 headers
- Default to min. req. 64Mb video mem if no COM present
- Move misplaced __attribute__((packed)) from MSVC to MinGW
2018-08-20 01:46:29 +02:00
dhewg
975cda1637 Unify CPUID_FTZ and CPUID_DAZ
Get rid of the 2 CPUID flags and combine them with SSE in one
implementation.
SSE flags can now be set on all x86 and x86_64 platforms -
independent of -ffast-math.
Helper defines borrowed from STREFLOP.
2018-08-20 01:46:29 +02:00
dhewg
79ad74d779 Use idSys::GetMilliseconds() for idTimer
The class is only used for debugging and statistical purposes.
The precision is now reduced to milliseconds, but that's only
relevant for fine grained debug timings - where the old code
was inaccurate at anyway.
2018-08-20 01:46:29 +02:00
dhewg
f41d2347b1 Use SDL for everything endian 2018-08-20 01:46:29 +02:00
dhewg
afebd7e1e5 Untangle the epic precompiled.h mess
Don't include the lazy precompiled.h everywhere, only what's
required for the compilation unit.
platform.h needs to be included instead to provide all essential
defines and types.
All includes use the relative path to the neo or the game
specific root.
Move all idlib related includes from idlib/Lib.h to precompiled.h.
precompiled.h still exists for the MFC stuff in tools/.
Add some missing header guards.
2018-08-20 01:46:28 +02:00
dhewg
8f4d16fd1b Move BuildDefines.h include to platform.h 2018-08-20 01:46:27 +02:00
dhewg
487406d861 Move idlib typedefs to platform.h 2018-08-20 01:46:27 +02:00
dhewg
e522e719dd Move common includes from precompiled.h to platform.h 2018-08-20 01:46:27 +02:00
dhewg
7d52a803ab Split platform specific code from precompiled.h
New header sys/platform.h.
2018-08-20 01:46:27 +02:00
dhewg
d76358afc2 Move the virtual abstract idGame to framework/Game.h
This is game independent and code outside of game/ and d3xp/
doesn't need to know about anything game specific.
2018-08-20 01:46:27 +02:00
dhewg
e8965eb6fb Move the game include directory to the build system
Don't include based on a preprocessor symbol, let the build
system make the correct decision.
2018-08-20 01:46:27 +02:00
dhewg
4f90a1db12 Partly restore behaviour from c17b80e9
The subtraction was inverted, but change back the behaviour too:
Hardcode offsets and check via asserts() in Debug builds.
2018-08-20 01:46:27 +02:00
dhewg
bc5f5c785a Get rid of all idAudioHardware implementations 2018-08-20 01:46:27 +02:00
dhewg
12d8125498 Undef strcasecmp before redefining it 2018-08-20 01:46:26 +02:00
dhewg
c39f4e9894 Only use MSVC style asm with MSVC 2018-08-20 01:46:26 +02:00
dhewg
2b446ddd28 Basic infrastructure to build with MinGW
Add WIN32 support to CMake (core and games, no dedicated for now).
Only use MFC when it is available.
2018-08-20 01:46:26 +02:00
dhewg
0b0db9ab41 Remove the unused and useless CallStack code
This was never enabled and only implemented for Windows.
2018-08-20 01:46:26 +02:00
dhewg
546323185b Fix -Wsizeof-pointer-memaccess warnings
argument to 'sizeof' in 'memset' call is the same expression as the
destination; did you mean to dereference it?
2018-08-20 01:46:26 +02:00
dhewg
72b8adfd82 Fix -Wdelete-non-virtual-dtor warnings
delete called on 'idSIMDProcessor' that is abstract but has
non-virtual destructor
2018-08-20 01:46:26 +02:00
dhewg
25929447dc Change return type of [Sys_]GetProcessorId to int
Fixes compile error: invalid conversion from 'int' to 'cpuid_t'
2018-08-20 01:46:26 +02:00
dhewg
055b80e859 Always compile all SIMD code
Protect all SIMD implementations with the according defines and
let the compiler decide if it supports the intructions.

Linux will still use Simd_Generic because CPU feature runtime
detection is missing.
2018-08-20 01:46:26 +02:00
dhewg
951bd827d6 Fix SIMD pointer casts/offsets for x86_64
Get the idDrawVert member offsets directly instead of hardcoding
them and checking them via assert() at runtime.

Fixes compile error:
cast from pointer to smaller type 'int' loses information
2018-08-20 01:46:26 +02:00
dhewg
c7ac0d7e26 Only include ppc_intrinsics.h when required 2018-08-20 01:46:26 +02:00
dhewg
ee4520f07e Get rid of frustum code specialized for gcc
The functions are exactly the same ;)
Maybe splitted into two files because of an ICE on some ancient
gcc?
2018-08-20 01:46:26 +02:00
dhewg
cf61014770 Add sanity checks for scripting 2018-08-20 01:46:25 +02:00
dhewg
127ea10758 Use __builtin_trap() for assertions on GCC and derivates 2018-08-20 01:46:25 +02:00
dhewg
613287e49e Cleanup endian swap functions
There's no need to detect the endianess at runtime.
2018-08-20 01:46:25 +02:00
dhewg
cabae31075 Fix MD5 hashing for x86_64 2018-08-20 01:46:25 +02:00
dhewg
ed4ee5a9f3 Fix CRC32 hashing for x86_64 2018-08-20 01:46:25 +02:00