mirror of
https://github.com/love2d/love.git
synced 2026-08-21 05:00:08 +02:00
Deprecate t.accelerometerjoystick
This commit is contained in:
@@ -205,7 +205,7 @@ function love.init()
|
|||||||
identity = false,
|
identity = false,
|
||||||
appendidentity = false,
|
appendidentity = false,
|
||||||
externalstorage = false, -- Only relevant for Android.
|
externalstorage = false, -- Only relevant for Android.
|
||||||
accelerometerjoystick = true, -- Only relevant for Android / iOS.
|
accelerometerjoystick = nil, -- Only relevant for Android / iOS, deprecated.
|
||||||
gammacorrect = false,
|
gammacorrect = false,
|
||||||
highdpi = false,
|
highdpi = false,
|
||||||
renderers = nil,
|
renderers = nil,
|
||||||
|
|||||||
@@ -784,6 +784,10 @@ int w__setAccelerometerAsJoystick(lua_State *L)
|
|||||||
{
|
{
|
||||||
bool enable = (bool) lua_toboolean(L, 1);
|
bool enable = (bool) lua_toboolean(L, 1);
|
||||||
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, enable ? "1" : "0");
|
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, enable ? "1" : "0");
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
love::luax_markdeprecated(L, 1, "accelerometerjoystick", love::API_FIELD, love::DEPRECATED_REPLACED, "love.sensor module");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif // LOVE_LEGENDARY_ACCELEROMETER_AS_JOYSTICK_HACK
|
#endif // LOVE_LEGENDARY_ACCELEROMETER_AS_JOYSTICK_HACK
|
||||||
|
|||||||
Reference in New Issue
Block a user