#pragma once #include #define PIKA_ADD_FLAG(NAME, SETNAME, VALUE) \ bool NAME() const {return (flags & ((std::uint32_t)1< JOYSTICK_SENSITIVITY; } bool up() { return y > JOYSTICK_SENSITIVITY; } bool down() { return y < -JOYSTICK_SENSITIVITY; } }LStick, RStick; bool connected = 0; void resetAllButtons() { *this = {}; } }; struct Input { //typed input doesn't work with mouse buttons Button lMouse = {}; Button rMouse = {}; //mouse position relative to window int mouseX = 0; int mouseY = 0; Button buttons[Button::BUTTONS_COUNT] = {}; char typedInput[20] = {}; float deltaTime = 0; //focus is here because it makes sense for the replay bool hasFocus = 0; bool lastFrameHasFocus = 0; constexpr static int MAX_CONTROLLERS_COUNT = 4; //don't change Controller controllers[MAX_CONTROLLERS_COUNT] = {}; //a logic or between all the controllers Controller anyController = {}; }; void processAButton(pika::Button &b, int action); }; #undef PIKA_ADD_FLAG