TiManGames / AmnesiaTheDarkDescent

GNU General Public License v3.0
30 stars 8 forks source link

FBX breaks Windows crosscompilation #29

Closed jkulawik closed 2 weeks ago

jkulawik commented 4 weeks ago

This issue is complex and I have exhausted all my ideas and options for now.

The tl;dr is that the game uses <cmath> and the FBX SDK redefines 2 functions from it for some reason.

This issue is not present when building for Linux natively - perhaps the native (gcc?) cmath header does something better than the mingw one. As far as I can tell, the part of the SDK which causes the issue should precompile in both toolchains.

jkulawik commented 4 weeks ago

For now the crutch I used is cutting out the config.h section which redefines isnan and isinf.

Probably should work on incorporating this change in the repo, because our only option is removing FBX support altogether. Replacing it with OpenFBX is too much work: HPL2's FBX importer is 1.5k lines long and it is way too much code for us to reimplement and test.

jkulawik commented 3 weeks ago

The actual definition is from a libxml header config.h included in the SDK, so perhaps setting up this lib beforehand could solve the issue?

jkulawik commented 2 weeks ago

Probably the best way of handling this is to just supply the modified header with the project.

jkulawik commented 2 weeks ago

Modified header is now a part of the repo.

However, FBX support for MinGW builds won't be possible, so kinda a moot point anyway.