icculus / Serious-Engine

An open source version of a game engine developed by Croteam for the classic Serious Sam games.
GNU General Public License v2.0
165 stars 23 forks source link

More 64bit fixes #31

Closed DanielGibson closed 8 years ago

DanielGibson commented 8 years ago

As the PLATFORM_64BIT detection with UINTPTR_MAX caused trouble, I changed it to check for known 64bit architectures.

I fixed the known remaining 64-bit issues (except for the time_t stuff in Player.es which probably isn't critical before 2038).

DanielGibson commented 8 years ago

ok, to clarify: I only fixed and tested the second encounter, but I will add a commit to at least build the first encounter very soon.

DanielGibson commented 8 years ago

ok, first encounter compiles now, but untested.

There's still lots of warnings because of invalid offsetof(); in TSE the fix (workaround?) was to use _offsetof() instead, is that still desirable?

Yamagi commented 8 years ago

I just gave a try. This works fine for me, I'm able to build on FreeBSD 64 bit without any local hacks to Types.h and to play through the first 2 levels of TSE without glitches. TFE starts and the first level seems playable, too.

DanielGibson commented 8 years ago

first encounter seems to work, just finished the first level in 64bit without any problems

DanielGibson commented 8 years ago

Ok, one issue in TFE: music is missing, as it uses mp3, not ogg as TSE With 32bit builds, it works when using libamp11lib.so from @rcgordon's original linux binaries :-)

Is the libamp-source available somewhere? Else mp3 playback should possibly be rewritten using libmpg123 or something.

icculus commented 8 years ago

Amp11 was written by a croteam developer (AlenL) and is open source, if I recall. I'll track it down, but that doesn't have to hold up this PR...was that the only issue remaining here?

icculus commented 8 years ago

(MP3 playback arguably demands a royalty to the patent holder, which is probably why it was removed here.)

DanielGibson commented 8 years ago

I think it was the only issue (but only Yamagi and me tested), and the mp3 stuff should be a different topic.

Anyway, I found amplib: https://web.archive.org/web/20060203121222/http://marvin.cc.fer.hr/~elf/amp11lib/ and luckily archive.org even has the source zip! (I think the MP3 patents expired in september 2015 or something?)

DanielGibson commented 8 years ago

I created a github repo with the am11lib source: https://github.com/DanielGibson/amp11lib

Haven't even tried to build yet, but there it is :)

DanielGibson commented 8 years ago

I just rebased this to master and tested on OSX.

On OSX things are a bit broken for me (rendering problems), but that also happens with 32bit binaries so I guess it's not related to my changes (I only tested second encounter there).

Unless you want the _offsetof() vs offsetof() thing in TFE resolved here, I think this can be merged :-)