Commit graph

183 commits

Author SHA1 Message Date
dhewg
32530bf7a2 Get rid of GLimp_EnableLogging
Only stubs left.
2012-01-02 15:44:00 -05:00
dhewg
3be7fae15c Always link the Windows binaries against OpenGL
Just as with every other platform.
2012-01-02 15:43:59 -05:00
dhewg
21f6eeaaeb Move wgl* function pointers
Most are only used in the unused draw_exp.cpp, move them there.
2012-01-02 15:43:56 -05:00
dhewg
e6d8509752 Remove wglGetExtensionsStringARB from win_local.h
It's only used in win_glimp.cpp
2012-01-02 15:43:50 -05:00
dhewg
1afe61cc8d Get rid of dead render thread code
The Windows backend had some preparing code for this feature,
but there is no support at all for this in renderer/.
2012-01-02 15:43:48 -05:00
dhewg
475f49dad2 Get rid of the redundant com_shuttingDown
Not required anymore since 7865e432, the timer is stopped
gracefully when shutting down.
2012-01-02 15:43:47 -05:00
dhewg
57dc097fb0 Use correct idStr::Append() while saving event strings
Used the wrong Append() in fad99572, we want to stop at a
terminating null char.
2012-01-02 15:43:44 -05:00
dhewg
239b165798 Use com_ticNumber for the async timer
This yields much more precise updates and stable fps.

Reported by kaan.
2011-12-27 21:27:27 +01:00
dhewg
fad995722c Implement saving and restoring of event strings
Required for events with string arguments. On debug builds
an assert() is triggered when trying to save such an event,
while events could not be properly restored in any build.

This happens when going from map delta4 to hell1 and the
autosave feature kicks in. The trigger event 'selectWeapon'
with the string argument 'weapon_fists' is in the event queue.

With the binary from id a warning is issued:
WARNING: player1 is not carrying weapon ''
so the bug exists in there too, just that its a release build
and doesn't abort().

I also managed to trigger this while saving shortly after
activating an elevator switch.
2011-12-27 21:27:27 +01:00
spiral
1507a657d4 Add ID_GAME_API for dllexport/attribute(visibility)
Delete obsolete Game.def exports files
2011-12-23 13:24:47 +01:00
spiral
d214a0f819 VS Pro doesn't choose the right default like Express, so be explicit 2011-12-23 13:06:05 +01:00
spiral
13bab7a7e5 Remove MWERKS stuff 2011-12-23 13:04:21 +01:00
dhewg
826dfb0e5b 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.
2011-12-22 18:51:17 +01:00
dhewg
9e715ba7cc Check for jpeg_mem_src()
This function only exists starting with libjpeg8.
Check for existence and provide an implementation if necessary.
This allows libjpeg6 to be used.

Code borrowed from libjpeg8, adapt copyright in README
accordingly.
2011-12-22 14:10:29 +01:00
dhewg
2c1186dc1b 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.
2011-12-22 12:33:27 +01:00
dhewg
acdfb93552 Fix compiler checks for newer gcc versions
Use CXX instead of C checks - newer gcc versions refuse some
C++ flags when compiling C.
2011-12-22 12:33:27 +01:00
dhewg
6997848645 Use HUGE_VAL instead of HUGE
This is more portable, and older MinGW versions actually
don't know about HUGE.

Reported by serpentine.
2011-12-22 12:33:21 +01:00
dhewg
d37fe69f85 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.
2011-12-22 12:32:39 +01:00
dhewg
469031be21 Remove win32 special case in idSession::Frame()
Since 1a25b165 not required anymore, all platforms behave the
same.
2011-12-22 11:43:24 +01:00
dhewg
cdf6fa3702 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.
2011-12-22 11:21:55 +01:00
spiral
540bbae490 CMake support for MSVC
Use the WIN32 flag for add_executable.
2011-12-22 11:21:54 +01:00
spiral
7e5795dd56 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
2011-12-22 11:07:01 +01:00
dhewg
ca04dd36d8 Get rid of the unused Sys_FPU_ClearStack 2011-12-22 11:07:01 +01:00
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
acfe2489e4 Get rid of unused CPUID flags 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
2e3653ce9f Get rid of CPU speed check in SetMachineSpec()
This is a non portable x86 and x86_64 check.
2011-12-22 10:38:39 +01:00
dhewg
280c95b52c 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.
2011-12-22 10:38:39 +01:00
dhewg
a99971f44c Add GetMilliseconds to idSys
To be used for the overhauled idTimer in idlib/.
2011-12-22 10:38:38 +01:00
dhewg
c994974ffc 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.
2011-12-22 10:38:38 +01:00
dhewg
317e63887c Port Sys_Sleep() to SDL 2011-12-22 10:38:38 +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
5a052e846f Move MAX_THREADS as define to BuildDefines.h 2011-12-21 17:50:39 +01:00
dhewg
1a25b165b0 Port critical sections and events to SDL
Use SDL mutexes and conditions.
One new critical section CRITICAL_SECTION_SYS for events.
2011-12-21 17:50:35 +01:00
dhewg
0f3c2ebf52 Use SDL for everything endian 2011-12-21 17:40:38 +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
efc71124b1 TypeInfoGen is standalone, don't compile/link it
Same change for scons as 8ca99602 for CMake.
2011-12-21 17:39:01 +01:00
dhewg
45566d9727 Fix compilation via scons
Add the include path to the root directory, overlooked in
736ec20d.
2011-12-21 13:53:36 +01:00
dhewg
1358d397e4 Link MinGW binaries with -mwindows
mingw-w64 requires this when linking gui applications.
2011-12-20 12:17:45 +01:00
dhewg
278dae9345 Get rid of -Wno-unknown-pragmas
Not required anymore.
2011-12-19 23:21:49 +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
18526bf4eb Split Game_local.h
New header GameBase.h with all the defines from Game_local.h and
gameError() to reduce header dependencies.
2011-12-19 23:21:41 +01:00
dhewg
cfbed87fa8 Move constants from AsyncNetwork.h
Make those defines in BuildDefines.h instead to reduce header
dependencies.
2011-12-19 23:21:41 +01:00
dhewg
da60a2a631 Adapt structs for easy forward declarations
Get rid of the tag namespace.
2011-12-19 23:18:15 +01:00
dhewg
966a380793 Move BuildDefines.h include to platform.h 2011-12-19 20:33:09 +01:00
dhewg
5d8d3b726e Include cstddef for ptrdiff_t in platform.h 2011-12-19 20:33:09 +01:00
dhewg
90a53d0977 Move idlib typedefs to platform.h 2011-12-19 20:33:03 +01:00