浏览代码

Removed no longer used

Ivan Savenko 2 年之前
父节点
当前提交
dfeeeb1f5f

+ 0 - 5
client/eventsSDL/InputHandler.cpp

@@ -244,11 +244,6 @@ bool InputHandler::hasTouchInputDevice() const
 	return fingerHandler->hasTouchInputDevice();
 	return fingerHandler->hasTouchInputDevice();
 }
 }
 
 
-bool InputHandler::isMouseButtonPressed(MouseButton button) const
-{
-	return mouseHandler->isMouseButtonPressed(button) || fingerHandler->isMouseButtonPressed(button);
-}
-
 void InputHandler::pushUserEvent(EUserEvent usercode, void * userdata)
 void InputHandler::pushUserEvent(EUserEvent usercode, void * userdata)
 {
 {
 	SDL_Event event;
 	SDL_Event event;

+ 0 - 3
client/eventsSDL/InputHandler.h

@@ -66,9 +66,6 @@ public:
 	/// returns true if system has active touchscreen
 	/// returns true if system has active touchscreen
 	bool hasTouchInputDevice() const;
 	bool hasTouchInputDevice() const;
 
 
-	/// Returns true if selected mouse button is pressed at the moment
-	bool isMouseButtonPressed(MouseButton button) const;
-
 	/// Generates new user event that will be processed on next frame
 	/// Generates new user event that will be processed on next frame
 	void pushUserEvent(EUserEvent usercode, void * userdata);
 	void pushUserEvent(EUserEvent usercode, void * userdata);
 
 

+ 0 - 12
client/eventsSDL/InputSourceMouse.cpp

@@ -78,15 +78,3 @@ void InputSourceMouse::handleEventMouseButtonUp(const SDL_MouseButtonEvent & but
 			break;
 			break;
 	}
 	}
 }
 }
-
-bool InputSourceMouse::isMouseButtonPressed(MouseButton button) const
-{
-	static_assert(static_cast<uint32_t>(MouseButton::LEFT)   == SDL_BUTTON_LEFT,   "mismatch between VCMI and SDL enum!");
-	static_assert(static_cast<uint32_t>(MouseButton::MIDDLE) == SDL_BUTTON_MIDDLE, "mismatch between VCMI and SDL enum!");
-	static_assert(static_cast<uint32_t>(MouseButton::RIGHT)  == SDL_BUTTON_RIGHT,  "mismatch between VCMI and SDL enum!");
-	static_assert(static_cast<uint32_t>(MouseButton::EXTRA1) == SDL_BUTTON_X1,     "mismatch between VCMI and SDL enum!");
-	static_assert(static_cast<uint32_t>(MouseButton::EXTRA2) == SDL_BUTTON_X2,     "mismatch between VCMI and SDL enum!");
-
-	uint32_t index = static_cast<uint32_t>(button);
-	return mouseButtonsMask & SDL_BUTTON(index);
-}

+ 0 - 2
client/eventsSDL/InputSourceMouse.h

@@ -28,6 +28,4 @@ public:
 	void handleEventMouseButtonDown(const SDL_MouseButtonEvent & current);
 	void handleEventMouseButtonDown(const SDL_MouseButtonEvent & current);
 	void handleEventMouseWheel(const SDL_MouseWheelEvent & current);
 	void handleEventMouseWheel(const SDL_MouseWheelEvent & current);
 	void handleEventMouseButtonUp(const SDL_MouseButtonEvent & current);
 	void handleEventMouseButtonUp(const SDL_MouseButtonEvent & current);
-
-	bool isMouseButtonPressed(MouseButton button) const;
 };
 };

+ 0 - 11
client/eventsSDL/InputSourceTouch.cpp

@@ -237,17 +237,6 @@ bool InputSourceTouch::hasTouchInputDevice() const
 	return SDL_GetNumTouchDevices() > 0;
 	return SDL_GetNumTouchDevices() > 0;
 }
 }
 
 
-bool InputSourceTouch::isMouseButtonPressed(MouseButton button) const
-{
-	if (state == TouchState::TAP_DOWN_LONG)
-	{
-		if (button == MouseButton::RIGHT)
-			return true;
-	}
-
-	return false;
-}
-
 void InputSourceTouch::emitPanningEvent(const SDL_TouchFingerEvent & tfinger)
 void InputSourceTouch::emitPanningEvent(const SDL_TouchFingerEvent & tfinger)
 {
 {
 	Point distance = convertTouchToMouse(-tfinger.dx, -tfinger.dy);
 	Point distance = convertTouchToMouse(-tfinger.dx, -tfinger.dy);

+ 0 - 1
client/eventsSDL/InputSourceTouch.h

@@ -105,5 +105,4 @@ public:
 	void handleUpdate();
 	void handleUpdate();
 
 
 	bool hasTouchInputDevice() const;
 	bool hasTouchInputDevice() const;
-	bool isMouseButtonPressed(MouseButton button) const;
 };
 };

+ 0 - 5
client/gui/CGuiHandler.cpp

@@ -189,11 +189,6 @@ Point CGuiHandler::screenDimensions() const
 	return Point(screen->w, screen->h);
 	return Point(screen->w, screen->h);
 }
 }
 
 
-bool CGuiHandler::isMouseButtonPressed(MouseButton button) const
-{
-	return inputHandlerInstance->isMouseButtonPressed(button);
-}
-
 void CGuiHandler::drawFPSCounter()
 void CGuiHandler::drawFPSCounter()
 {
 {
 	static SDL_Rect overlay = { 0, 0, 64, 32};
 	static SDL_Rect overlay = { 0, 0, 64, 32};

+ 0 - 3
client/gui/CGuiHandler.h

@@ -70,9 +70,6 @@ public:
 	/// May not match size of window if user has UI scaling different from 100%
 	/// May not match size of window if user has UI scaling different from 100%
 	Point screenDimensions() const;
 	Point screenDimensions() const;
 
 
-	/// returns true if specified mouse button is pressed
-	bool isMouseButtonPressed(MouseButton button) const;
-
 	/// returns true if chosen keyboard key is currently pressed down
 	/// returns true if chosen keyboard key is currently pressed down
 	bool isKeyboardAltDown() const;
 	bool isKeyboardAltDown() const;
 	bool isKeyboardCtrlDown() const;
 	bool isKeyboardCtrlDown() const;