Commit graph

58 commits

Author SHA1 Message Date
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
dhewg
dec4098879 Fix wrong usage of loop variables 2018-08-20 01:46:25 +02:00
dhewg
4cfc2d87a5 Fix compilation for *BSD
Change most __linux__ defines to __unix__ for all UNIX like systems.
2018-08-20 01:46:25 +02:00
dhewg
c011a0f72a Fix and cleanup endianess defines
Use various defines set by the compiler to determine the
endianess of the target arch.
2018-08-20 01:46:25 +02:00
dhewg
471f51ef9b Fix -Wformat and -Wformat-extra-args warnings
Fix format specifiers and use the C99 %zd for types of size_t and
alike.
2018-08-20 01:46:25 +02:00
dhewg
2101e6d35d Fix unqualified lookup into dependent bases of class templates
idlib/containers/VectorSet.h:151:2: error: use of undeclared
identifier 'Append'

note: must qualify identifier to find this declaration in dependent
base class
	int	Append( const type & obj);
	int Append( const idList<type> &other );
2018-08-20 01:46:25 +02:00
dhewg
dc86a8a02c Fix ./idlib/math/ for x86_64
sizeof(float) != sizeof(long) on this ABI.
2018-08-20 01:46:24 +02:00
dhewg
bca35dec66 Fix MD4 hashing for x86_64 2018-08-20 01:46:24 +02:00
dhewg
9212bc9b67 Fix Heap class for x86_64 2018-08-20 01:46:24 +02:00
dhewg
ba1adc839f Trivial pointer cast fixes for x86_64 2018-08-20 01:46:24 +02:00
dhewg
66c740b405 Basic infrastructure for native x86_64 builds
Let scons link directly in the build folder.
Multiple archs can coexist next to each other.
New scons variable "X86" to cross compile x86 binaries on x86_64.
2018-08-20 01:46:24 +02:00
dhewg
fc5f9ed56b Mark unused variables in a non-debug build as such
Variables which are only used in assert().
2018-08-20 01:46:24 +02:00
dhewg
a08e239e28 Fix -Winvalid-offsetof warnings 2018-08-20 01:46:24 +02:00
dhewg
f4f5d9c914 Fix -Wparentheses warnings
suggest explicit braces to avoid ambiguous ‘else’
suggest parentheses around ‘&&’ within ‘||’
suggest parentheses around ‘-’ in operand of ‘&’
suggest parentheses around arithmetic in operand of ‘|’
equality comparison with extraneous parentheses

Functional change:
Proper HELLTIME check in Playerview due to missing parentheses.
2018-08-20 01:46:24 +02:00
dhewg
06a5468d4d Fix -Wuninitialized warnings
may be used uninitialized in this function
2018-08-20 01:46:23 +02:00