Added new flag t.accelerometerjoystick to love.conf (true by default.) When set to false on mobile, the device's accelerometer will not show up as a joystick even if the joystick module is loaded.

This can reduce CPU usage if you don't use the accelerometer but you don't want to disable the joystick module entirely.
This commit is contained in:
Alex Szpakowski
2015-03-07 15:36:53 -04:00
parent 7e99ea6839
commit afcad4defc
4 changed files with 48 additions and 0 deletions
+6
View File
@@ -361,6 +361,7 @@ function love.init()
console = false, -- Only relevant for windows.
identity = false,
appendidentity = false,
accelerometerjoystick = true, -- Only relevant for Android / iOS.
}
-- Console hack, part 1.
@@ -389,6 +390,11 @@ function love.init()
love._openConsole()
end
-- Hack for disabling accelerometer-as-joystick on Android / iOS.
if love._setAccelerometerAsJoystick then
love._setAccelerometerAsJoystick(c.accelerometerjoystick)
end
-- Gets desired modules.
for k,v in ipairs{
"thread",