Deprecate t.accelerometerjoystick

This commit is contained in:
Miku AuahDark
2022-12-05 23:46:52 +08:00
parent e73cc07130
commit 9834c913dd
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -205,7 +205,7 @@ function love.init()
identity = false,
appendidentity = false,
externalstorage = false, -- Only relevant for Android.
accelerometerjoystick = true, -- Only relevant for Android / iOS.
accelerometerjoystick = nil, -- Only relevant for Android / iOS, deprecated.
gammacorrect = false,
highdpi = false,
renderers = nil,
+4
View File
@@ -784,6 +784,10 @@ int w__setAccelerometerAsJoystick(lua_State *L)
{
bool enable = (bool) lua_toboolean(L, 1);
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;
}
#endif // LOVE_LEGENDARY_ACCELEROMETER_AS_JOYSTICK_HACK