Merged default into iOS-improvements

This commit is contained in:
Alex Szpakowski 2015-01-24 23:58:07 -04:00
commit 66867e654c
11 changed files with 16 additions and 22 deletions

View File

@ -1050,7 +1050,7 @@ elseif(APPLE)
endif() endif()
if(SDL_AUDIO) if(SDL_AUDIO)
set(MACOSX_COREAUDIO 1) set(SDL_AUDIO_DRIVER_COREAUDIO 1)
file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c) file(GLOB AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/coreaudio/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES}) set(SOURCE_FILES ${SOURCE_FILES} ${AUDIO_SOURCES})
set(HAVE_SDL_AUDIO TRUE) set(HAVE_SDL_AUDIO TRUE)

View File

@ -392,7 +392,7 @@ public class SDLActivity extends Activity {
public static native void nativeQuit(); public static native void nativeQuit();
public static native void nativePause(); public static native void nativePause();
public static native void nativeResume(); public static native void nativeResume();
public static native void onNativeResize(int x, int y, int format); public static native void onNativeResize(int x, int y, int format, float rate);
public static native int onNativePadDown(int device_id, int keycode); public static native int onNativePadDown(int device_id, int keycode);
public static native int onNativePadUp(int device_id, int keycode); public static native int onNativePadUp(int device_id, int keycode);
public static native void onNativeJoy(int device_id, int axis, public static native void onNativeJoy(int device_id, int axis,
@ -1041,7 +1041,7 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
mWidth = width; mWidth = width;
mHeight = height; mHeight = height;
SDLActivity.onNativeResize(width, height, sdlFormat); SDLActivity.onNativeResize(width, height, sdlFormat, mDisplay.getRefreshRate());
Log.v("SDL", "Window size:" + width + "x"+height); Log.v("SDL", "Window size:" + width + "x"+height);
// Set mIsSurfaceReady to 'true' *before* making a call to handleResume // Set mIsSurfaceReady to 'true' *before* making a call to handleResume

View File

@ -143,9 +143,9 @@ JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls)
/* Resize */ /* Resize */
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize( JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize(
JNIEnv* env, jclass jcls, JNIEnv* env, jclass jcls,
jint width, jint height, jint format) jint width, jint height, jint format, jfloat rate)
{ {
Android_SetScreenResolution(width, height, format); Android_SetScreenResolution(width, height, format, rate);
} }
/* Paddown */ /* Paddown */

View File

@ -53,8 +53,7 @@ extern "C"
static int SDL_SYS_numjoysticks = 0; static int SDL_SYS_numjoysticks = 0;
/* Function to scan the system for joysticks. /* Function to scan the system for joysticks.
* This function should set SDL_numjoysticks to the number of available * Joystick 0 should be the system default joystick.
* joysticks. Joystick 0 should be the system default joystick.
* It should return 0, or -1 on an unrecoverable fatal error. * It should return 0, or -1 on an unrecoverable fatal error.
*/ */
int SDL_SYS_JoystickInit(void) int SDL_SYS_JoystickInit(void)

View File

@ -39,8 +39,7 @@ static CMMotionManager *motionManager = nil;
static int numjoysticks = 0; static int numjoysticks = 0;
/* Function to scan the system for joysticks. /* Function to scan the system for joysticks.
* This function should set SDL_numjoysticks to the number of available * Joystick 0 should be the system default joystick.
* joysticks. Joystick 0 should be the system default joystick.
* It should return 0, or -1 on an unrecoverable fatal error. * It should return 0, or -1 on an unrecoverable fatal error.
*/ */
int int

View File

@ -97,16 +97,13 @@ int JoystickUpdate(void *data)
/* Function to scan the system for joysticks. /* Function to scan the system for joysticks.
* This function should set SDL_numjoysticks to the number of available * Joystick 0 should be the system default joystick.
* joysticks. Joystick 0 should be the system default joystick.
* It should return number of joysticks, or -1 on an unrecoverable fatal error. * It should return number of joysticks, or -1 on an unrecoverable fatal error.
*/ */
int SDL_SYS_JoystickInit(void) int SDL_SYS_JoystickInit(void)
{ {
int i; int i;
/* SDL_numjoysticks = 1; */
/* Setup input */ /* Setup input */
sceCtrlSetSamplingCycle(0); sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG); sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);

View File

@ -143,8 +143,7 @@ GetJoystickName(int index, const char *szRegKey)
static int SDL_SYS_numjoysticks = 0; static int SDL_SYS_numjoysticks = 0;
/* Function to scan the system for joysticks. /* Function to scan the system for joysticks.
* This function should set SDL_numjoysticks to the number of available * Joystick 0 should be the system default joystick.
* joysticks. Joystick 0 should be the system default joystick.
* It should return 0, or -1 on an unrecoverable fatal error. * It should return 0, or -1 on an unrecoverable fatal error.
*/ */
int int

View File

@ -278,8 +278,7 @@ void SDL_SYS_AddJoystickDevice(JoyStick_DeviceData *device)
} }
/* Function to scan the system for joysticks. /* Function to scan the system for joysticks.
* This function should set SDL_numjoysticks to the number of available * Joystick 0 should be the system default joystick.
* joysticks. Joystick 0 should be the system default joystick.
* It should return 0, or -1 on an unrecoverable fatal error. * It should return 0, or -1 on an unrecoverable fatal error.
*/ */
int int

