Runtime/Input/CFinalInput: Make comparison operators const

While we're at it, we can also provide an inequality operator for
logical symmetry.
This commit is contained in:
Lioncash 2019-08-14 02:10:07 -04:00
parent e9e9de26b2
commit 27a8274e3b
1 changed files with 5 additions and 1 deletions

View File

@ -72,8 +72,12 @@ struct CFinalInput {
CFinalInput(int cIdx, float dt, const boo::DolphinControllerState& data, const CFinalInput& prevInput, float leftDiv, CFinalInput(int cIdx, float dt, const boo::DolphinControllerState& data, const CFinalInput& prevInput, float leftDiv,
float rightDiv); float rightDiv);
CFinalInput(int cIdx, float dt, const CKeyboardMouseControllerData& data, const CFinalInput& prevInput); CFinalInput(int cIdx, float dt, const CKeyboardMouseControllerData& data, const CFinalInput& prevInput);
CFinalInput& operator|=(const CFinalInput& other); CFinalInput& operator|=(const CFinalInput& other);
bool operator==(const CFinalInput& other) { return memcmp(this, &other, sizeof(CFinalInput)) == 0; }
bool operator==(const CFinalInput& other) const { return memcmp(this, &other, sizeof(CFinalInput)) == 0; }
bool operator!=(const CFinalInput& other) const { return !operator==(other); }
float DeltaTime() const { return x0_dt; } float DeltaTime() const { return x0_dt; }
u32 ControllerIdx() const { return x4_controllerIdx; } u32 ControllerIdx() const { return x4_controllerIdx; }