Commit graph

17 commits

Author SHA1 Message Date
dhewg
6e0c766d14 Unify all Sys_GetProcessorId()
Use SDL functions whenever possible.
2011-12-22 11:07:00 +01:00
dhewg
d4281b56bf 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.
2011-12-22 10:38:40 +01:00
dhewg
4150029322 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.
2011-12-22 10:38:40 +01:00
dhewg
e2b46a5a34 Get rid of Sys_GetClockticks() and Sys_ClockTicksPerSecond()
Now unused.
2011-12-22 10:38:39 +01:00
dhewg
e7482b4957 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.
2011-12-22 10:38:37 +01:00
dhewg
7865e432a7 Port the async thread to a SDL timer
SDL implements timers via threads and it lets us easily aim at
a 60Hz frequency.
2011-12-21 17:50:39 +01:00
dhewg
005677494f 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().
2011-12-21 17:40:05 +01:00
dhewg
736ec20d4d 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.
2011-12-19 23:21:47 +01:00
dhewg
f81d32918f Implement Sys_GetProcessorId for x86 and x86_64
Detect CPU features at runtime via cpuid - code borrowed from
libavutil.
Availability of cpuid is not checked since pentium3 supports it
and that was the minimum requirement anyway.
Only features enabled at compile time will be available.

Forced MMX/SSE/SSE2/SSE3 and it passed all tests via:
./doom3.x86_64 +disconnect +set s_noSound 1 +testSIMD
2011-12-13 19:26:16 +01:00
dhewg
18762483e6 Change return type of [Sys_]GetProcessorId to int
Fixes compile error: invalid conversion from 'int' to 'cpuid_t'
2011-12-13 18:57:30 +01:00
dhewg
f9dd2f93eb Fix platform dependent thread function definitions
Thread return types are different between platforms, and its
probably not a good idea to return something of a different size,
cast the callback and expect it to not crash.
2011-12-10 15:36:13 +01:00
dhewg
ab201cfc06 Stub Sys_GetClockTicks for x86_64
This is only used for debugging/stats.
2011-12-10 15:36:09 +01:00
dhewg
6e89dac99e Fix -Warray-bounds warning 2011-12-10 15:36:06 +01:00
dhewg
2556a3923f Fix -Wunused-result warnings
ignoring return value of

Implement some error checking.
Use [put|get]char in the posix tty code for ease of use.
2011-12-10 15:36:05 +01:00
dhewg
79ad905e05 Fix all whitespace errors
Excluding 3rd party files.
2011-12-10 15:35:54 +01:00
dhewg
ff493f6847 Fix quoting in GPL headers 2011-12-10 15:34:48 +01:00
Timothee 'TTimo' Besset
fb1609f554 hello world 2011-11-22 15:28:15 -06:00