diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-19 19:47:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-19 19:47:08 +0300 |
commit | 2ff996eb1b6e7e8f277efe369d616d57558c6667 (patch) | |
tree | a09c56157dc69b2d51b85c07e4f76c6ad221222b /src/gui | |
parent | 3203c6bd824cd8ac4e86374afafe01e45d358a40 (diff) | |
download | manaverse-2ff996eb1b6e7e8f277efe369d616d57558c6667.tar.gz manaverse-2ff996eb1b6e7e8f277efe369d616d57558c6667.tar.bz2 manaverse-2ff996eb1b6e7e8f277efe369d616d57558c6667.tar.xz manaverse-2ff996eb1b6e7e8f277efe369d616d57558c6667.zip |
improve sdlinput file.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/sdlinput.cpp | 6 | ||||
-rw-r--r-- | src/gui/sdlinput.h | 16 |
2 files changed, 8 insertions, 14 deletions
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index e80c0f8c2..bb0ded46f 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -100,9 +100,7 @@ gcn::MouseInput SDLInput::dequeueMouseInput() gcn::MouseInput mouseInput; if (mMouseInputQueue.empty()) - { throw GCN_EXCEPTION("The queue is empty."); - } mouseInput = mMouseInputQueue.front(); mMouseInputQueue.pop(); @@ -115,9 +113,7 @@ MouseInput SDLInput::dequeueMouseInput2() MouseInput mouseInput; if (mMouseInputQueue.empty()) - { throw GCN_EXCEPTION("The queue is empty."); - } mouseInput = mMouseInputQueue.front(); mMouseInputQueue.pop(); @@ -266,7 +262,6 @@ int SDLInput::convertMouseButton(const int button) int SDLInput::convertKeyCharacter(const SDL_Event &event) { const SDL_keysym keysym = event.key.keysym; - int value = keysym.unicode; switch (keysym.sym) @@ -462,6 +457,5 @@ int SDLInput::convertKeyCharacter(const SDL_Event &event) break; } } - return value; } diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h index e6983a37a..eaf6f4cf5 100644 --- a/src/gui/sdlinput.h +++ b/src/gui/sdlinput.h @@ -145,30 +145,30 @@ public: * * @param event an event from SDL. */ - virtual void pushInput(const SDL_Event &event); + void pushInput(const SDL_Event &event); /** * Polls all input. It exists for input driver compatibility. If you * only use SDL and plan sticking with SDL you can safely ignore this * function as it in the SDL case does nothing. */ - virtual void _pollInput() + void _pollInput() override { } - virtual KeyInput dequeueKeyInput2() A_WARN_UNUSED; + KeyInput dequeueKeyInput2() A_WARN_UNUSED; - virtual gcn::KeyInput dequeueKeyInput() A_WARN_UNUSED + gcn::KeyInput dequeueKeyInput() override A_WARN_UNUSED { return gcn::KeyInput(); } // Inherited from Input - virtual bool isKeyQueueEmpty() A_WARN_UNUSED; + bool isKeyQueueEmpty() override A_WARN_UNUSED; - virtual bool isMouseQueueEmpty() A_WARN_UNUSED; + bool isMouseQueueEmpty() override A_WARN_UNUSED; - virtual gcn::MouseInput dequeueMouseInput() A_WARN_UNUSED; + gcn::MouseInput dequeueMouseInput() override A_WARN_UNUSED; - virtual MouseInput dequeueMouseInput2() A_WARN_UNUSED; + MouseInput dequeueMouseInput2() A_WARN_UNUSED; protected: /** |