From 27a8274e3bcb978b2f1f8e5bdd456d9a02926bab Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 14 Aug 2019 02:10:07 -0400 Subject: [PATCH] Runtime/Input/CFinalInput: Make comparison operators const While we're at it, we can also provide an inequality operator for logical symmetry. --- Runtime/Input/CFinalInput.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Runtime/Input/CFinalInput.hpp b/Runtime/Input/CFinalInput.hpp index bfa49f5a3..b4f6a3645 100644 --- a/Runtime/Input/CFinalInput.hpp +++ b/Runtime/Input/CFinalInput.hpp @@ -72,8 +72,12 @@ struct CFinalInput { CFinalInput(int cIdx, float dt, const boo::DolphinControllerState& data, const CFinalInput& prevInput, float leftDiv, float rightDiv); CFinalInput(int cIdx, float dt, const CKeyboardMouseControllerData& data, const CFinalInput& prevInput); + 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; } u32 ControllerIdx() const { return x4_controllerIdx; }