Changed SDL_HINT_ACCEL_AS_JOY to SDL_HINT_ACCELEROMETER_AS_JOYSTICK to be more clear.

This commit is contained in:
Sam Lantinga 2014-03-01 12:21:15 -08:00
parent 54ba385b4e
commit 63106e4729
3 changed files with 5 additions and 5 deletions

View file

@ -41,7 +41,7 @@ Android:
the required runtime version remains at 10, but on such devices joystick the required runtime version remains at 10, but on such devices joystick
support won't be available). support won't be available).
* Hotplugging support for joysticks * Hotplugging support for joysticks
* Added a hint SDL_HINT_ACCEL_AS_JOY to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default. * Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------

View file

@ -244,7 +244,7 @@ extern "C" {
* "0" - List only real joysticks and accept input from them * "0" - List only real joysticks and accept input from them
* "1" - List real joysticks along with the accelerometer as if it were a 3 axis joystick (the default). * "1" - List real joysticks along with the accelerometer as if it were a 3 axis joystick (the default).
*/ */
#define SDL_HINT_ACCEL_AS_JOY "SDL_ACCEL_AS_JOY" #define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK"
/** /**

View file

@ -379,11 +379,11 @@ Android_RemoveJoystick(int device_id)
int int
SDL_SYS_JoystickInit(void) SDL_SYS_JoystickInit(void)
{ {
const char *env; const char *hint;
SDL_SYS_JoystickDetect(); SDL_SYS_JoystickDetect();
env = SDL_GetHint(SDL_HINT_ACCEL_AS_JOY); hint = SDL_GetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK);
if (!env || SDL_atoi(env)) { if (!hint || SDL_atoi(hint)) {
/* Default behavior, accelerometer as joystick */ /* Default behavior, accelerometer as joystick */
Android_AddJoystick(ANDROID_ACCELEROMETER_DEVICE_ID, ANDROID_ACCELEROMETER_NAME, SDL_TRUE, 0, 3, 0, 0); Android_AddJoystick(ANDROID_ACCELEROMETER_DEVICE_ID, ANDROID_ACCELEROMETER_NAME, SDL_TRUE, 0, 3, 0, 0);
} }