Commit Graph

266 Commits

Author SHA1 Message Date
ptitSeb
88d553c8f4 Merge branch 'master' of https://github.com/ptitSeb/Serious-Engine 2016-04-19 23:47:30 +02:00
ptitSeb
c8291e6d37 More macro for UNIPTR_MAX 2016-04-19 22:00:29 +02:00
ptitSeb
e077fd664d Need __STDC_LIMIT_MACROS macro here too 2016-04-19 22:00:28 +02:00
ptitSeb
4b47c278bb Nedd __STDC_LIMIT_MACROS for *_MAX constant to be defined 2016-04-19 22:00:27 +02:00
ptitSeb
b9bb24e608 Don't regulate Framerate on Pandora 2016-04-19 22:00:27 +02:00
ptitSeb
484d49434b Restrict the Eps precision change only to Pandora platform 2016-04-19 21:54:46 +02:00
ptitSeb
9288c42268 fix Inverted Right and Middle button on certain case with SDL 2016-04-19 21:54:43 +02:00
ptitSeb
7c1cc68d6f Lower Epsilonon Pandora 2016-04-19 21:54:43 +02:00
Ryan C. Gordon
26b4941010 Merge pull request #30 from Yamagi/bswap32
bswap_32() is a linuxism, use inline code instead.
2016-04-19 13:11:33 -04:00
Yamagi Burmeister
794180c598 bswap_32() is a linuxism, use inline code instead.
bswap_32() is a function specific to Linux, unavailable on FreeBSD and
OS X. Instead of messing with other platform specific functions, #ifdef
and so on provide a fast inline implementation.
2016-04-19 19:09:20 +02:00
Ryan C. Gordon
fd1ba82bc8 Merge pull request #29 from DanielGibson/fix-textures-crash
Textures.cpp: improved td_pulObjects/td_ulObject fix
2016-04-19 08:59:59 -04:00
Daniel Gibson
8de421dc9d Textures.cpp: improved td_pulObjects/td_ulObject fix
* td_pulObjects is explicitly set to NULL in the constructor - before
  only td_ulObject was set to NONE (0), so on 64bit half of
  td_pulObjects bytes would remain garbage
* only check td_ulObject for NONE if td_ctFrames <= 1 (until now it
  would frequently check it for NONE even if td_ctFrames > 1, if
  td_pulObjects was != NULL)
