From 6f42e52d2047f9a896e0f7655a861080b93df55f Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Thu, 3 Dec 2020 01:00:38 +0100 Subject: [PATCH] Input changes --- source/Input.h | 6 ++++++ source/main.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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(); }