(Apple) Cleanups

This commit is contained in:
Twinaphex 2014-07-20 07:00:02 +02:00
parent 670ce086c6
commit 86fa191ae7
7 changed files with 14 additions and 19 deletions

View File

@ -49,7 +49,7 @@
+ (RetroArch_OSX*)get;
- (void)loadingCore:(NSString*)core withFile:(const char*)file;
- (void)unloadingCore:(NSString*)core;
- (void)unloadingCore;
@end

View File

@ -282,7 +282,7 @@ static char** waiting_argv;
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[NSURL fileURLWithPath:BOXSTRING(file)]];
}
- (void)unloadingCore:(const NSString*)core
- (void)unloadingCore
{
if (g_extern.system.shutdown)
[[NSApplication sharedApplication] terminate:nil];

View File

@ -29,7 +29,7 @@
@protocol RetroArch_Platform
- (void)loadingCore:(NSString*)core withFile:(const char*)file;
- (void)unloadingCore:(NSString*)core;
- (void)unloadingCore;
@end
#ifdef IOS
@ -40,7 +40,7 @@
#endif
extern char** apple_argv;
extern NSString* apple_core;
extern char apple_core[PATH_MAX];
extern id<RetroArch_Platform> apple_platform;

View File

@ -23,17 +23,11 @@
id<RetroArch_Platform> apple_platform;
#pragma mark EMULATION
NSString* apple_core;
char apple_core[PATH_MAX];
void apple_rarch_exited(void)
{
NSString *used_core = (NSString*)apple_core;
apple_core = 0;
[apple_platform unloadingCore:used_core];
#ifdef OSX
[used_core release];
#endif
[apple_platform unloadingCore];
}
void apple_run_core(NSString* core, const char* file)
@ -44,16 +38,17 @@ void apple_run_core(NSString* core, const char* file)
[apple_platform loadingCore:core withFile:file];
apple_core = core;
if (core.UTF8String && core.UTF8String[0] != '\0')
strlcpy(apple_core, core.UTF8String, sizeof(apple_core));
if (file && core)
{
strlcpy(core_path, apple_core.UTF8String, sizeof(core_path));
strlcpy(core_path, apple_core, sizeof(core_path));
strlcpy(file_path, file, sizeof(file_path));
}
if (core_info_has_custom_config(apple_core.UTF8String))
core_info_get_custom_config(apple_core.UTF8String, config_path, sizeof(config_path));
if (core_info_has_custom_config(apple_core))
core_info_get_custom_config(apple_core, config_path, sizeof(config_path));
else
strlcpy(config_path, g_defaults.config_path, sizeof(config_path));

View File

@ -550,7 +550,7 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
nil]];
[settings addObject:[RAMenuItemBasic itemWithDescription:BOXSTRING("Core")
action:^{ [weakSelf.navigationController pushViewController:[[RACoreSettingsMenu alloc] initWithCore:apple_core] animated:YES]; }]];
action:^{ [weakSelf.navigationController pushViewController:[[RACoreSettingsMenu alloc] initWithCore:BOXSTRING(apple_core)] animated:YES]; }]];
[settings addObject:[RAMenuItemBasic itemWithDescription:BOXSTRING("Core Options")
action:^{ [weakSelf.navigationController pushViewController:[RACoreOptionsMenu new] animated:YES]; }]];
}

View File

@ -42,7 +42,7 @@ const void* apple_get_frontend_settings(void);
- (void)showGameView;
- (void)loadingCore:(NSString*)core withFile:(const char*)file;
- (void)unloadingCore:(NSString*)core;
- (void)unloadingCore;
- (void)refreshSystemConfig;

View File

@ -297,7 +297,7 @@ static void handle_touch_event(NSArray* touches)
[self showGameView];
}
- (void)unloadingCore:(NSString*)core
- (void)unloadingCore
{
[self showPauseMenu:self];