Commit Graph

94 Commits

Author SHA1 Message Date
Daniel Gibson
599f644328 Resolved some 64bit issues, marked/commented some others
introduced PLATFORM_32BIT and PLATFORM_64BIT macros, so you can do
#ifdef PLATFORM_64BIT if you need to.
I needed that for CDrawPort::GetID() to properly CRC a pointer.
Also added a sanity check in Engine/Base/Types.h that makes sure that
uintprt_t and size_t have the same size, as the code uses size_t to
store pointers (or cast from pointer to int) all over the place.

Made some "tags" from Engine/Templates/BSP_internal.h size_t instead of
ULONG - they're used to store pointers to identify vertices and such,
so they'd better be big enough to actually store a pointer.
Some more are still missing.
2016-04-17 23:35:04 +02:00
Daniel Gibson
8d26863a51 Improve some portable C implementations of math functions
* FloatToInt() should now  round correctly ot nearest, even for
  negative numbers
* Log2() now calls log2f() instead of log10()*3.321 - no idea what the
  previous code was about, I doubt it's faster (and the ASM code uses
  something like log2, too).
* FastLog2() (for integers) now uses __builtin_clz() when building with
  GCC/clang - the resulting ASM should be pretty similar to the inline
  ASM below. I wonder why that function takes signed ints, log2(-1) in
  reality is an irrational number (but the function returns 31)..
  Also, both the inline ASM and my version return 0 for Log2(0), but
  INT_MIN would be closer to the truth
* commented out FastMaxLog2(), it's unused.
* implemented _rotl() using a fast(er) trick from
  http://blog.regehr.org/archives/1063
2016-04-17 23:15:56 +02:00
Daniel Gibson
b934fa1945 Increase SDL soundbuffer for smoother sound playback
before it sounded shitty on my system, no it sounds good.
2016-04-17 01:07:14 +02:00
Daniel Gibson
24dcb9cc4f Don't #include <malloc.h> on Linux, only on Windows
Linux, FreeBSD and OSX should use stdlib.h instead.
2016-04-17 01:06:39 +02:00
Ryan C. Gordon
dc2c869cfc Merge pull request #24 from ptitSeb/master
More OpenPandora support (special keymap) and optionnal Multi-Threading.
2016-04-15 14:52:56 -04:00
Yamagi Burmeister
0e672b866e Determine CPU speed on FreeBSD 2016-04-13 19:24:51 +02:00
ptitSeb
cd2a586a9e Better #if condition, and add a warning to be better checked latter 2016-04-13 08:21:50 +02:00
ptitSeb
9678ec3e58 Enabled Multi-Threading (as an option) + OpenPandora specific changes (for Shoulder As Mouse Buttons) 2016-04-12 22:29:39 +02:00
Yamagi Burmeister
d1d9c8d094 There's no malloc.h on FreeBSD.
Like in OS X malloc() is part of stdlib.h.
2016-04-12 19:27:52 +02:00
Ryan C. Gordon
df6199de70 Merge pull request #19 from rcgordon/sdl2-port
Sdl2 port
2016-04-12 01:38:05 -04:00
Ryan C. Gordon
a0595204d4 Fixed what appears to be an uninitialized memory access.
This appears to fix crashes in 64-bit Linux builds. Might all be luck, though.
2016-04-12 01:27:40 -04:00
Ryan C. Gordon
67e940def8 Merge pull request #17 from RocketersAlex/linux-port
GameAgent - list servers bugfix.
2016-04-12 00:12:51 -04:00
RocketersAlex
dd0ad84385 GameAgent - list servers bugfix (update) 2016-04-12 04:10:43 +03:00
RocketersAlex
eeebba11dc GameAgent - list servers bugfix 2016-04-12 04:03:25 +03:00
ptitSeb
dfe262b619 Don't pump SDL Event in GetInput, or they will be missing in SeriousSam.cpp:SubMain(...) 2016-04-11 08:32:38 +02:00
Ryan C. Gordon
02af656d1c Whoops, forgot to actually enumerate physical display resolutions. 2016-04-10 00:54:45 -04:00
ptitSeb
cb039e972f Remove some Float Divide to use Integer and Shift in C Portable helper function on LayerMixer 2016-04-09 23:57:58 +02:00
ptitSeb
98ebac941a Change CTString.Match to treat backslashes as slash (fixes Netrisca categories for new messages) 2016-04-09 14:15:33 +02:00
ptitSeb
87a67eccf5 Fixed Portable C versio of ShadowMap Layer Mixer 2016-04-09 13:20:13 +02:00
Ryan C. Gordon
6ce0b9b27e First attempt at a port to SDL2. Untested! 2016-04-09 02:18:57 -04:00
Ryan C. Gordon
284f6c63ca Fixed a sizeof bug.
If you have...

