summaryrefslogtreecommitdiff
path: root/src/eventsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-06 14:49:47 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-06 14:49:47 +0300
commitc649cf883480071c9b93909c4ea4ee5ec98155b2 (patch)
tree71022fd2db59c643c19c78c5524ffcd038e35a7f /src/eventsmanager.cpp
parent4cab6fc78e19799f223d951d5ccc9afb303b65f2 (diff)
downloadplus-c649cf883480071c9b93909c4ea4ee5ec98155b2.tar.gz
plus-c649cf883480071c9b93909c4ea4ee5ec98155b2.tar.bz2
plus-c649cf883480071c9b93909c4ea4ee5ec98155b2.tar.xz
plus-c649cf883480071c9b93909c4ea4ee5ec98155b2.zip
Remove some duplicate code.
Diffstat (limited to 'src/eventsmanager.cpp')
-rw-r--r--src/eventsmanager.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp
index 73f7ef203..a87b1fd1d 100644
--- a/src/eventsmanager.cpp
+++ b/src/eventsmanager.cpp
@@ -23,11 +23,9 @@
#include "configuration.h"
#include "client.h"
#include "game.h"
-#ifdef USE_SDL2
-#include "render/graphics.h"
-#endif
#include "logger.h"
#include "mumblemanager.h"
+#include "sdlshared.h"
#include "settings.h"
#include "gui/windowmanager.h"
@@ -36,6 +34,10 @@
#include "input/inputmanager.h"
+#ifdef USE_SDL2
+#include "render/graphics.h"
+#endif
+
#include "utils/process.h"
#include "debug.h"
@@ -115,13 +117,8 @@ bool EventsManager::handleEvents() const
else
{
SDL_Event event;
-
// Handle SDL events
-#ifdef USE_SDL2
while (SDL_WaitEventTimeout(&event, 0))
-#else
- while (SDL_PollEvent(&event))
-#endif
{
if (!handleCommonEvents(event))
{
@@ -168,11 +165,7 @@ void EventsManager::handleGameEvents() const
// Events
SDL_Event event;
-#ifdef USE_SDL2
while (SDL_WaitEventTimeout(&event, 0))
-#else
- while (SDL_PollEvent(&event))
-#endif
{
if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP)
game->updateHistory(event);