mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Android: Let WiimoteEmu know whether we have accelerometer/gyroscope
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user