summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-18 16:35:36 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-18 16:35:36 +0300
commit0d5fa0bc658e46269128bf23a9e981dfd9169de6 (patch)
tree913c8cb105ebfe8c37fa65a1a74b92e160e49364 /src/gui
parent03c74387d37cefcc18e59db203d17d78cda40e8e (diff)
downloadmanaverse-0d5fa0bc658e46269128bf23a9e981dfd9169de6.tar.gz
manaverse-0d5fa0bc658e46269128bf23a9e981dfd9169de6.tar.bz2
manaverse-0d5fa0bc658e46269128bf23a9e981dfd9169de6.tar.xz
manaverse-0d5fa0bc658e46269128bf23a9e981dfd9169de6.zip
Use mouseeventtype in mouseinput.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp10
-rw-r--r--src/gui/sdlinput.cpp20
2 files changed, 15 insertions, 15 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index ab4ee5e19..b695b669b 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -984,19 +984,19 @@ void Gui::handleMouseInput()
#endif
switch (mouseInput.getType())
{
- case MouseInput::PRESSED:
+ case MouseEventType::PRESSED:
handleMousePressed(mouseInput);
break;
- case MouseInput::RELEASED:
+ case MouseEventType::RELEASED:
handleMouseReleased(mouseInput);
break;
- case MouseInput::MOVED:
+ case MouseEventType::MOVED:
handleMouseMoved(mouseInput);
break;
- case MouseInput::WHEEL_MOVED_DOWN:
+ case MouseEventType::WHEEL_MOVED_DOWN:
handleMouseWheelMovedDown(mouseInput);
break;
- case MouseInput::WHEEL_MOVED_UP:
+ case MouseEventType::WHEEL_MOVED_UP:
handleMouseWheelMovedUp(mouseInput);
break;
default:
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index aa8824bbd..846cb34f4 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -166,9 +166,9 @@ void SDLInput::pushInput(const SDL_Event &event)
#endif
mouseInput.setButton(static_cast<uint32_t>(-1));
if (y > 0)
- mouseInput.setType(MouseInput::WHEEL_MOVED_UP);
+ mouseInput.setType(MouseEventType::WHEEL_MOVED_UP);
else
- mouseInput.setType(MouseInput::WHEEL_MOVED_DOWN);
+ mouseInput.setType(MouseEventType::WHEEL_MOVED_DOWN);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
}
@@ -204,12 +204,12 @@ void SDLInput::pushInput(const SDL_Event &event)
#ifndef USE_SDL2
if (event.button.button == SDL_BUTTON_WHEELDOWN)
- mouseInput.setType(MouseInput::WHEEL_MOVED_DOWN);
+ mouseInput.setType(MouseEventType::WHEEL_MOVED_DOWN);
else if (event.button.button == SDL_BUTTON_WHEELUP)
- mouseInput.setType(MouseInput::WHEEL_MOVED_UP);
+ mouseInput.setType(MouseEventType::WHEEL_MOVED_UP);
else
#endif
- mouseInput.setType(MouseInput::PRESSED);
+ mouseInput.setType(MouseEventType::PRESSED);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
break;
@@ -231,7 +231,7 @@ void SDLInput::pushInput(const SDL_Event &event)
#endif
#endif
mouseInput.setButton(convertMouseButton(event.button.button));
- mouseInput.setType(MouseInput::RELEASED);
+ mouseInput.setType(MouseEventType::RELEASED);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
break;
@@ -252,7 +252,7 @@ void SDLInput::pushInput(const SDL_Event &event)
#endif
#endif
mouseInput.setButton(MouseButton::EMPTY);
- mouseInput.setType(MouseInput::MOVED);
+ mouseInput.setType(MouseEventType::MOVED);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
break;
@@ -272,7 +272,7 @@ void SDLInput::pushInput(const SDL_Event &event)
mouseInput.setX(-1);
mouseInput.setY(-1);
mouseInput.setButton(MouseButton::EMPTY);
- mouseInput.setType(MouseInput::MOVED);
+ mouseInput.setType(MouseEventType::MOVED);
mMouseInputQueue.push(mouseInput);
}
}
@@ -531,10 +531,10 @@ void SDLInput::simulateMouseClick(const int x, const int y,
mouseInput.setY(y);
mouseInput.setReal(x, y);
mouseInput.setButton(button);
- mouseInput.setType(MouseInput::PRESSED);
+ mouseInput.setType(MouseEventType::PRESSED);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
- mouseInput.setType(MouseInput::RELEASED);
+ mouseInput.setType(MouseEventType::RELEASED);
mouseInput.setTimeStamp(SDL_GetTicks());
mMouseInputQueue.push(mouseInput);
}