Refactor apple_platform variable

This commit is contained in:
Twinaphex 2015-04-21 11:43:43 +02:00
parent 54c6c3eb01
commit 1afdb5cb92
3 changed files with 7 additions and 8 deletions

View File

@ -116,8 +116,6 @@ void get_ios_version(int *major, int *minor);
#endif
extern id<RetroArch_Platform> apple_platform;
extern void apple_display_alert(const char *message, const char *title);

View File

@ -28,11 +28,11 @@
#include "../../input/drivers/cocoa_input.h"
#include "../../frontend/frontend.h"
id<RetroArch_Platform> apple_platform;
static id apple_platform;
void apple_rarch_exited(void)
{
[apple_platform unloadingCore];
[[NSApplication sharedApplication] terminate:nil];
}
@interface RApplication : NSApplication
@ -158,7 +158,6 @@ static char** waiting_argv;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
apple_platform = self;
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
[self.window setCollectionBehavior:[self.window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
@ -305,7 +304,6 @@ static void poll_iteration(void)
- (void)unloadingCore
{
[[NSApplication sharedApplication] terminate:nil];
}
- (IBAction)showCoresDirectory:(id)sender

View File

@ -34,7 +34,7 @@
#include "../../input/drivers_hid/btstack_hid.h"
#include "../../frontend/frontend.h"
id<RetroArch_Platform> apple_platform;
static id apple_platform;
static CFRunLoopObserverRef iterate_observer;
static void rarch_draw(CFRunLoopObserverRef observer,
@ -63,7 +63,10 @@ static void rarch_draw(CFRunLoopObserverRef observer,
void apple_rarch_exited(void)
{
[apple_platform unloadingCore];
RetroArch_iOS *ap = (RetroArch_iOS *)apple_platform;
if (ap)
[ap unloadingCore];
}
apple_frontend_settings_t apple_frontend_settings;