2016-04-19 14:38:25 +02:00
ptitSeb
4bbe57bccb Need __STDC_LIMIT_MACROS macro here too 2016-04-19 08:24:43 +02:00
ptitSeb
b9e4fb49c9 Merge branch 'master' of https://github.com/ptitSeb/Serious-Engine 2016-04-19 07:31:06 +02:00
ptitSeb
f5d397ebc6 Nedd __STDC_LIMIT_MACROS for *_MAX constant to be defined 2016-04-19 07:30:43 +02:00
ptitSeb
c5148824b2 Don't regulate Framerate on Pandora 2016-04-19 07:20:52 +02:00
ptitSeb
0d4437a1ac Restrict the Eps precision change only to Pandora platform 2016-04-19 07:20:52 +02:00
ptitSeb
031223de35 fix Inverted Right and Middle button on certain case with SDL 2016-04-19 07:20:49 +02:00
ptitSeb
2dc1c2502a Lower Epsilonon Pandora 2016-04-19 07:20:49 +02:00
Ryan C. Gordon
1f7bb24a4d Merge pull request #26 from DanielGibson/64bit-stuff
Some 64bit improvements, lots of 64bit TODOs/STUBBED()
2016-04-18 22:33:58 -04:00
Ryan C. Gordon
17de1fdb46 Merge pull request #27 from notaz/build_fix
fix build on gcc 4.8
2016-04-18 22:31:03 -04:00
notaz
8bbe4c1d5e fix build on gcc 4.8
some versions of gcc want to inline DitherBitmap(), and this leads to trouble:
Sources/Engine/Graphics/Graphics.cpp:1167: Error: symbol `rowLoopE' is already defined
Sources/Engine/Graphics/Graphics.cpp:1170: Error: symbol `pixLoopEL' is already defined
...
2016-04-18 23:55:41 +03:00
Daniel Gibson
ab5d0a584f Make Engine/Graphics/Texture.cpp 64bit-clean (hopefully!)
((ULONG*)td_ulObject)[iFr] is fishy - and ULONG td_ulObject already is
in an union with ULONG* td_pulObjects, so use td_pulObjects when
appropriate (i.e. if td_ctFrames>1)
Also fixed some checks accordingly.
2016-04-18 20:10:24 +02:00
Daniel Gibson
93daf905f1 EntitiesMP/Common/Particles.cpp: Don't access afStarsPositions[i][3]
fix out of bounds accesses of that array.
I guess the same will have to be done for Entities/Common/Particles.cpp
2016-04-18 19:37:02 +02:00
Daniel Gibson
80990f2317 Fix some more warnings, Warning about supressed warnings in cmake 2016-04-18 19:10:52 +02:00
Daniel Gibson
5f5106e363 CShell::[SG]etCurrentWorld() instead of putting it in INDEX console var
The code used to store the world pointer as a console variable
"pwoCurrentWorld" of type INDEX (int32) - that won't work for 64bit, so
I added CShell::SetCurrentWorld() and CShell::GetCurrentWorld() and
store it as a pointer.
2016-04-18 18:52:52 +02:00
Daniel Gibson
78ab018fde CMakeLists.txt: output lib* to Debug/ subdir; suppress more warnings
ssam expects lib* to be in the Debug subdir, so make cmake put it there,
this way it's easier to copy the binaries to your install/Bin/ dir to
test.
clang gives a lot of -Wlogical-op-parentheses warnings, suppress them.
2016-04-18 00:56:21 +02:00
Daniel Gibson
a358a1763f Some more FIXMEs 2016-04-18 00:53:58 +02:00
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
ptitSeb
e3ffd51810 Restrict the Eps precision change only to Pandora platform 2016-04-17 09:46:45 +02:00
ptitSeb
630f636b0e Restrict the Eps precision change only to Pandora platform 2016-04-17 09:45:11 +02:00
ptitSeb
25d405c3a0 fix Inverted Right and Middle button on certain case with SDL 2016-04-17 09:45:11 +02:00
ptitSeb
fb73e85d74 Lower Epsilonon Pandora 2016-04-17 09:45:10 +02:00
Ryan C. Gordon
aaba575856 Merge pull request #25 from DanielGibson/no-malloc-h-soundfix
Only use <malloc.h> on Win32; increase SDL sound buffer
2016-04-16 19:38:58 -04: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
ptitSeb
acd39526c9 fix Inverted Right and Middle button on certain case with SDL 2016-04-16 13:10:32 +02:00
ptitSeb
d3c7ea2e53 Lower Epsilonon Pandora 2016-04-16 11:33:08 +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
Ryan C. Gordon
d66559abfa Merge pull request #23 from Yamagi/freebsd
Add Freebsd support
2016-04-15 13:07:29 -04:00
Ryan C. Gordon
8006012b90 Merge pull request #20 from stevenc99/rdynamic
Export symbols of main executable to dynamic libs
2016-04-15 13:03:07 -04:00
Ryan C. Gordon
4f9b11eada Merge pull request #22 from stevenc99/DedicatedServer
Dedicated server
2016-04-15 13:00:25 -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
Steven Chamberlain
95b4404cbc DedicatedServer: declare a dummy _hwndMain 2016-04-13 02:25:58 +01:00
Steven Chamberlain
9f7467d3ad Fix another 1L literal 2016-04-13 02:24:55 +01:00
Steven Chamberlain
1a7ec841cb Export symbols of main executables for shared libs
Set the ENABLE_EXPORTS property on the main executables, which adds
linker flag -rdynamic if the compiler supports it.  This ensures symbols
are available for dynamic objects (such as shared libEntitiesMPD.so) to
use.
2016-04-13 02:00:21 +01: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
b299789db5 mntent.h is another linuxism and unnecessary on FreeBSD. 2016-04-12 19:27:52 +02:00