Skip to content

Commit

Permalink
Merged default into iOS-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Apr 8, 2015
2 parents df98b11 + a210dbc commit 26c2811
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 234 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -243,7 +243,7 @@ set_option(DUMMYAUDIO "Support the dummy audio driver" ON)
set_option(VIDEO_DIRECTFB "Use DirectFB video driver" OFF)
dep_option(DIRECTFB_SHARED "Dynamically load directfb support" ON "VIDEO_DIRECTFB" OFF)
set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND_SHARED" OFF)
dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
set_option(VIDEO_DUMMY "Use dummy video driver" ON)
set_option(VIDEO_OPENGL "Include OpenGL support" ON)
set_option(VIDEO_OPENGLES "Include OpenGL ES support" ON)
Expand Down
2 changes: 2 additions & 0 deletions android-project/src/org/libsdl/app/SDLActivity.java
Expand Up @@ -114,6 +114,8 @@ public static void initialize() {
// Setup
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.v("SDL", "Device: " + android.os.Build.DEVICE);
Log.v("SDL", "Model: " + android.os.Build.MODEL);
Log.v("SDL", "onCreate():" + mSingleton);
super.onCreate(savedInstanceState);

Expand Down
2 changes: 1 addition & 1 deletion cmake/macros.cmake
Expand Up @@ -66,7 +66,7 @@ endmacro()

macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_DEFINITIONS "-ObjC ${PREV_REQUIRED_DEFS}")
set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}")
CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
endmacro()
Expand Down
2 changes: 1 addition & 1 deletion docs/README-gesture.md
@@ -1,6 +1,6 @@
Dollar Gestures
===========================================================================
SDL Provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.

Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.

Expand Down
4 changes: 3 additions & 1 deletion include/SDL_assert.h
Expand Up @@ -86,8 +86,10 @@ This also solves the problem of...
disable assertions.
*/

/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
this condition isn't constant. And looks like an owl's face! */
#ifdef _MSC_VER /* stupid /W4 warnings. */
#define SDL_NULL_WHILE_LOOP_CONDITION (-1 == __LINE__)
#define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
#else
#define SDL_NULL_WHILE_LOOP_CONDITION (0)
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_stdinc.h
Expand Up @@ -226,7 +226,7 @@ typedef uint64_t Uint64;
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
#define SDL_SCANF_VARARG_FUNC( fmtargnumber )
#else
#if _MSC_VER >= 1600 /* VS 2010 and above */
#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
#include <sal.h>

#define SDL_IN_BYTECAP(x) _In_bytecount_(x)
Expand Down
6 changes: 4 additions & 2 deletions src/core/linux/SDL_ibus.c
Expand Up @@ -479,8 +479,10 @@ SDL_IBus_Init(void)
inotify_wd = inotify_add_watch(inotify_fd, addr_file, IN_CREATE | IN_MODIFY);
SDL_free(addr_file);

result = IBus_SetupConnection(dbus, addr);
SDL_free(addr);
if (addr) {
result = IBus_SetupConnection(dbus, addr);
SDL_free(addr);
}
}

return result;
Expand Down
5 changes: 5 additions & 0 deletions src/joystick/windows/SDL_dinputjoystick.c
Expand Up @@ -340,6 +340,11 @@ EnumJoysticksCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext)
{
JoyStick_DeviceData *pNewJoystick;
JoyStick_DeviceData *pPrevJoystick = NULL;
const DWORD devtype = (pdidInstance->dwDevType & 0xFF);

if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD)) {
return DIENUM_CONTINUE; /* Ignore touchpads, etc. */
}

if (SDL_IsXInputDevice(&pdidInstance->guidProduct)) {
return DIENUM_CONTINUE; /* ignore XInput devices here, keep going. */
Expand Down
13 changes: 8 additions & 5 deletions src/video/SDL_video.c
Expand Up @@ -1265,6 +1265,12 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
h = 1;
}

/* Some platforms blow up if the windows are too large. Raise it later? */
if ((w > 16384) || (h > 16384)) {
SDL_SetError("Window is too large.");
return NULL;
}

/* Some platforms have OpenGL enabled by default */
#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__ || __NACL__
flags |= SDL_WINDOW_OPENGL;
Expand Down Expand Up @@ -1501,11 +1507,8 @@ SDL_SetWindowTitle(SDL_Window * window, const char *title)
return;
}
SDL_free(window->title);
if (title && *title) {
window->title = SDL_strdup(title);
} else {
window->title = NULL;
}

window->title = SDL_strdup(title ? title : "");

if (_this->SetWindowTitle) {
_this->SetWindowTitle(_this, window);
Expand Down
9 changes: 1 addition & 8 deletions src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -1189,16 +1189,9 @@ - (void)resetCursorRects
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
NSString *string;

if(window->title) {
string = [[NSString alloc] initWithUTF8String:window->title];
} else {
string = [[NSString alloc] init];
}
NSString *string = [[NSString alloc] initWithUTF8String:window->title];
[nswindow setTitle:string];
[string release];

[pool release];
}

Expand Down
2 changes: 1 addition & 1 deletion src/video/directfb/SDL_DirectFB_WM.c
Expand Up @@ -161,7 +161,7 @@ DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window)
y, w - 2 * d);

/* Caption */
if (window->title) {
if (*window->title) {
s->SetColor(s, COLOR_EXPAND(t->font_color));
DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title);
}
Expand Down
6 changes: 1 addition & 5 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -222,11 +222,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo
{
@autoreleasepool {
SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
if (window->title) {
data.viewcontroller.title = @(window->title);
} else {
data.viewcontroller.title = nil;
}
data.viewcontroller.title = @(window->title);
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/video/wayland/SDL_waylandmouse.c
Expand Up @@ -356,8 +356,7 @@ Wayland_WarpMouseGlobal(int x, int y)
static int
Wayland_SetRelativeMouseMode(SDL_bool enabled)
{
SDL_Unsupported();
return -1;
return SDL_Unsupported();
}

void
Expand Down

0 comments on commit 26c2811

Please sign in to comment.