Commit Graph

449 Commits

Author SHA1 Message Date
Daniel Gibson
c58328d881 RSBinToGroups() use __builtin_clz() instead of manual bsr if available
should be faster.
2016-05-09 18:48:39 +02:00
Daniel Gibson
46353ffc5d make BYTESWAP*_unsigned() macros inline functions, use GCC builtins
the builtins are only used when using GCC or clang, of course, otherwise
the usual shifting is done.

Them being inline functions instead of macros increases type safety
and gets rid of problems with signed shifts.

Changed two places in the code that swapped bytes in 32bit ints to use
BYTESWAP32_unsigned() instead - in case of PrepareTexture() this has
probably even fixed issues with signed shifts
2016-05-09 18:48:39 +02:00
Ryan C. Gordon
a8c6c77309 Merge pull request #47 from notaz/asm_rework
Asm rework
2016-05-09 12:03:16 -04:00
Tan Wang Leng
577373f91e Fix casing for ModExt.txt
Some file systems are case-sensitive, so use proper casing.
2016-05-05 13:47:02 +08:00
Tan Wang Leng
b42612e8fb Remove ModExt.txt symlink
Does not work on Mac and Windows, and git unable to deal with
file thrashing with another file of similar name.
2016-05-05 13:38:57 +08:00
notaz
ce46bd1e99 make cpuid work on x86_64
not that it's used for anything, just for the logs
2016-04-25 00:14:30 +03:00
notaz
ff57a29e0f make separate option for using nasm asm
Other asm is now enabled by default again, since asm blocks are now
smarter and won't fail to compile on non-i386 platforms.
2016-04-25 00:14:29 +03:00
notaz
1f70d4e242 rework asm to always fall back to portable C code
with this there is no need to worry about x86 asm switch for other
platforms.
2016-04-25 00:14:29 +03:00
notaz
78b26698ac only enable __GNU_INLINE_X86_32__ for x86/IA32
also don't error out if both __MSVC_INLINE__ and __GNU_INLINE_X86_32__
are not set, we have C fallbacks now
2016-04-25 00:14:10 +03:00
notaz
4b5cc03bf0 rename __GNU_INLINE__ to __GNU_INLINE_X86_32__
There is not only x86 in this world.
Simple sed job.
2016-04-25 00:13:37 +03:00
Joshua Scoggins
056d77f479 Assume OSX if we have defined __APPLE__ (#46) 2016-04-23 20:04:45 -04:00
ptitSeb
3e0171ea1b Tried some asynchronus input method, but doesn't seems to works 2016-04-23 19:13:55 +02:00
ptitSeb
45429a88d8 Some Pandora fine-tunning 2016-04-23 19:13:54 +02:00
ptitSeb
16d6cb99fa Added some Failsafe. Fixed a crash in the new game intro cinematic (when Boss of TFE die and Sam goes to the UFO) on the Pandora 2016-04-23 19:13:53 +02:00
ptitSeb
6bb2f81134 fix Inverted Right and Middle button on certain case with SDL 2016-04-23 19:13:52 +02:00
ptitSeb
86ef2fee09 Restrict the Eps precision change only to Pandora platform 2016-04-23 19:13:44 +02:00
ptitSeb
07e64e787e Don't regulate Framerate on Pandora 2016-04-23 19:13:17 +02:00
Tan Wang Leng
4db3022cbd Fix mouse wheel for switching weapons
This fixes #32. Strictly follows the Win32 version.
2016-04-23 19:12:28 +02:00
ptitSeb
b6d54121a5 Restrict the Eps precision change only to Pandora platform 2016-04-23 18:56:18 +02:00
ptitSeb
90e408e02c Don't regulate Framerate on Pandora 2016-04-23 18:55:14 +02:00
Tan Wang Leng
65d8d44f0e Fix mouse wheel for switching weapons
This fixes #32. Strictly follows the Win32 version.
2016-04-23 10:49:07 -04:00
ptitSeb
dca5b7a6ac Merge branch 'master' of https://github.com/ptitSeb/Serious-Engine
Conflicts:
	Sources/Engine/Base/Types.h
	Sources/Engine/Engine.h
2016-04-22 23:04:19 +02:00
ptitSeb
bbb184aad7 More macro for UNIPTR_MAX 2016-04-22 22:03:07 +02:00
ptitSeb
df3592c88c Need __STDC_LIMIT_MACROS macro here too 2016-04-22 22:03:06 +02:00
ptitSeb
c15a2ce2b3 Nedd __STDC_LIMIT_MACROS for *_MAX constant to be defined 2016-04-22 22:03:06 +02:00
ptitSeb
c6415f84b5 Don't regulate Framerate on Pandora 2016-04-22 22:03:05 +02:00
ptitSeb
e1921174d4 Restrict the Eps precision change only to Pandora platform 2016-04-22 22:03:05 +02:00
ptitSeb
c32b7cc829 fix Inverted Right and Middle button on certain case with SDL 2016-04-22 22:03:04 +02:00
ptitSeb
b4e43fac95 Lower Epsilonon Pandora 2016-04-22 22:03:03 +02:00
Joshua Scoggins
88a0ec269b Use stdint.h everywhere since Serious Engine requires MSVC 2013 or greater (#40) 2016-04-22 13:57:32 -04:00
Rohit Nirmal
cb3f3bf521 Use those other averages. (#41) 2016-04-22 13:57:04 -04:00
Ryan C. Gordon
7213794459 Merge pull request #38 from DanielGibson/fix-FloatToInt
Fix for FloatToInt
2016-04-21 23:00:03 -04:00
Ryan C. Gordon
10395909e8 Merge pull request #39 from notaz/asm_fixes
Asm fixes
2016-04-21 22:46:07 -04:00
Daniel Gibson
1f23f37b36 CMakeLists.txt: suppress some warnings also for gcc, not only clang
also, check for AppleClang, not only Clang.
2016-04-22 04:27:29 +02:00
Daniel Gibson
c74fa69bf6 gcc told me copysignf() in FloatToInt() didn't do anything. oops.
sometimes using GCC *does* find problems clang didn't :)
2016-04-22 04:27:29 +02:00
notaz
52c178718c fix SoundMixer asm
SoundMixer386.asm forgot to save some callee-save registers too
2016-04-22 02:29:47 +03:00
notaz
b1837c2e58 fix Graphics asm
same stuff as in previous commit
2016-04-22 02:29:30 +03:00
notaz
a1b84b3ba0 Revert "fix build on gcc 4.8"
This reverts commit 8bbe4c1d5e.
Going to fix it properly.
2016-04-22 02:29:30 +03:00
notaz
fd045e5025 fix LayerMixer asm
- clobber the whole x87 state for mmx (emms alone requires this)
- add all modified registers to clobber list
  (in some cases use dummy output vars instead)
- use symbolic names
- use more relaxed constraints where possible
- allow gcc to allocate ebx replacement reg
2016-04-22 02:28:42 +03:00
notaz
cb69bd3cdd add some asm helpers 2016-04-22 02:28:41 +03:00
Ryan C. Gordon
fd52a044d4 Merge pull request #36 from DrItanium/abstraction-layer
Abstraction layer
2016-04-21 12:40:44 -04:00
Ryan C. Gordon
e64199441a Merge pull request #31 from DanielGibson/more-64bit-fixes
More 64bit fixes
2016-04-21 12:31:05 -04:00
Daniel Gibson
a28a7bb00f now TFE builds on OSX, too 2016-04-21 17:46:44 +02:00
Daniel Gibson
2a58209487 Some cmake fixes, fixing OSX build (incl 64bit) + disable i386ASM by default
OSX build was a bit broken, it needs to be linked against zlib.
Furthermore it now uses the systems libSDL2 framework, unless you use
-DUSE_SYSTEM_SDL2=FALSE

i386 ASM is now disabled by default, we have plain C fallbacks for
everything that seems to work well enough (and if not they need more
testing which is likely to happen this way)
2016-04-21 17:40:42 +02:00
Daniel Gibson
64e6b915b7 Fix out of bounds access of afStarsPositions in TFE Particles.cpp
same as before for EntitiesMP/Common/Particles.cpp, this time for
the first encounter.
2016-04-21 16:21:47 +02:00
Daniel Gibson
72bd84edb8 Fix 64-bit build of Entities/Player.es (of First Encounter) 2016-04-21 16:21:47 +02:00
Daniel Gibson
430e0c8a95 Remove "64-bit issue" STUBBED() in Model.cpp, as it only looks fishy
.. but is really fine (most probably).

I added comments instead; see them for explanation why it's fine ;-)
2016-04-21 16:21:47 +02:00
Daniel Gibson
d228b6a7a7 make all BSP-related tags size_t so they can store pointers
The tags are often initially assigned from pointers and then copied
around, even from one tag type to the other.
As BSPTree::MoveSubTreeToArray() uses them to get the original pointer,
we need the pointers anyway, so just CRC-ing the pointers doesn't seem
like a good option. As the tags are assigned from other tag-types
sometimes, I probably would have needed to add Pointers for the same
values in addition to the ULONG tags, that are also copied around along
the tags, to keep the tags ULONG - that seemed like a worse alternative.

However, when writing (via BSPTree::Write_t()) the bn_ulPlaneTag tag
needs to be ULONG, so there I actually use CRC for 64bit pointers (via
IntPtrToID()) - when restoring (in Read_t()), the pointers aren't valid
anymore anyway, so that all should somehow be fine.
I assume that Write_t() is only used by the Editor, anyway, so I fear I
won't be able to test that part of the code on Linux anytime soon.
2016-04-21 16:21:47 +02:00
Daniel Gibson
b437abf10d Use PointerToID() for sound-event ID in CSoundObject::Play()/Stop()
so that code should be 64bit-clean now.
2016-04-21 16:21:47 +02:00
Daniel Gibson
23b6374e9a Add ULONG PointerToID(void*) and IntPtrToID(size_t) that CRC 64bit pointers
Sometimes pointers are casted to ULONG just to get an ID or tag - this
is fine for 32bit pointers, but 64bit pointers will truncate which might
result in not being so unique after all.
CRC-ing the pointer should yield a more likely to be unique 32bit value.
NULL is a special case that yields 0 instead of the CRC, so code that
handles IDs/Tags with value 0 differently will continue to work.
For 32bit builds, it just returns the pointer as ULONG.
2016-04-21 16:21:47 +02:00