X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=inline;f=src%2Fsupertux%2Fmain.cpp;h=1a0516168a9dcce8df7763fbd3ce2b4e876ca00d;hb=refs%2Fheads%2Fff%2Fhaptic;hp=48c2b7ebde8dcb18253787f6ad4b1a960d111f65;hpb=f9cb55ad4e8ff6e6ec974f8aa1eb53c19c95c1b1;p=supertux.git diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp index 48c2b7ebd..1a0516168 100644 --- a/src/supertux/main.cpp +++ b/src/supertux/main.cpp @@ -401,7 +401,14 @@ Main::parse_commandline(int argc, char** argv) void Main::init_sdl() { - if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC) < 0) { + int init_flags; + + init_flags = SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK; +#ifdef SDL_INIT_HAPTIC + init_flags |= SDL_INIT_HAPTIC; +#endif + + if(SDL_Init(init_flags) < 0) { std::stringstream msg; msg << "Couldn't initialize SDL: " << SDL_GetError(); throw std::runtime_error(msg.str());