Nunchuk: Stop the dereference dance
This commit is contained in:
parent
e20a0265de
commit
68a4979f35
|
@ -71,12 +71,12 @@ void Nunchuk::GetState(u8* const data, const bool focus)
|
||||||
|
|
||||||
nu_cal &cal = *(nu_cal*)®.calibration;
|
nu_cal &cal = *(nu_cal*)®.calibration;
|
||||||
nu_js cal_js[2];
|
nu_js cal_js[2];
|
||||||
cal_js[0] = *&cal.jx;
|
cal_js[0] = cal.jx;
|
||||||
cal_js[1] = *&cal.jy;
|
cal_js[1] = cal.jy;
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
ControlState &s = *&state[i];
|
ControlState &s = state[i];
|
||||||
nu_js c = *&cal_js[i];
|
nu_js c = cal_js[i];
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
s = s * abs(c.min - c.center) + c.center;
|
s = s * abs(c.min - c.center) + c.center;
|
||||||
else if (s > 0)
|
else if (s > 0)
|
||||||
|
|
Loading…
Reference in New Issue