#include <config.h>
#include <version.h>
+#include <SDL.h>
#include <SDL_image.h>
#include <physfs.h>
#include <iostream>
#include "addon/addon_manager.hpp"
#include "audio/sound_manager.hpp"
#include "control/joystickkeyboardcontroller.hpp"
+#include "control/haptic_manager.hpp"
#include "math/random_generator.hpp"
#include "physfs/ifile_stream.hpp"
#include "physfs/physfs_sdl.hpp"
void
Main::init_sdl()
{
- if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) < 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());
init_physfs(argv[0]);
init_sdl();
+ timelog("haptic");
+ g_haptic_manager = new HapticManager();
+
timelog("controller");
g_main_controller = new JoystickKeyboardController();