Code cleanup

This commit is contained in:
Maschell
2024-11-27 20:44:36 +01:00
parent 5893ac2f18
commit 6f7afe387e
95 changed files with 1517 additions and 1212 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#include "Input.h"
class CombinedInput : public Input {
class CombinedInput final : public Input {
public:
void combine(const Input &b) {
data.buttons_d |= b.data.buttons_d;

View File

@@ -1,7 +1,6 @@
#pragma once
#include <cstdint>
#include <cstring>
class Input {
public:
@@ -11,7 +10,7 @@ public:
//!Destructor
virtual ~Input() = default;
enum eButtons {
enum eButtons : uint32_t {
BUTTON_NONE = 0x0000,
VPAD_TOUCH = 0x80000000,
BUTTON_STICK_L = 0x80000,

View File

@@ -19,7 +19,7 @@
#include "Input.h"
#include <vpad/input.h>
class VPadInput : public Input {
class VPadInput final : public Input {
public:
//!Constructor
VPadInput() = default;
@@ -27,7 +27,7 @@ public:
//!Destructor
~VPadInput() override = default;
bool update(int32_t width, int32_t height) {
bool update(const int32_t width, const int32_t height) {
lastData = data;
data = {};

View File

@@ -20,15 +20,15 @@
#include <padscore/kpad.h>
#include <padscore/wpad.h>
class WPADInput : public Input {
class WPADInput final : public Input {
public:
WPADInput(KPADChan channel) {
WPADInput(const KPADChan channel) {
this->channel = channel;
}
~WPADInput() override {}
~WPADInput() override = default;
uint32_t remapWiiMoteButtons(uint32_t buttons) {
uint32_t remapWiiMoteButtons(const uint32_t buttons) {
uint32_t conv_buttons = 0;
if (buttons & WPAD_BUTTON_LEFT)
@@ -73,7 +73,7 @@ public:
return conv_buttons;
}
uint32_t remapClassicButtons(uint32_t buttons) {
uint32_t remapClassicButtons(const uint32_t buttons) {
uint32_t conv_buttons = 0;
if (buttons & WPAD_CLASSIC_BUTTON_LEFT)
@@ -124,7 +124,7 @@ public:
return conv_buttons;
}
bool update(int32_t width, int32_t height) {
bool update(const int32_t width, const int32_t height) {
lastData = data;
kpadError = KPAD_ERROR_UNINITIALIZED;