From 07556b484987e956ff1dfe53b29a9d9147da395e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 10 Feb 2015 11:40:28 -0500 Subject: [PATCH] WiimoteEmu: Change define into a variable and move it to where it's used. --- Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp index 47f1944786..fb1b6fa472 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp @@ -422,11 +422,13 @@ void Wiimote::GetAccelData(u8* const data, const ReportFeatures& rptf) core.acc_y_lsb = (y >> 1) & 0x1; core.acc_z_lsb = (z >> 1) & 0x1; } -#define kCutoffFreq 5.0 -inline void LowPassFilter(double & var, double newval, double period) + +inline void LowPassFilter(double& var, double newval, double period) { - double RC=1.0/kCutoffFreq; - double alpha=period/(period+RC); + static const double CUTOFF_FREQUENCY = 5.0; + + double RC = 1.0 / CUTOFF_FREQUENCY; + double alpha = period / (period + RC); var = newval * alpha + var * (1.0 - alpha); }