mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(Apple) Style nits and cleanups
This commit is contained in:
parent
91faa161af
commit
02b0844061
@ -131,8 +131,8 @@ static char** waiting_argv;
|
|||||||
|
|
||||||
NSArray* paths = (NSArray*)NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
NSArray* paths = (NSArray*)NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
|
||||||
self.configDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:BOXSTRING("RetroArch")];
|
self.configDirectory = [[paths objectAtIndex:0] stringByAppendingPathComponent:BOXSTRING("RetroArch")];
|
||||||
self.globalConfigFile = [NSString stringWithFormat:@"%@/retroarch.cfg", self.configDirectory];
|
self.globalConfigFile = [NSString stringWithFormat:BOXSTRING("%@/retroarch.cfg"), self.configDirectory];
|
||||||
self.coreDirectory = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"Contents/Resources/modules"];
|
self.coreDirectory = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:BOXSTRING("Contents/Resources/modules")];
|
||||||
|
|
||||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||||
[self.window setCollectionBehavior:[self.window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
|
[self.window setCollectionBehavior:[self.window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
|
||||||
@ -142,12 +142,12 @@ static char** waiting_argv;
|
|||||||
|
|
||||||
[[RAGameView get] setFrame: [[self.window contentView] bounds]];
|
[[RAGameView get] setFrame: [[self.window contentView] bounds]];
|
||||||
[[self.window contentView] setAutoresizesSubviews:YES];
|
[[self.window contentView] setAutoresizesSubviews:YES];
|
||||||
#if defined(IOS) || defined(MAC_OS_X_VERSION_10_6)
|
#if defined(IOS) || defined(MAC_OS_X_VERSION_10_5)
|
||||||
[[self.window contentView] addSubview:RAGameView.get];
|
[[self.window contentView] addSubview:RAGameView.get];
|
||||||
#endif
|
#endif
|
||||||
[self.window makeFirstResponder:[RAGameView get]];
|
[self.window makeFirstResponder:[RAGameView get]];
|
||||||
|
|
||||||
self.settingsWindow = [[[NSWindowController alloc] initWithWindowNibName:@"Settings"] autorelease];
|
self.settingsWindow = [[[NSWindowController alloc] initWithWindowNibName:BOXSTRING("Settings")] autorelease];
|
||||||
|
|
||||||
// Create core select list
|
// Create core select list
|
||||||
NSComboBox* cb = (NSComboBox*)[[self.coreSelectSheet contentView] viewWithTag:1];
|
NSComboBox* cb = (NSComboBox*)[[self.coreSelectSheet contentView] viewWithTag:1];
|
||||||
@ -221,7 +221,7 @@ static char** waiting_argv;
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
apple_display_alert(@"Cannot open multiple files", @"RetroArch");
|
apple_display_alert(BOXSTRING("Cannot open multiple files"), BOXSTRING("RetroArch"));
|
||||||
[sender replyToOpenOrPrint:NSApplicationDelegateReplyFailure];
|
[sender replyToOpenOrPrint:NSApplicationDelegateReplyFailure];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ static char** waiting_argv;
|
|||||||
- (void)openDocument:(id)sender
|
- (void)openDocument:(id)sender
|
||||||
{
|
{
|
||||||
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
||||||
#if defined(MAC_OS_X_VERSION_10_6)
|
#if defined(MAC_OS_X_VERSION_10_5)
|
||||||
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
|
[panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result)
|
||||||
{
|
{
|
||||||
[[NSApplication sharedApplication] stopModal];
|
[[NSApplication sharedApplication] stopModal];
|
||||||
|
@ -71,7 +71,7 @@ static CLLocationAccuracy currentVerticalAccuracy;
|
|||||||
@implementation NSScreen (IOSCompat)
|
@implementation NSScreen (IOSCompat)
|
||||||
- (CGRect)bounds
|
- (CGRect)bounds
|
||||||
{
|
{
|
||||||
CGRect cgrect = NSRectToCGRect([self frame]);
|
CGRect cgrect = (CGRect)NSRectToCGRect(self.frame);
|
||||||
return CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect));
|
return CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect));
|
||||||
}
|
}
|
||||||
- (float) scale { return 1.0f; }
|
- (float) scale { return 1.0f; }
|
||||||
@ -164,7 +164,7 @@ static bool g_is_syncing = true;
|
|||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
UINib *xib = [UINib nibWithNibName:@"PauseIndicatorView" bundle:nil];
|
UINib *xib = [UINib nibWithNibName:BOXSTRING("PauseIndicatorView") bundle:nil];
|
||||||
g_pause_indicator_view = [[xib instantiateWithOwner:[RetroArch_iOS get] options:nil] lastObject];
|
g_pause_indicator_view = [[xib instantiateWithOwner:[RetroArch_iOS get] options:nil] lastObject];
|
||||||
|
|
||||||
g_view = [GLKView new];
|
g_view = [GLKView new];
|
||||||
@ -320,7 +320,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
|||||||
[_session setSessionPreset:_sessionPreset];
|
[_session setSessionPreset:_sessionPreset];
|
||||||
|
|
||||||
//-- Creata a video device and input from that Device. Add the input to the capture session.
|
//-- Creata a video device and input from that Device. Add the input to the capture session.
|
||||||
AVCaptureDevice * videoDevice = (AVCaptureDevice*)[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
|
AVCaptureDevice *videoDevice = (AVCaptureDevice*)[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
|
||||||
if(videoDevice == nil)
|
if(videoDevice == nil)
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
||||||
@ -394,8 +394,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
|||||||
CLLocation *location = (CLLocation*)[locations objectAtIndex:([locations count] - 1)];
|
CLLocation *location = (CLLocation*)[locations objectAtIndex:([locations count] - 1)];
|
||||||
currentLatitude = [location coordinate].latitude;
|
currentLatitude = [location coordinate].latitude;
|
||||||
currentLongitude = [location coordinate].longitude;
|
currentLongitude = [location coordinate].longitude;
|
||||||
currentHorizontalAccuracy = [location horizontalAccuracy];
|
currentHorizontalAccuracy = location.horizontalAccuracy;
|
||||||
currentVerticalAccuracy = [location verticalAccuracy];
|
currentVerticalAccuracy = location.verticalAccuracy;
|
||||||
RARCH_LOG("didUpdateLocations - latitude %f, longitude %f\n", (float)currentLatitude, (float)currentLongitude);
|
RARCH_LOG("didUpdateLocations - latitude %f, longitude %f\n", (float)currentLatitude, (float)currentLongitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -713,7 +713,7 @@ typedef struct apple_location
|
|||||||
void *empty;
|
void *empty;
|
||||||
} applelocation_t;
|
} applelocation_t;
|
||||||
|
|
||||||
static void *apple_location_init()
|
static void *apple_location_init(void)
|
||||||
{
|
{
|
||||||
applelocation_t *applelocation = (applelocation_t*)calloc(1, sizeof(applelocation_t));
|
applelocation_t *applelocation = (applelocation_t*)calloc(1, sizeof(applelocation_t));
|
||||||
if (!applelocation)
|
if (!applelocation)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user