Merged default into iOS-improvements iOS-improvements
authorAlex Szpakowski <slime73@gmail.com>
Sat, 24 Jan 2015 23:58:07 -0400
branchiOS-improvements
changeset 9535a66a7f7e8cd8
parent 9534 5b2b50804caa
parent 9314 8d826bc39a45
child 9536 3c87b8f9dc58
Merged default into iOS-improvements
src/joystick/iphoneos/SDL_sysjoystick.m
     1.1 --- a/CMakeLists.txt	Sat Jan 24 23:53:41 2015 -0400
     1.2 +++ b/CMakeLists.txt	Sat Jan 24 23:58:07 2015 -0400
     1.3 @@ -1050,7 +1050,7 @@
     1.4    endif()
     1.5  
     1.6    if(SDL_AUDIO)
     1.7 -    set(MACOSX_COREAUDIO 1)
     1.8 +    set(SDL_AUDIO_DRIVER_COREAUDIO 1)
     1.9      file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c)
    1.10      set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
    1.11      set(HAVE_SDL_AUDIO TRUE)
     2.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Sat Jan 24 23:53:41 2015 -0400
     2.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Sat Jan 24 23:58:07 2015 -0400
     2.3 @@ -392,7 +392,7 @@
     2.4      public static native void nativeQuit();
     2.5      public static native void nativePause();
     2.6      public static native void nativeResume();
     2.7 -    public static native void onNativeResize(int x, int y, int format);
     2.8 +    public static native void onNativeResize(int x, int y, int format, float rate);
     2.9      public static native int onNativePadDown(int device_id, int keycode);
    2.10      public static native int onNativePadUp(int device_id, int keycode);
    2.11      public static native void onNativeJoy(int device_id, int axis,
    2.12 @@ -1041,7 +1041,7 @@
    2.13  
    2.14          mWidth = width;
    2.15          mHeight = height;
    2.16 -        SDLActivity.onNativeResize(width, height, sdlFormat);
    2.17 +        SDLActivity.onNativeResize(width, height, sdlFormat, mDisplay.getRefreshRate());
    2.18          Log.v("SDL", "Window size:" + width + "x"+height);
    2.19  
    2.20          // Set mIsSurfaceReady to 'true' *before* making a call to handleResume
     3.1 --- a/src/core/android/SDL_android.c	Sat Jan 24 23:53:41 2015 -0400
     3.2 +++ b/src/core/android/SDL_android.c	Sat Jan 24 23:58:07 2015 -0400
     3.3 @@ -143,9 +143,9 @@
     3.4  /* Resize */
     3.5  JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize(
     3.6                                      JNIEnv* env, jclass jcls,
     3.7 -                                    jint width, jint height, jint format)
     3.8 +                                    jint width, jint height, jint format, jfloat rate)
     3.9  {
    3.10 -    Android_SetScreenResolution(width, height, format);
    3.11 +    Android_SetScreenResolution(width, height, format, rate);
    3.12  }
    3.13  
    3.14  /* Paddown */
     4.1 --- a/src/joystick/haiku/SDL_haikujoystick.cc	Sat Jan 24 23:53:41 2015 -0400
     4.2 +++ b/src/joystick/haiku/SDL_haikujoystick.cc	Sat Jan 24 23:58:07 2015 -0400
     4.3 @@ -53,8 +53,7 @@
     4.4      static int SDL_SYS_numjoysticks = 0;
     4.5  
     4.6  /* Function to scan the system for joysticks.
     4.7 - * This function should set SDL_numjoysticks to the number of available
     4.8 - * joysticks.  Joystick 0 should be the system default joystick.
     4.9 + * Joystick 0 should be the system default joystick.
    4.10   * It should return 0, or -1 on an unrecoverable fatal error.
    4.11   */
    4.12      int SDL_SYS_JoystickInit(void)
     5.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m	Sat Jan 24 23:53:41 2015 -0400
     5.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Sat Jan 24 23:58:07 2015 -0400
     5.3 @@ -39,8 +39,7 @@
     5.4  static int numjoysticks = 0;
     5.5  
     5.6  /* Function to scan the system for joysticks.
     5.7 - * This function should set SDL_numjoysticks to the number of available
     5.8 - * joysticks.  Joystick 0 should be the system default joystick.
     5.9 + * Joystick 0 should be the system default joystick.
    5.10   * It should return 0, or -1 on an unrecoverable fatal error.
    5.11   */
    5.12  int
     6.1 --- a/src/joystick/psp/SDL_sysjoystick.c	Sat Jan 24 23:53:41 2015 -0400
     6.2 +++ b/src/joystick/psp/SDL_sysjoystick.c	Sat Jan 24 23:58:07 2015 -0400
     6.3 @@ -97,16 +97,13 @@
     6.4  
     6.5  
     6.6  /* Function to scan the system for joysticks.
     6.7 - * This function should set SDL_numjoysticks to the number of available
     6.8 - * joysticks.  Joystick 0 should be the system default joystick.
     6.9 + * Joystick 0 should be the system default joystick.
    6.10   * It should return number of joysticks, or -1 on an unrecoverable fatal error.
    6.11   */
    6.12  int SDL_SYS_JoystickInit(void)
    6.13  {
    6.14      int i;
    6.15  
    6.16 -/*  SDL_numjoysticks = 1; */
    6.17 -
    6.18      /* Setup input */
    6.19      sceCtrlSetSamplingCycle(0);
    6.20      sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
     7.1 --- a/src/joystick/windows/SDL_mmjoystick.c	Sat Jan 24 23:53:41 2015 -0400
     7.2 +++ b/src/joystick/windows/SDL_mmjoystick.c	Sat Jan 24 23:58:07 2015 -0400
     7.3 @@ -143,8 +143,7 @@
     7.4  static int SDL_SYS_numjoysticks = 0;
     7.5  
     7.6  /* Function to scan the system for joysticks.
     7.7 - * This function should set SDL_numjoysticks to the number of available
     7.8 - * joysticks.  Joystick 0 should be the system default joystick.
     7.9 + * Joystick 0 should be the system default joystick.
    7.10   * It should return 0, or -1 on an unrecoverable fatal error.
    7.11   */
    7.12  int
     8.1 --- a/src/joystick/windows/SDL_windowsjoystick.c	Sat Jan 24 23:53:41 2015 -0400
     8.2 +++ b/src/joystick/windows/SDL_windowsjoystick.c	Sat Jan 24 23:58:07 2015 -0400
     8.3 @@ -278,8 +278,7 @@
     8.4  }
     8.5  
     8.6  /* Function to scan the system for joysticks.
     8.7 - * This function should set SDL_numjoysticks to the number of available
     8.8 - * joysticks.  Joystick 0 should be the system default joystick.
     8.9 + * Joystick 0 should be the system default joystick.
    8.10   * It should return 0, or -1 on an unrecoverable fatal error.
    8.11   */
    8.12  int
     9.1 --- a/src/video/android/SDL_androidvideo.c	Sat Jan 24 23:53:41 2015 -0400
     9.2 +++ b/src/video/android/SDL_androidvideo.c	Sat Jan 24 23:58:07 2015 -0400
     9.3 @@ -64,6 +64,8 @@
     9.4  int Android_ScreenWidth = 0;
     9.5  int Android_ScreenHeight = 0;
     9.6  Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
     9.7 +int Android_ScreenRate = 0;
     9.8 +
     9.9  SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
    9.10  
    9.11  /* Currently only one window */
    9.12 @@ -166,7 +168,7 @@
    9.13      mode.format = Android_ScreenFormat;
    9.14      mode.w = Android_ScreenWidth;
    9.15      mode.h = Android_ScreenHeight;
    9.16 -    mode.refresh_rate = 0;
    9.17 +    mode.refresh_rate = Android_ScreenRate;
    9.18      mode.driverdata = NULL;
    9.19      if (SDL_AddBasicVideoDisplay(&mode) < 0) {
    9.20          return -1;
    9.21 @@ -189,11 +191,12 @@
    9.22  
    9.23  /* This function gets called before VideoInit() */
    9.24  void
    9.25 -Android_SetScreenResolution(int width, int height, Uint32 format)
    9.26 +Android_SetScreenResolution(int width, int height, Uint32 format, float rate)
    9.27  {
    9.28      Android_ScreenWidth = width;
    9.29      Android_ScreenHeight = height;
    9.30      Android_ScreenFormat = format;
    9.31 +    Android_ScreenRate = rate;
    9.32  
    9.33      if (Android_Window) {
    9.34          SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);
    10.1 --- a/src/video/android/SDL_androidvideo.h	Sat Jan 24 23:53:41 2015 -0400
    10.2 +++ b/src/video/android/SDL_androidvideo.h	Sat Jan 24 23:58:07 2015 -0400
    10.3 @@ -28,7 +28,7 @@
    10.4  #include "../SDL_sysvideo.h"
    10.5  
    10.6  /* Called by the JNI layer when the screen changes size or format */
    10.7 -extern void Android_SetScreenResolution(int width, int height, Uint32 format);
    10.8 +extern void Android_SetScreenResolution(int width, int height, Uint32 format, float rate);
    10.9  
   10.10  /* Private display data */
   10.11  
    11.1 --- a/test/testautomation_video.c	Sat Jan 24 23:53:41 2015 -0400
    11.2 +++ b/test/testautomation_video.c	Sat Jan 24 23:58:07 2015 -0400
    11.3 @@ -541,7 +541,6 @@
    11.4  {
    11.5    const char *invalidWindowError = "Invalid window";
    11.6    char *lastError;
    11.7 -  const char* title = "video_getWindowBrightnessNegative Test Window";
    11.8    float result;
    11.9  
   11.10    /* Call against invalid window */
   11.11 @@ -728,7 +727,6 @@
   11.12  int
   11.13  video_getWindowGammaRampNegative(void *arg)
   11.14  {
   11.15 -  const char* title = "video_getWindowGammaRampNegative Test Window";
   11.16    Uint16 red[256];
   11.17    Uint16 green[256];
   11.18    Uint16 blue[256];