View File

@ -64,6 +64,8 @@ extern int Android_GLES_LoadLibrary(_THIS, const char *path);
int Android_ScreenWidth = 0; int Android_ScreenWidth = 0;
int Android_ScreenHeight = 0; int Android_ScreenHeight = 0;
Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN; Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
int Android_ScreenRate = 0;
SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL; SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
/* Currently only one window */ /* Currently only one window */
@ -166,7 +168,7 @@ Android_VideoInit(_THIS)
mode.format = Android_ScreenFormat; mode.format = Android_ScreenFormat;
mode.w = Android_ScreenWidth; mode.w = Android_ScreenWidth;
mode.h = Android_ScreenHeight; mode.h = Android_ScreenHeight;
mode.refresh_rate = 0; mode.refresh_rate = Android_ScreenRate;
mode.driverdata = NULL; mode.driverdata = NULL;
if (SDL_AddBasicVideoDisplay(&mode) < 0) { if (SDL_AddBasicVideoDisplay(&mode) < 0) {
return -1; return -1;
@ -189,11 +191,12 @@ Android_VideoQuit(_THIS)
/* This function gets called before VideoInit() */ /* This function gets called before VideoInit() */
void void
Android_SetScreenResolution(int width, int height, Uint32 format) Android_SetScreenResolution(int width, int height, Uint32 format, float rate)
{ {
Android_ScreenWidth = width; Android_ScreenWidth = width;
Android_ScreenHeight = height; Android_ScreenHeight = height;
Android_ScreenFormat = format; Android_ScreenFormat = format;
Android_ScreenRate = rate;
if (Android_Window) { if (Android_Window) {
SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height); SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);

View File

@ -28,7 +28,7 @@
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
/* Called by the JNI layer when the screen changes size or format */ /* Called by the JNI layer when the screen changes size or format */
extern void Android_SetScreenResolution(int width, int height, Uint32 format); extern void Android_SetScreenResolution(int width, int height, Uint32 format, float rate);
/* Private display data */ /* Private display data */

View File

@ -541,7 +541,6 @@ video_getWindowBrightnessNegative(void *arg)
{ {
const char *invalidWindowError = "Invalid window"; const char *invalidWindowError = "Invalid window";
char *lastError; char *lastError;
const char* title = "video_getWindowBrightnessNegative Test Window";
float result; float result;
/* Call against invalid window */ /* Call against invalid window */
@ -728,7 +727,6 @@ video_getWindowGammaRamp(void *arg)
int int
video_getWindowGammaRampNegative(void *arg) video_getWindowGammaRampNegative(void *arg)
{ {
const char* title = "video_getWindowGammaRampNegative Test Window";
Uint16 red[256]; Uint16 red[256];
Uint16 green[256]; Uint16 green[256];
Uint16 blue[256]; Uint16 blue[256];