Commits

Anonymous committed 4423a81

Fixed input bug

  • Participants
  • Parent commits 82e9efe

Comments (0)

Files changed (3)

PolyMain/include/input/PolyInputMouse.h

 	struct InputAxis {
 		int	abs;
 		int	rel;
+
+		void clear() {
+			abs = rel = 0;
+		}
 	};
 
 	/**
 
 		/// Button down test
 		bool		buttonDown(MouseButtonID button) const;
+		void		clear();
 	};
 
 	inline bool MouseState::buttonDown(MouseButtonID button) const {
 		return ((buttons & ( 1L << button )) == 0) ? false : true;
 	}
 
+	inline void MouseState::clear() {
+		x.clear();
+		y.clear();
+		z.clear();
+		buttons = 0;
+	}
+
 	/**
 	@ingroup Input
 	*/

extensions/PolyInputOIS/include/PolyInputOISMouse.cpp

 namespace Poly {
 	InputOISMouse::InputOISMouse(OIS::Mouse* device)
 	:	mDevice(device) {
+		mState.clear();
 	}
 
 	bool InputOISMouse::isButtonDown(MouseButtonID buttonID) {

extensions/PolyInputOIS/include/PolyInputOISMouse.h

 
 	protected:
 		OIS::Mouse*				mDevice;
-		MouseState			mState;
+		MouseState				mState;
 	};
 }