* Fix horrible bug with the mouse input code.

This commit is contained in:
iProgramInCpp
2023-08-20 01:56:36 +03:00
parent f255209c84
commit 6719b151ab
2 changed files with 3 additions and 3 deletions

View File

@@ -7,6 +7,7 @@
********************************************************************/
#include "Mouse.hpp"
#include "common/Utils.hpp"
std::vector<MouseAction> Mouse::_inputs;
int Mouse::_index, Mouse::_x, Mouse::_y;
@@ -19,7 +20,7 @@ void Mouse::feed(ButtonType buttonType, ButtonState buttonState, int posX, int p
_inputs.push_back(MouseAction(buttonType, buttonState, posX, posY));
// Make sure button type is valid
if (buttonType <= ButtonType::COUNT)
if (buttonType < ButtonType::COUNT)
{
// Check if we're processing a button-state update
if (buttonType != ButtonType::NONE)

View File

@@ -22,10 +22,9 @@ public:
RIGHT,
MIDDLE,
COUNT,
SCROLLWHEEL,
MIN = LEFT,
SCROLLWHEEL,
};
enum ButtonState