Commit graph

249 commits

Author SHA1 Message Date
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
cceeb88948 CMake support for MSVC
Use the WIN32 flag for add_executable.
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
092059bd95 Get rid of the unused Sys_FPU_ClearStack 2018-08-20 01:46:29 +02:00
dhewg
cdeb7e7ff2 Get rid of Sys_GetProcessorString()
This was only used for a printf() and not implemented for all
the platforms we can now run on.
We also don't want to force a CPU type on Windows.
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
57b8d55db0 Get rid of unused CPUID flags 2018-08-20 01:46:29 +02:00
dhewg
a9e31c4225 Get rid of Sys_GetClockticks() and Sys_ClockTicksPerSecond()
Now unused.
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
d26cf44a29 Add GetMilliseconds to idSys
To be used for the overhauled idTimer in idlib/.
2018-08-20 01:46:29 +02:00
dhewg
ae551ee106 Port Sys_Milliseconds() to SDL
Sync with SDL and use unsigned int as return type.
Code outside of sys/ still uses signed ints to store the result.
2018-08-20 01:46:29 +02:00
dhewg
9101f2e5a0 Port Sys_Sleep() to SDL 2018-08-20 01:46:29 +02:00
dhewg
f1a7b426fe Port all thread related functions to SDL
Setting thread priorities has been dropped (it is not portable).
The background download thread now exits gracefully.
g_threads is not public anymore.
2018-08-20 01:46:29 +02:00
dhewg
3c2c603cf4 Move MAX_THREADS as define to BuildDefines.h 2018-08-20 01:46:29 +02:00
dhewg
efbd47f4bc Port critical sections and events to SDL
Use SDL mutexes and conditions.
One new critical section CRITICAL_SECTION_SYS for events.
2018-08-20 01:46:29 +02:00
dhewg
f41d2347b1 Use SDL for everything endian 2018-08-20 01:46:29 +02:00
dhewg
0a945baff1 Initial SDL setup
Use SDL_main on all platforms.
Fix main() for non-const argv so it matches with the SDL
prototype.
Adapt win32 WinMain() to main() and get rid of the win32 special
case in Common::Init().
2018-08-20 01:46:28 +02:00
dhewg
980937db1a Link MinGW binaries with -mwindows
mingw-w64 requires this when linking gui applications.
2018-08-20 01:46:28 +02:00
dhewg
c476c0b168 Get rid of -Wno-unknown-pragmas
Not required anymore.
2018-08-20 01:46:28 +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
b96309c22b Split Game_local.h
New header GameBase.h with all the defines from Game_local.h and
gameError() to reduce header dependencies.
2018-08-20 01:46:27 +02:00
dhewg
c63e63b234 Move constants from AsyncNetwork.h
Make those defines in BuildDefines.h instead to reduce header
dependencies.
2018-08-20 01:46:27 +02:00
dhewg
4df3236c3e Adapt structs for easy forward declarations
Get rid of the tag namespace.
2018-08-20 01:46:27 +02:00
dhewg
8f4d16fd1b Move BuildDefines.h include to platform.h 2018-08-20 01:46:27 +02:00
dhewg
7a40472c5b Include cstddef for ptrdiff_t in 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
11b2cea993 Only compile idlib once
Build one static idlib and link the binaries against it.
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
a2586ebb52 Get rid of ID_ALLOW_D3XP
There're no second class citizens.
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
e9c9835bdf TypeInfoGen is standalone, don't compile/link it
Neither the core or the game libraries need it.
2018-08-20 01:46:27 +02:00
dhewg
c647c61d4a Mark unused variable in a non-debug build as such
Forgot this one in be40e9d6
2018-08-20 01:46:27 +02:00
dhewg
260ddac543 Fix compilation of demo binaries
invalid conversion from ‘const char*’ to ‘char*’

There are no demo pk4 files available compatible to this 1.3.1
codebase. Add a note about it.
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
a7b3b9fb0b Overwrite CMake default C[XX]FLAGS
CMake sets default flags for the standard build types.
We want to replace them, not merge them.

Reported by azalyn.
2018-08-20 01:46:27 +02:00
dhewg
e3f2666f32 Delete redundant files 2018-08-20 01:46:27 +02:00
dhewg
e03c6fcb59 Disable sound backend entry in the option menu
"Reverse channels", woooo
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
bdc063379f Don't use any idAudioHardware implementations
OpenAL for everyone.
2018-08-20 01:46:27 +02:00
dhewg
c1d67445c3 Remove Sys_LoadOpenAL() and Sys_FreeOpenAL()
This is not required anymore, all binaries on all platforms
either link against OpenAL or use the stub.
2018-08-20 01:46:27 +02:00
dhewg
f21bda7f2a cmake: Get rid of "-m32" check
This doesn't work. Always add -m32 when X86 was set.
2018-08-20 01:46:27 +02:00
dhewg
12d8125498 Undef strcasecmp before redefining it 2018-08-20 01:46:26 +02:00
dhewg
f8193c2eef Case corrections for includes on case sensitive fs' 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
01e9547049 Add a CMake build system
Tested on FreeBSD, Linux, and a ghetto rigged OSX i686 cross
compiler.

Find[OGG|Vorbis|VorbisFile].cmake borrowed from osgAudio
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