Android: Removed three internal functions not used by SDL.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 27 Sep 2015 20:12:47 +0200
changeset 98803bbeb623181c
parent 9879 8465a79c9f85
child 9881 a49e278f1a8b
Android: Removed three internal functions not used by SDL.

They were not needed internally since the switch to the common EGL backend.

Thanks to the SDL mailing list for pointing out that the functions seem unused.
android-project/src/org/libsdl/app/SDLActivity.java
src/core/android/SDL_android.c
src/core/android/SDL_android.h
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Fri Sep 25 15:17:20 2015 -0300
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Sun Sep 27 20:12:47 2015 +0200
     1.3 @@ -427,7 +427,6 @@
     1.4      public static native void onNativeAccel(float x, float y, float z);
     1.5      public static native void onNativeSurfaceChanged();
     1.6      public static native void onNativeSurfaceDestroyed();
     1.7 -    public static native void nativeFlipBuffers();
     1.8      public static native int nativeAddJoystick(int device_id, String name,
     1.9                                                 int is_accelerometer, int nbuttons,
    1.10                                                 int naxes, int nhats, int nballs);
    1.11 @@ -437,13 +436,6 @@
    1.12      /**
    1.13       * This method is called by SDL using JNI.
    1.14       */
    1.15 -    public static void flipBuffers() {
    1.16 -        SDLActivity.nativeFlipBuffers();
    1.17 -    }
    1.18 -
    1.19 -    /**
    1.20 -     * This method is called by SDL using JNI.
    1.21 -     */
    1.22      public static boolean setActivityTitle(String title) {
    1.23          // Called from SDLMain() thread and can't directly affect the view
    1.24          return mSingleton.sendCommand(COMMAND_CHANGE_TITLE, title);
     2.1 --- a/src/core/android/SDL_android.c	Fri Sep 25 15:17:20 2015 -0300
     2.2 +++ b/src/core/android/SDL_android.c	Sun Sep 27 20:12:47 2015 +0200
     2.3 @@ -71,7 +71,6 @@
     2.4  
     2.5  /* method signatures */
     2.6  static jmethodID midGetNativeSurface;
     2.7 -static jmethodID midFlipBuffers;
     2.8  static jmethodID midAudioInit;
     2.9  static jmethodID midAudioWriteShortBuffer;
    2.10  static jmethodID midAudioWriteByteBuffer;
    2.11 @@ -119,8 +118,6 @@
    2.12  
    2.13      midGetNativeSurface = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    2.14                                  "getNativeSurface","()Landroid/view/Surface;");
    2.15 -    midFlipBuffers = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    2.16 -                                "flipBuffers","()V");
    2.17      midAudioInit = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    2.18                                  "audioInit", "(IZZI)I");
    2.19      midAudioWriteShortBuffer = (*mEnv)->GetStaticMethodID(mEnv, mActivityClass,
    2.20 @@ -134,7 +131,7 @@
    2.21  
    2.22      bHasNewData = SDL_FALSE;
    2.23  
    2.24 -    if(!midGetNativeSurface || !midFlipBuffers || !midAudioInit ||
    2.25 +    if (!midGetNativeSurface || !midAudioInit ||
    2.26         !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit || !midPollInputDevices) {
    2.27          __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly");
    2.28      }
    2.29 @@ -267,11 +264,6 @@
    2.30  
    2.31  }
    2.32  
    2.33 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeFlipBuffers(JNIEnv* env, jclass jcls)
    2.34 -{
    2.35 -    SDL_GL_SwapWindow(Android_Window);
    2.36 -}
    2.37 -
    2.38  /* Keydown */
    2.39  JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
    2.40                                      JNIEnv* env, jclass jcls, jint keycode)
    2.41 @@ -478,12 +470,6 @@
    2.42      return anw;
    2.43  }
    2.44  
    2.45 -void Android_JNI_SwapWindow(void)
    2.46 -{
    2.47 -    JNIEnv *mEnv = Android_JNI_GetEnv();
    2.48 -    (*mEnv)->CallStaticVoidMethod(mEnv, mActivityClass, midFlipBuffers);
    2.49 -}
    2.50 -
    2.51  void Android_JNI_SetActivityTitle(const char *title)
    2.52  {
    2.53      jmethodID mid;
     3.1 --- a/src/core/android/SDL_android.h	Fri Sep 25 15:17:20 2015 -0300
     3.2 +++ b/src/core/android/SDL_android.h	Sun Sep 27 20:12:47 2015 +0200
     3.3 @@ -33,9 +33,6 @@
     3.4  #include "SDL_rect.h"
     3.5  
     3.6  /* Interface from the SDL library into the Android Java activity */
     3.7 -/* extern SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, int red, int green, int blue, int alpha, int buffer, int depth, int stencil, int buffers, int samples);
     3.8 -extern SDL_bool Android_JNI_DeleteContext(void); */
     3.9 -extern void Android_JNI_SwapWindow(void);
    3.10  extern void Android_JNI_SetActivityTitle(const char *title);
    3.11  extern SDL_bool Android_JNI_GetAccelerometerValues(float values[3]);
    3.12  extern void Android_JNI_ShowTextInput(SDL_Rect *inputRect);
    3.13 @@ -64,7 +61,7 @@
    3.14  
    3.15  /* Power support */
    3.16  int Android_JNI_GetPowerInfo(int* plugged, int* charged, int* battery, int* seconds, int* percent);
    3.17 -    
    3.18 +
    3.19  /* Joystick support */
    3.20  void Android_JNI_PollInputDevices(void);
    3.21