void myfunc(char buf[16]) {
    printf("%d\n", (int) sizeof (buf));
}

...this will print sizeof (char *) instead of 16, so this fixes a piece of
code that assumed the latter instead of the former.
2016-04-09 01:03:44 -04:00
ptitSeb
f37df71029 Float fest\! 2016-04-07 18:13:50 +02:00
ptitSeb
19bd3f733b Use SDL constants for mouse buttons 2016-04-07 10:45:45 +02:00
ptitSeb
0c16613056 Fix a nasty typo 2016-04-07 09:10:09 +02:00
ptitSeb
3ec4d484e2 Fix for 64bits build 2016-04-07 09:09:51 +02:00
Ryan C. Gordon
239b9c7992 Patched to compile. 2016-04-07 00:21:28 -04:00
Alexander Pavlov
6b9ebc3ccb Update GameAgent for Linuxport. 2016-04-06 23:31:08 -04:00
Ryan C. Gordon
e2e6f41582 Merge branch 'master' of git://github.com/ptitSeb/Serious-Engine into ptitSeb-master
Conflicts:
	Sources/Engine/Math/Float.cpp
2016-04-06 23:27:55 -04:00
Ryan C. Gordon
9820436fbe First pass at cleaning out 64-bit issues.
Touches a lot of code to remove long constants like "1L", so this patch is
large and ugly, but I think it makes all those Clamp() calls look nicer in
the long run.

Most of the game is 64-bit clean, since we can build without assembly code
now. I've marked the things that are obviously still wrong with STUBBED lines.

That being said: a 64-bit build can already run the demos mostly correctly,
so we're actually almost there!

There are a few obvious things that are obviously wrong, to be fixed.
2016-04-06 23:20:29 -04:00
Ryan C. Gordon
70f3f7fe35 Turned off an assert that reads past the start of an array.
It'll crash here anyway if that assertion would have triggered, I think.
2016-04-06 23:20:29 -04:00
ptitSeb
2ccc337898 The control87 is a fake one when using USE_PORTABLE_C, regardless the architecture 2016-04-06 22:45:02 +02:00
ptitSeb
ead5da376d Cannot cast a Float to Unsigned integer directly on ARM, of sign will be lost, so double cast 2016-04-06 22:45:01 +02:00
Ryan C. Gordon
553dbe2c62 Deleted changelog autogenerated by Visual C++. 2016-04-06 15:42:40 -04:00
Ryan C. Gordon
6b248af4d0 Moved STUBBED where all platforms can see it, made it more robust. 2016-04-06 15:35:12 -04:00
Ryan C. Gordon
b42025bc9f Unix basedir: Don't read past start of array if $PATH has an empty item. 2016-04-06 15:01:09 -04:00
Ryan C. Gordon
91827e7d2a Define PLATFORM_PANDORA instead of PANDORA, to match other targets. 2016-04-06 13:40:08 -04:00
ptitSeb
7590c3ca04 GLES hardware doen't read depth, so I assume ARM based machine can'tt either 2016-04-06 16:30:39 +02:00
ptitSeb
b76bbc77d4 Fixed a typo 2016-04-06 14:15:05 +02:00
ptitSeb
4bfca131b8 gettimeofday is not reliable on PANDORA, so use clock_gettime instead 2016-04-06 13:56:26 +02:00
ptitSeb
4757cbbd2b Just to be safe, as casting +inf to integer gives 0xFFFFFFFF on x86 and 0x7FFFFFFF on arm 2016-04-06 13:52:10 +02:00
ptitSeb
c4ac41ed56 Added codepath for ARM here (simple copy of PPC version) 2016-04-06 13:49:12 +02:00
ptitSeb
b2fd42dc60 TREMOR function signatures 2016-04-06 13:48:32 +02:00
ptitSeb
8dd48b5cd8 Unstubbed the Portable C functions of LayerMixer 2016-04-06 13:47:10 +02:00
ptitSeb
af9d472619 Unstubbed the Dithered Portable C functions (ordered one unstested) 2016-04-06 13:46:26 +02:00
ptitSeb
73aab13a79 Try to fix the Portable C UploadTexture_OGL function 2016-04-06 13:44:36 +02:00
ptitSeb
8c03fccd64 Fixed the bsr Portable C function, the game start correctly now 2016-04-06 13:41:32 +02:00
ptitSeb
8c49b5f7a0 Unstubbed the Fog Portable C function 2016-04-06 13:40:56 +02:00
ptitSeb
2406f62c4b Unstubbed the Color Portable C functions 2016-04-06 13:40:02 +02:00
ptitSeb
73ea5ca7d4 Case fixing of an include 2016-04-06 13:38:09 +02:00
ptitSeb
0252ff1b6c ARM processor don't convert +inf to 0xFFFFFFFF like a x86 processor do 2016-04-06 13:37:07 +02:00