mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-08 09:09:04 +00:00
Android: Let WiimoteEmu know whether we have accelerometer/gyroscope
This commit is contained in:
parent
4d838212e2
commit
c8b8a60033
5 changed files with 54 additions and 12 deletions
|
@ -265,6 +265,9 @@ public final class NativeLibrary
|
|||
Rumble.checkRumble(padID, state);
|
||||
}
|
||||
|
||||
public static native void SetMotionSensorsEnabled(boolean accelerometerEnabled,
|
||||
boolean gyroscopeEnabled);
|
||||
|
||||
public static native void NewGameIniFile();
|
||||
|
||||
public static native void LoadGameIniFile(String gameId);
|
||||
|
|
|
@ -101,10 +101,14 @@ public class MotionListener implements SensorEventListener
|
|||
mSensorManager.registerListener(this, mAccelSensor, SAMPLING_PERIOD_US);
|
||||
if (mGyroSensor != null)
|
||||
mSensorManager.registerListener(this, mGyroSensor, SAMPLING_PERIOD_US);
|
||||
|
||||
NativeLibrary.SetMotionSensorsEnabled(mAccelSensor != null, mGyroSensor != null);
|
||||
}
|
||||
|
||||
public void disable()
|
||||
{
|
||||
mSensorManager.unregisterListener(this);
|
||||
|
||||
NativeLibrary.SetMotionSensorsEnabled(false, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue