summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii/wii_camera.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-20 21:07:24 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-12-24 19:32:10 +0100
commit519b28224ea39ea0f42cdf83dd7b1e67b4b3caf3 (patch)
treee30b20aec096b3660184b60c25fd21005f5edd59 /tracker-wii/wii_camera.cpp
parent582db45e356d5e7eb90606107c54db2e25cec644 (diff)
tracker/wii: fix function-static data
Diffstat (limited to 'tracker-wii/wii_camera.cpp')
-rw-r--r--tracker-wii/wii_camera.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp
index c8276796..4054523a 100644
--- a/tracker-wii/wii_camera.cpp
+++ b/tracker-wii/wii_camera.cpp
@@ -282,16 +282,14 @@ void WIICamera::get_status(struct wii_info& wii)
wii.bBatteryDrained = m_pDev->bBatteryDrained;
//draw horizon
- static int p = 0;
- static int r = 0;
if (m_pDev->Nunchuk.Acceleration.Orientation.UpdateAge < 10)
{
- p = m_pDev->Acceleration.Orientation.Pitch;
- r = m_pDev->Acceleration.Orientation.Roll;
+ horizon.p = m_pDev->Acceleration.Orientation.Pitch;
+ horizon.r = m_pDev->Acceleration.Orientation.Roll;
}
- wii.Pitch = p;
- wii.Roll = r;
+ wii.Pitch = horizon.p;
+ wii.Roll = horizon.r;
}
void WIICamera::on_state_change(wiimote &remote,