Commit graph

38 commits

Author SHA1 Message Date
dhewg
db4aca78d6 Get rid of CPU_EASYARGS
Never use the event callbacks with mismatching prototypes.
2012-01-14 15:19:38 +01:00
dhewg
b7ce0ef149 CMake: Use config.h for BUILD_OS and BUILD_CPU
This fixes, among others, FreeBSD 64bit builds where the build
system used a "amd64" suffix and runtime "x86_64".
2012-01-14 15:19:12 +01:00
dhewg
2b9e2e5193 More fixes regarding event saving and restoring
Fix silly issue from 3d692b58 (sizeof(E_EVENT_SIZEOF_VEC)).
Align entity values of events to the native pointer size, which
is noticeably faster on x86_64 and fixes another assert() in
debug builds.

Past savegames with entities in events are not compatible.
2012-01-13 01:45:19 +01:00
dhewg
3d692b58de Prevent assert() while saving and restoring events
The argument size of each event is checked in debug builds
and this change was missing from the x86_64 commits.

Surprisingly this didn't trigger yet with the original game,
only with the mod 'Classic Doom 3'.
2012-01-12 19:05:52 +01:00
dhewg
3c96e19610 Fix miscompilation with gcc 4.5
idAnimator::GetJointLocalTransform() miscompiles with gcc 4.5 and
-ftree-vrp (implied by -O2).

Reorder code to avoid the compiler bug, no functional change.
2012-01-05 00:21:43 +01: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
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
13bab7a7e5 Remove MWERKS stuff 2011-12-23 13:04:21 +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
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
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
dbf3b43140 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.
2011-12-19 20:19:14 +01:00
dhewg
6017d8d7a1 Mark unused variable in a non-debug build as such
Forgot this one in be40e9d6
2011-12-16 16:01:52 +01:00
dhewg
044f745e0c Disable sound backend entry in the option menu
"Reverse channels", woooo
2011-12-14 19:04:19 +01:00
dhewg
6d03fac378 Fix binary op fail in idTarget_WaitForButton::Think 2011-12-10 15:36:17 +01:00
dhewg
9678020677 Fix compilation for *BSD
Change most __linux__ defines to __unix__ for all UNIX like systems.
2011-12-10 15:36:16 +01:00
dhewg
04d1e91d80 Fix -Wformat and -Wformat-extra-args warnings
Fix format specifiers and use the C99 %zd for types of size_t and
alike.
2011-12-10 15:36:14 +01:00
dhewg
ce976c4701 Fix script interpreter stack for x86_64
Alot of stack and event variables are pointers. Align the size of
all script and event variable types to sizeof(intptr_t) so that
the CPU needs only one fetch insn on 64bit archs.

Tested on x86 and x86_64 and found no different script behaviours
compared to the binary from id.
Savegames on x86_64 do work, but are not compatible to x86 and vice
versa (among other issues, the stack is written to file as-is).
x86 builds can still load savegames from the official binary and
vice versa.
2011-12-10 15:36:13 +01:00
dhewg
0c84e4bff3 Fix shared library loading for x86_64
Library handles are "void *" on posix.
2011-12-10 15:36:10 +01:00
dhewg
506ea7b316 Fix event callbacks for x86_64
Fix remaining event related code for the new intptr_t value type.
Regenerated game/gamesys/Callbacks.cpp via CREATE_EVENT_CODE.
2011-12-10 15:36:09 +01:00
dhewg
d92d4ba8b6 Fix idEventArg for x86_64
Pointers are passed through events; change the event value type to
intptr_t to provide enough bits.
2011-12-10 15:36:09 +01:00
dhewg
6b1e27b157 Trivial pointer cast fixes for x86_64 2011-12-10 15:36:09 +01:00
dhewg
be40e9d661 Mark unused variables in a non-debug build as such
Variables which are only used in assert().
2011-12-10 15:36:07 +01:00
dhewg
9ab9bdea8b 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.
2011-12-10 15:36:06 +01:00
dhewg
09f3aa0568 Fix -Wuninitialized warnings
may be used uninitialized in this function
2011-12-10 15:36:05 +01:00
dhewg
ee0996e380 Fix -Wunused-value warnings
value computed is not used
left operand of comma operator has no effect
right operand of comma operator has no effect
2011-12-10 15:36:04 +01:00
dhewg
3f5c14ef5f Fix -Wunused-but-set-variable warnings
variable set but not used

Removes some CollisionModel code under _DEBUG which was probably a
leftover, since it was completely useless (its done later anyways).
2011-12-10 15:36:04 +01:00
dhewg
e4771f3a5f Fix -Wunused-variable warnings
unused variable
2011-12-10 15:36:03 +01:00
dhewg
7f4bcf94ca Fix -Wunused-function warnings
defined but not used
2011-12-10 15:36:02 +01:00
dhewg
783db18c5e Fix -Wpointer-arith warnings
NULL used in arithmetic
2011-12-10 15:36:01 +01:00
dhewg
120d560722 Fix -Wconversion-null warnings
converting to non-pointer type ‘int’ from NULL
2011-12-10 15:36:00 +01:00
dhewg
9d97eefb1a Fix -Wwrite-strings warnings
deprecated conversion from string constant to ‘char*’

Constify lots of "char *".
2011-12-10 15:36:00 +01:00
dhewg
14329d47d8 Fix -Wchar-subscripts warnings
array subscript has type ‘char’
2011-12-10 15:36:00 +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