early-access version 2847

This commit is contained in:
pineappleEA
2022-07-19 05:48:31 +02:00
parent ba74a2373c
commit 05e3c38e7f
498 changed files with 16027 additions and 27028 deletions
+4 -4
View File
@@ -87,7 +87,7 @@ static id keyboard_disconnect_observer = nil;
static void OnGCKeyboardConnected(GCKeyboard *keyboard) API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0))
{
keyboard_connected = SDL_TRUE;
keyboard.keyboardInput.keyChangedHandler = ^(GCKeyboardInput *kbrd, GCControllerButtonInput *key, GCKeyCode keyCode, BOOL pressed)
keyboard.keyboardInput.keyChangedHandler = ^(GCKeyboardInput *keyboard, GCControllerButtonInput *key, GCKeyCode keyCode, BOOL pressed)
{
SDL_SendKeyboardKey(pressed ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)keyCode);
};
@@ -225,15 +225,15 @@ static void OnGCMouseConnected(GCMouse *mouse) API_AVAILABLE(macos(11.0), ios(14
};
int auxiliary_button = SDL_BUTTON_X1;
for (GCControllerButtonInput *btn in mouse.mouseInput.auxiliaryButtons) {
btn.pressedChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed)
for (GCControllerButtonInput *button in mouse.mouseInput.auxiliaryButtons) {
button.pressedChangedHandler = ^(GCControllerButtonInput *button, float value, BOOL pressed)
{
OnGCMouseButtonChanged(mouseID, auxiliary_button, pressed);
};
++auxiliary_button;
}
mouse.mouseInput.mouseMovedHandler = ^(GCMouseInput *mouseInput, float deltaX, float deltaY)
mouse.mouseInput.mouseMovedHandler = ^(GCMouseInput *mouse, float deltaX, float deltaY)
{
if (SDL_GCMouseRelativeMode()) {
SDL_SendMouseMotion(SDL_GetMouseFocus(), mouseID, 1, (int)deltaX, -(int)deltaY);
+6 -20
View File
@@ -86,7 +86,7 @@ UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messageboxdata, in
action = [UIAlertAction actionWithTitle:@(sdlButton->text)
style:style
handler:^(UIAlertAction *alertAction) {
handler:^(UIAlertAction *action) {
clickedindex = (int)(sdlButton - messageboxdata->buttons);
}];
[alert addAction:action];
@@ -186,8 +186,8 @@ UIKit_ShowMessageBoxAlertView(const SDL_MessageBoxData *messageboxdata, int *but
#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED < 80000 */
}
static void
UIKit_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid, int *returnValue)
int
UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{
BOOL success = NO;
@@ -199,26 +199,12 @@ UIKit_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonid
}
if (!success) {
*returnValue = SDL_SetError("Could not show message box.");
} else {
*returnValue = 0;
return SDL_SetError("Could not show message box.");
}
return 0;
}
int
UIKit_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{ @autoreleasepool
{
__block int returnValue = 0;
if ([NSThread isMainThread]) {
UIKit_ShowMessageBoxImpl(messageboxdata, buttonid, &returnValue);
} else {
dispatch_sync(dispatch_get_main_queue(), ^{ UIKit_ShowMessageBoxImpl(messageboxdata, buttonid, &returnValue); });
}
return returnValue;
}}
#endif /* SDL_VIDEO_DRIVER_UIKIT */
/* vi: set ts=4 sw=4 expandtab: */
+2 -2
View File
@@ -162,8 +162,8 @@ UIKit_GL_CreateContext(_THIS, SDL_Window * window)
}
if (_this->gl_config.share_with_current_context) {
EAGLContext *currContext = (__bridge EAGLContext *) SDL_GL_GetCurrentContext();
sharegroup = currContext.sharegroup;
EAGLContext *context = (__bridge EAGLContext *) SDL_GL_GetCurrentContext();
sharegroup = context.sharegroup;
}
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
+1 -1
View File
@@ -89,7 +89,7 @@
glGetIntegerv(GL_MAX_SAMPLES, &maxsamples);
/* Clamp the samples to the max supported count. */
samples = SDL_min(samples, maxsamples);
samples = MIN(samples, maxsamples);
}
if (sRGB) {
+3 -8
View File
@@ -278,16 +278,11 @@ UIKit_ForceUpdateHomeIndicator()
*/
#if !defined(SDL_VIDEO_DRIVER_COCOA)
void SDL_NSLog(const char *prefix, const char *text)
void SDL_NSLog(const char *text)
{
@autoreleasepool {
NSString *nsText = [NSString stringWithUTF8String:text];
if (prefix) {
NSString *nsPrefix = [NSString stringWithUTF8String:prefix];
NSLog(@"%@: %@", nsPrefix, nsText);
} else {
NSLog(@"%@", nsText);
}
NSString *str = [NSString stringWithUTF8String:text];
NSLog(@"%@", str);
}
}
#endif /* SDL_VIDEO_DRIVER_COCOA */
+2 -2
View File
@@ -403,8 +403,8 @@ UIKit_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
return SDL_TRUE;
} else {
SDL_SetError("Application not compiled with SDL %d",
SDL_MAJOR_VERSION);
SDL_SetError("Application not compiled with SDL %d.%d",
SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
return SDL_FALSE;
}
}