X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Flinux%2Fgamecontroller.cpp;h=06008bcf90b0adcd2abd89d6e05eac457b049992;hb=479298192e3e5b71a402f79520c90372a4c4b504;hp=3a2baa8a2a0cbe7f742d30da20eae2cc7fbd5444;hpb=5f3c8248c72e43dc6078d3bfb225e38f1720292a;p=libs%2Fgui.git diff --git a/source/input/linux/gamecontroller.cpp b/source/input/linux/gamecontroller.cpp index 3a2baa8..06008bc 100644 --- a/source/input/linux/gamecontroller.cpp +++ b/source/input/linux/gamecontroller.cpp @@ -1,3 +1,5 @@ +#include "gamecontroller.h" +#include "gamecontroller_platform.h" #include #include #include @@ -5,8 +7,6 @@ #include #include #include -#include "gamecontroller.h" -#include "gamecontroller_platform.h" using namespace std; @@ -16,7 +16,7 @@ namespace Input { vector GameController::Private::detected_controllers; GameController::GameController(unsigned index): - event_disp(0) + Device(GAME_CONTROLLER) { if(!detect_done) detect(); @@ -45,9 +45,9 @@ unsigned GameController::detect() FS::Path dev_input = "/dev/input"; vector devices = FS::list_filtered(dev_input, "^js[0-9]+"); sort(devices); - for(vector::const_iterator i=devices.begin(); i!=devices.end(); ++i) + for(const string &f: devices) // TODO check permissions - Private::detected_controllers.push_back((dev_input / *i).str()); + Private::detected_controllers.push_back((dev_input/f).str()); detect_done = true; n_detected_controllers = Private::detected_controllers.size(); @@ -79,11 +79,11 @@ void GameController::tick() unsigned count = len/sizeof(js_event); for(unsigned i=0; i