Compare commits

...

4 commits

Author SHA1 Message Date
Smiril bda46b2ff5
Create FUNDING.yml 2024-05-12 19:03:22 +02:00
Smiril a089c3cdf7 compiler fix in build scripts 2024-05-12 18:39:44 +02:00
Smiril 43666a6261 3rd_party fixes 2024-05-12 18:19:45 +02:00
Smiril 9745196d5d 3rd_party fixes 2024-05-12 17:19:53 +02:00
9 changed files with 48 additions and 52 deletions

3
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,3 @@
# These are supported funding model platforms
github:[Smiril,InoriRus] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]

View file

@ -7,19 +7,19 @@ do
case $opt in
"Debug")
DirName=_DebugMacOSMakeClang
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=_bin ../../source"
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=_bin ../../source"
;;
"Debug Final")
DirName=_DebugFinalMacOSMakeClang
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source"
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Debug -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source"
;;
"Release")
DirName=_ReleaseMacOSMakeClang
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=_bin ../../source"
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=_bin ../../source"
;;
"Release Final")
DirName=_ReleaseFinalMacOSMakeClang
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source"
Options="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 -D CMAKE_INSTALL_PREFIX=_bin ../../source"
;;
esac
break

View file

@ -53,7 +53,7 @@
static const AudioObjectPropertyAddress devlist_address = {
kAudioHardwarePropertyDevices,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
typedef void (*addDevFn)(const char *name, SDL_AudioSpec *spec, const int iscapture, AudioDeviceID devId, void *data);
@ -131,17 +131,17 @@ build_device_list(int iscapture, addDevFn addfn, void *addfndata)
const AudioObjectPropertyAddress addr = {
kAudioDevicePropertyStreamConfiguration,
iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
const AudioObjectPropertyAddress nameaddr = {
kAudioObjectPropertyName,
iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
const AudioObjectPropertyAddress freqaddr = {
kAudioDevicePropertyNominalSampleRate,
iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
result = AudioObjectGetPropertyDataSize(dev, &addr, 0, NULL, &size);
@ -635,7 +635,7 @@ static const AudioObjectPropertyAddress alive_address =
{
kAudioDevicePropertyDeviceIsAlive,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
static OSStatus
@ -756,7 +756,7 @@ prepare_device(_THIS)
AudioObjectPropertyAddress addr = {
0,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
if (handle == NULL) {
@ -803,7 +803,7 @@ assign_device_to_audioqueue(_THIS)
const AudioObjectPropertyAddress prop = {
kAudioDevicePropertyDeviceUID,
this->iscapture ? kAudioDevicePropertyScopeInput : kAudioDevicePropertyScopeOutput,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
OSStatus result;
@ -952,7 +952,7 @@ audioqueue_thread(void *arg)
const AudioObjectPropertyAddress default_device_address = {
this->iscapture ? kAudioHardwarePropertyDefaultInputDevice : kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
if (this->handle == NULL) { /* opened the default device? Register to know if the user picks a new default. */

View file

@ -167,7 +167,7 @@ SDL_SYS_HapticInit(void)
}
/* Now search I/O Registry for matching devices. */
result = IOServiceGetMatchingServices(kIOMasterPortDefault, match, &iter);
result = IOServiceGetMatchingServices(kIOMainPortDefault, match, &iter);
if (result != kIOReturnSuccess) {
return SDL_SetError("Haptic: Couldn't create a HID object iterator.");
}

View file

@ -249,7 +249,7 @@ HIDAPI_InitializeDiscovery()
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
#if defined(__MACOSX__)
SDL_HIDAPI_discovery.m_notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
SDL_HIDAPI_discovery.m_notificationPort = IONotificationPortCreate(kIOMainPortDefault);
if (SDL_HIDAPI_discovery.m_notificationPort) {
{
io_iterator_t portIterator = 0;

View file

@ -415,7 +415,7 @@ IOS_AddMFIJoystickDevice(SDL_JoystickDeviceItem *device, GCController *controlle
device->nhats = 1; /* d-pad */
device->nbuttons = nbuttons;
} else if (controller.gamepad) {
} else if (controller.extendedGamepad) {
BOOL is_switch_joyconL = IsControllerSwitchJoyConL(controller);
BOOL is_switch_joyconR = IsControllerSwitchJoyConR(controller);
int nbuttons = 0;
@ -606,8 +606,8 @@ IOS_RemoveJoystickDevice(SDL_JoystickDeviceItem *device)
if (device->controller) {
/* The controller was explicitly retained in the struct, so it
* should be explicitly released before freeing the struct. */
GCController *controller = CFBridgingRelease((__bridge CFTypeRef)(device->controller));
controller.controllerPausedHandler = nil;
//GCController *controller = CFBridgingRelease((__bridge CFTypeRef)(device->controller));
//controller.controllerPausedHandler = nil;
device->controller = nil;
}
}
@ -816,12 +816,12 @@ IOS_JoystickOpen(SDL_Joystick *joystick, int device_index)
} else {
#ifdef SDL_JOYSTICK_MFI
if (device->uses_pause_handler) {
GCController *controller = device->controller;
controller.controllerPausedHandler = ^(GCController *c) {
if (joystick->hwdata) {
++joystick->hwdata->num_pause_presses;
}
};
//GCController *controller = device->controller;
//controller.controllerPausedHandler = ^(GCController *c) {
// if (joystick->hwdata) {
// ++joystick->hwdata->num_pause_presses;
// }
//};
}
#ifdef ENABLE_MFI_SENSORS
@ -1089,8 +1089,8 @@ IOS_MFIJoystickUpdate(SDL_Joystick *joystick)
}
#endif /* ENABLE_MFI_SENSORS */
} else if (controller.gamepad) {
GCGamepad *gamepad = controller.gamepad;
} else if (controller.extendedGamepad) {
GCExtendedGamepad *gamepad = controller.extendedGamepad;
/* Button order matches the XInput Windows mappings. */
Uint8 buttons[joystick->nbuttons];
@ -1595,7 +1595,7 @@ IOS_JoystickClose(SDL_Joystick *joystick)
} else if (device->controller) {
#ifdef SDL_JOYSTICK_MFI
GCController *controller = device->controller;
controller.controllerPausedHandler = nil;
//controller.controllerPausedHandler = nil;
controller.playerIndex = -1;
#ifdef ENABLE_MFI_SYSTEM_GESTURE_STATE
@ -1711,8 +1711,8 @@ GetDirectionalPadForController(GCController *controller)
return controller.extendedGamepad.dpad;
}
if (controller.gamepad) {
return controller.gamepad.dpad;
if (controller.extendedGamepad) {
return controller.extendedGamepad.dpad;
}
if (controller.microGamepad) {

View file

@ -288,10 +288,9 @@ static void Cocoa_DispatchEvent(NSEvent *theEvent)
*/
if (!SDL_GetHintBoolean(SDL_HINT_MAC_BACKGROUND_APP, SDL_FALSE)) {
/* Get more aggressive for Catalina: activate the Dock first so we definitely reset all activation state. */
for (NSRunningApplication *i in [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.apple.dock"]) {
[i activateWithOptions:NSApplicationActivateIgnoringOtherApps];
break;
}
//for (NSRunningApplication *i in [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.apple.dock"]) {
// break;
//}
SDL_Delay(300); /* !!! FIXME: this isn't right. */
[NSApp activateIgnoringOtherApps:YES];
}

View file

@ -123,25 +123,19 @@ static Uint32
GetDisplayModePixelFormat(CGDisplayModeRef vidmode)
{
/* This API is deprecated in 10.11 with no good replacement (as of 10.15). */
CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
Uint32 pixelformat = SDL_PIXELFORMAT_UNKNOWN;
if (CFStringCompare(fmt, CFSTR(IO32BitDirectPixels),
kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
pixelformat = SDL_PIXELFORMAT_ARGB8888;
} else if (CFStringCompare(fmt, CFSTR(IO16BitDirectPixels),
kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
pixelformat = SDL_PIXELFORMAT_ARGB1555;
} else if (CFStringCompare(fmt, CFSTR(kIO30BitDirectPixels),
kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
pixelformat = SDL_PIXELFORMAT_ARGB2101010;
} else {
/* ignore 8-bit and such for now. */
//CGDisplayModeRef vidmode = CGDisplayCopyDisplayMode(eDisplay);
CFDictionaryRef dict = (CFDictionaryRef)*((int64_t *)vidmode + 2);
CFTypeRef num;
Uint32 bpp = 0;
if (CFGetTypeID(dict) == CFDictionaryGetTypeID()
&& CFDictionaryGetValueIfPresent(dict, kCGDisplayBitsPerPixel, (const void**)&num))
{
CFNumberGetValue(num, kCFNumberSInt32Type, (void*)&bpp);
}
CFRelease(fmt);
CFRelease(num);
return pixelformat;
return bpp;
}
static SDL_bool

View file

@ -161,7 +161,7 @@
{ @autoreleasepool
{
NSPasteboard *pasteboard = [sender draggingPasteboard];
NSArray *types = [NSArray arrayWithObject:NSFilenamesPboardType];
NSArray *types = [NSArray arrayWithObject:NSPasteboardTypeFileURL];
NSString *desiredType = [pasteboard availableTypeFromArray:types];
SDL_Window *sdlwindow = [self findSDLWindow];
NSData *data;
@ -179,8 +179,8 @@
return NO;
}
SDL_assert([desiredType isEqualToString:NSFilenamesPboardType]);
array = [pasteboard propertyListForType:@"NSFilenamesPboardType"];
SDL_assert([desiredType isEqualToString:NSPasteboardTypeFileURL]);
array = [pasteboard propertyListForType:@"NSPasteboardTypeFileURL"];
/* Code addon to update the mouse location */
point = [sender draggingLocation];
@ -1678,7 +1678,7 @@ SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, NSView *nsview,
/* Prevents the window's "window device" from being destroyed when it is
* hidden. See http://www.mikeash.com/pyblog/nsopenglcontext-and-one-shot.html
*/
[nswindow setOneShot:NO];
//[nswindow setOneShot:NO];
/* All done! */
window->driverdata = (void *)CFBridgingRetain(data);