mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 19:55:19 +00:00
Android: Remove unused accelerometer-related code and definitions
That also covers removal of the call `SDLActivity.onNativeAccel`, plus a change of comment under SDL_android.c. Definitions were previously used while an accelerometer could be listed as a joystick.
This commit is contained in:
parent
8a701808a6
commit
ed2c8036a7
4 changed files with 1 additions and 43 deletions
|
|
@ -1103,7 +1103,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||
int action, float x,
|
||||
float y, float p);
|
||||
public static native void onNativePen(int penId, int device_type, int button, int action, float x, float y, float p);
|
||||
public static native void onNativeAccel(float x, float y, float z);
|
||||
public static native void onNativeClipboardChanged();
|
||||
public static native void onNativeSurfaceCreated();
|
||||
public static native void onNativeSurfaceChanged();
|
||||
|
|
|
|||
|
|
@ -379,12 +379,6 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
|||
SDLActivity.mCurrentRotation = newRotation;
|
||||
SDLActivity.onNativeRotationChanged(newRotation);
|
||||
}
|
||||
|
||||
SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
|
||||
y / SensorManager.GRAVITY_EARTH,
|
||||
event.values[2] / SensorManager.GRAVITY_EARTH);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,10 +140,6 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativePen)(
|
|||
JNIEnv *env, jclass jcls,
|
||||
jint pen_id_in, jint device_type, jint button, jint action, jfloat x, jfloat y, jfloat p);
|
||||
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeAccel)(
|
||||
JNIEnv *env, jclass jcls,
|
||||
jfloat x, jfloat y, jfloat z);
|
||||
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeClipboardChanged)(
|
||||
JNIEnv *env, jclass jcls);
|
||||
|
||||
|
|
@ -237,7 +233,6 @@ static JNINativeMethod SDLActivity_tab[] = {
|
|||
{ "onNativePinchEnd", "()V", SDL_JAVA_INTERFACE(onNativePinchEnd) },
|
||||
{ "onNativeMouse", "(IIFFZ)V", SDL_JAVA_INTERFACE(onNativeMouse) },
|
||||
{ "onNativePen", "(IIIIFFF)V", SDL_JAVA_INTERFACE(onNativePen) },
|
||||
{ "onNativeAccel", "(FFF)V", SDL_JAVA_INTERFACE(onNativeAccel) },
|
||||
{ "onNativeClipboardChanged", "()V", SDL_JAVA_INTERFACE(onNativeClipboardChanged) },
|
||||
{ "nativeLowMemory", "()V", SDL_JAVA_INTERFACE(nativeLowMemory) },
|
||||
{ "onNativeLocaleChanged", "()V", SDL_JAVA_INTERFACE(onNativeLocaleChanged) },
|
||||
|
|
@ -420,11 +415,9 @@ static jmethodID midHapticRun;
|
|||
static jmethodID midHapticRumble;
|
||||
static jmethodID midHapticStop;
|
||||
|
||||
// Accelerometer data storage
|
||||
// display orientation
|
||||
static SDL_DisplayOrientation displayNaturalOrientation;
|
||||
static SDL_DisplayOrientation displayCurrentOrientation;
|
||||
static float fLastAccelerometer[3];
|
||||
static bool bHasNewData;
|
||||
|
||||
static bool bHasEnvironmentVariables;
|
||||
|
||||
|
|
@ -1476,17 +1469,6 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativePen)(
|
|||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
}
|
||||
|
||||
// Accelerometer
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeAccel)(
|
||||
JNIEnv *env, jclass jcls,
|
||||
jfloat x, jfloat y, jfloat z)
|
||||
{
|
||||
fLastAccelerometer[0] = x;
|
||||
fLastAccelerometer[1] = y;
|
||||
fLastAccelerometer[2] = z;
|
||||
bHasNewData = true;
|
||||
}
|
||||
|
||||
// Clipboard
|
||||
JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeClipboardChanged)(
|
||||
JNIEnv *env, jclass jcls)
|
||||
|
|
@ -1762,22 +1744,6 @@ bool Android_JNI_ShouldMinimizeOnFocusLoss(void)
|
|||
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midShouldMinimizeOnFocusLoss);
|
||||
}
|
||||
|
||||
bool Android_JNI_GetAccelerometerValues(float values[3])
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (bHasNewData) {
|
||||
int i;
|
||||
for (i = 0; i < 3; ++i) {
|
||||
values[i] = fLastAccelerometer[i];
|
||||
}
|
||||
bHasNewData = false;
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Audio support
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ extern void Android_JNI_SetOrientation(int w, int h, int resizable, const char *
|
|||
extern void Android_JNI_MinimizeWindow(void);
|
||||
extern bool Android_JNI_ShouldMinimizeOnFocusLoss(void);
|
||||
|
||||
extern bool Android_JNI_GetAccelerometerValues(float values[3]);
|
||||
extern void Android_JNI_ShowScreenKeyboard(int input_type, SDL_Rect *inputRect);
|
||||
extern void Android_JNI_HideScreenKeyboard(void);
|
||||
extern ANativeWindow *Android_JNI_GetNativeWindow(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue