Browse Source

input: allow to easily track more than one input stick.

legacy
Sam Hocevar sam 12 years ago
parent
commit
0b971d7926
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      src/input/input.cpp
  2. +1
    -1
      src/input/input.h

+ 4
- 4
src/input/input.cpp View File

@@ -217,13 +217,13 @@ void Input::DestroyStick(Stick *stick)
Ticker::Unref(stick);
}

Stick *Input::TrackStick()
Stick *Input::TrackStick(int desired)
{
/* FIXME: add the possibility to choose amongst sticks */
if (!data->m_sticks.Count())
if (desired >= data->m_sticks.Count())
return NULL;
Ticker::Ref(data->m_sticks[0]);
return data->m_sticks[0];
Ticker::Ref(data->m_sticks[desired]);
return data->m_sticks[desired];
}

void Input::UntrackStick(Stick *stick)


+ 1
- 1
src/input/input.h View File

@@ -49,7 +49,7 @@ public:
static Stick *CreateStick();
static void DestroyStick(Stick *stick);

static Stick *TrackStick();
static Stick *TrackStick(int desired);
static void UntrackStick(Stick *stick);
};



Loading…
Cancel
Save