mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user