Commit graph

780 commits

Author SHA1 Message Date
dhewg
bd1fe41b0e Move the OpenAL stub to sys/stub/ 2011-12-11 14:44:30 +01:00
dhewg
26f7a392a8 Add sanity checks for scripting 2011-12-11 12:13:04 +01:00
dhewg
bc07d06307 Use __builtin_trap() for assertions on GCC and derivates 2011-12-11 11:48:51 +01:00
dhewg
1d7d57d1f5 Cleanup endian swap functions
There's no need to detect the endianess at runtime.
2011-12-11 11:41:41 +01:00
dhewg
4378246a3a Check pointer before accessing it
Not the other way around.
2011-12-10 20:02:07 +01:00
dhewg
a8b1d3a364 Fix POSIX net code for x86_64
Multiplayer working from 32bit dedicated server on FreeBSD with a
64bit Linux client.
2011-12-10 19:24:30 +01:00
dhewg
30850f8d9c Fix FS hashing for x86_64 2011-12-10 18:51:34 +01:00
dhewg
a957b75bc3 Fix MD5 hashing for x86_64 2011-12-10 18:51:01 +01:00
dhewg
b9435a432d Fix CRC32 hashing for x86_64 2011-12-10 18:48:09 +01:00
dhewg
d0198cc8b6 Fix R_ClipLineToLight signature 2011-12-10 15:36:17 +01:00
dhewg
bdb21d20c8 Fix wrong usage of memset() 2011-12-10 15:36:17 +01:00
dhewg
8d12d9af4f Fix wrong usage of loop variables 2011-12-10 15:36:17 +01:00
dhewg
6d03fac378 Fix binary op fail in idTarget_WaitForButton::Think 2011-12-10 15:36:17 +01:00
dhewg
670daf7dd6 Exclude default stdio libvorbisfile callbacks
Prevents warnings about those being usused.
2011-12-10 15:36:16 +01:00
dhewg
82aaccc1ad Use the local OSS headers 2011-12-10 15:36:16 +01:00
dhewg
1b8777a008 Get rid of GL_HARDLINK, always link against libGL
This kills the funky GL logging stubs, which unnecessarily
complicates the build process (think future cmake).
As for logging GL calls: Use apitrace for that
https://github.com/apitrace/apitrace
2011-12-10 15:36:16 +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
56bd47ac43 Fix Sys_FileTimeStamp return type
Sync with its header.
2011-12-10 15:36:15 +01:00
dhewg
5ee2e5b564 Fix and cleanup endianess defines
Use various defines set by the compiler to determine the
endianess of the target arch.
2011-12-10 15:36:15 +01:00
dhewg
04832863e8 Basic infrastructure to build on *BSD 2011-12-10 15:36:15 +01:00
dhewg
98eed69848 Fix -Wreturn-type warnings in the GL stub
no return statement in function returning non-void
2011-12-10 15:36:15 +01:00
dhewg
59ba59c46d Fix -Wint-to-pointer-cast warning
cast to pointer from integer of different size
2011-12-10 15:36:14 +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
5c9973773b Force exit on double segfault
All bets are off in this scenario, don't deinit anything.
2011-12-10 15:36:14 +01:00
dhewg
795b77a896 Fix broken forced crash for clang
clang discards stores to *0.
Use __builtin_trap() on GCC and derivates, which plays nicely with
gdb.
2011-12-10 15:36:14 +01:00
dhewg
238a21b95f 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 );
2011-12-10 15:36:13 +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
962c0e6032 Fix sound channel saving/restoring for x86_64
Let's not store pointers as int to file. The code already allocs
channels on invalid pointers - well, afer fixing it ;)
2011-12-10 15:36:13 +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
052021d178 Fix font loading for x86_64
Font file sizes are always 20548 bytes, but the sizeof(struct) check
doesn't work on x86_64 because of alignment. Hardcode the expected
file size.
2011-12-10 15:36:12 +01:00
dhewg
04ec1794ba Fix idCinematics for x86_64 2011-12-10 15:36:11 +01:00
dhewg
545004a04c Fix ./idlib/math/ for x86_64
sizeof(float) != sizeof(long) on this ABI.
2011-12-10 15:36:11 +01:00
dhewg
1d9fd6948a Fix id[Simple]Window for x86_64 2011-12-10 15:36:11 +01:00
dhewg
eb2faa05f2 Fix MD4 hashing for x86_64 2011-12-10 15:36:11 +01:00
dhewg
87047b7251 Fix BMP loading for x86_64
struct is used for file i/o.
2011-12-10 15:36:10 +01:00
dhewg
76334aa41c Fix DDS texture handling for x86_64
struct is used for file i/o.
2011-12-10 15:36:10 +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
2c26f0c52a Fix Heap class for x86_64 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
ab201cfc06 Stub Sys_GetClockTicks for x86_64
This is only used for debugging/stats.
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
2995bcab30 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.
2011-12-10 15:36:08 +01:00
dhewg
49859d747e Comment XFlush() to prevent a crash on exit 2011-12-10 15:36:08 +01:00
dhewg
1b0a37392b scons: Get rid of -fpermissive
Not required anymore.
2011-12-10 15:36:08 +01:00
dhewg
618f15cffe Disable some not yet fixed warnings
These spam the console, disable them for now.
Some of these warnings need to be looked at instead of just
adding code to prevent them.
2011-12-10 15:36:08 +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
541f8f967a Fix typo in define
Gets rid of the warning:
XTRHEADS not defined -- this libXNVCtrl.a will not be thread safe!
2011-12-10 15:36:07 +01:00
dhewg
5dcf5389fa Fix warning: left shift count >= width of type 2011-12-10 15:36:07 +01:00
dhewg
6e89dac99e Fix -Warray-bounds warning 2011-12-10 15:36:06 +01:00