diff --git a/source/Input.h b/source/Input.h index ac91686..acf101a 100644 --- a/source/Input.h +++ b/source/Input.h @@ -11,6 +11,12 @@ public: //!Destructor virtual ~Input() = default; + void combine(const Input& b) { + data.buttons_d |= b.data.buttons_d; + data.buttons_h |= b.data.buttons_h; + data.buttons_r |= b.data.buttons_r; + } + enum eButtons { BUTTON_NONE = 0x0000, VPAD_TOUCH = 0x80000000, diff --git a/source/main.cpp b/source/main.cpp index 65bb38f..4bf055e 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -47,11 +47,11 @@ int main_loop() { DEBUG_FUNCTION_LINE("Entering main loop"); while (WHBProcIsRunning()) { vpadInput.update(1280, 720); - state.update(&vpadInput); for (int i = 0; i < 4; i++) { wpadInputs[i].update(1280, 720); - state.update(&wpadInputs[i]); + vpadInput.combine(wpadInputs[i]); } + state.update(&vpadInput); state.render(); }