X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fwindows%2Fgamecontroller.cpp;h=46536b39d37acba729c300c02a748a7a825bd18f;hb=6222d13e2790bdaa1013444f1221841397834cdd;hp=9c6853a41bd15095cbc23d69ba651ce26459f6ec;hpb=30cab36b531f6efddca07c3fe9a6b1b81ca42bde;p=libs%2Fgui.git diff --git a/source/input/windows/gamecontroller.cpp b/source/input/windows/gamecontroller.cpp index 9c6853a..46536b3 100644 --- a/source/input/windows/gamecontroller.cpp +++ b/source/input/windows/gamecontroller.cpp @@ -34,7 +34,7 @@ GameController::GameController(unsigned index): GameController::~GameController() { - use_event_dispatcher(0); + use_event_dispatcher(nullptr); delete priv; } @@ -75,9 +75,9 @@ void GameController::use_event_dispatcher(IO::EventDispatcher *ed) else if(priv->event_pipe) { GameControllerTimerThread::remove_slot(*priv->timer_slot); - priv->timer_slot = 0; + priv->timer_slot = nullptr; delete priv->event_pipe; - priv->event_pipe = 0; + priv->event_pipe = nullptr; } } @@ -101,13 +101,6 @@ void GameController::tick(const Time::TimeDelta &) } -GameController::Private::Private(): - index(0), - last_packet_number(0), - event_pipe(0), - timer_slot(0) -{ } - bool GameController::Private::generate_event() { event_pipe->put(1); @@ -141,11 +134,10 @@ void GameController::Private::update_state(GameController &ctrl, const XINPUT_ST } -GameControllerTimerThread *GameControllerTimerThread::thread = 0; +GameControllerTimerThread *GameControllerTimerThread::thread = nullptr; GameControllerTimerThread::GameControllerTimerThread(): - Thread("GameController"), - n_users(0) + Thread("GameController") { launch(); } @@ -171,7 +163,7 @@ void GameControllerTimerThread::remove_slot(Time::Timer::Slot &slot) { thread->timer.add(Time::zero); delete thread; - thread = 0; + thread = nullptr; } }