pjasicek / OpenClaw

Reimplementation of Captain Claw (1997) platformer
GNU General Public License v3.0
340 stars 40 forks source link

Fixes for building on FreeBSD #125

Closed valpackett closed 6 years ago

valpackett commented 6 years ago

SDL_INIT_EVERYTHING initializes everything, including subsystems which were not enabled in the SDL2 build. So it always fails because the haptic feedback subsystem is disabled by default in FreeBSD ports.

Also replace __LINUX__ with "not Android or Windows".

valpackett commented 6 years ago

pwd.h header does not exist on windows, therefore it should not be included

Damn ifdef syntax, I thought I got that right :D

why do the defines for platform-specific things need to be changed ? Is it because it is not working under FreeBSD ?

Well, yes. SDL only defines __LINUX__ on, well, Linux. So the current code only uses "$HOME/.config/openclaw" on Linux, and "" on *BSD, Solaris/illumos, etc., which is not right.

Also… wait a second.

https://github.com/pjasicek/OpenClaw/blob/d5ce5c5fbef69694cceadc566bb479bfa37280b8/OpenClaw/Engine/GameApp/MainLoop.cpp#L33

configDir is not defined anywhere! How did AppVeyor pass for the current master commit?!?!? o_0 Did it cache the object files from a previous build where everything worked?

Anyway, fixed that :)

pjasicek commented 6 years ago

hehe, there is a typo in:

#elif defined __WINDOWS__ && _WINDOWS__ == 1

_WINDOWS__instead of __WINDOWS__ - so it is thrown out in preprocessing. It looks like some relic from the past which I did not delete.

valpackett commented 6 years ago

Yeah, I removed the == 1 check now, it's kinda useless, SDL_platform.h does not define it as anything else.