mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Fix smooth switching from Vulkan to GL
This commit is contained in:
parent
740219a65b
commit
9a93a478d1
@ -1502,7 +1502,7 @@ void NativeShutdown() {
|
||||
|
||||
ShutdownWebServer();
|
||||
|
||||
#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
|
||||
#if PPSSPP_PLATFORM(ANDROID)
|
||||
System_ExitApp();
|
||||
#endif
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
@property (strong, nonatomic) id<PPSSPPViewController> viewController;
|
||||
|
||||
- (void)restart;
|
||||
- (void)restart:(const char *)args;
|
||||
- (BOOL)launchPPSSPP:(int)argc argv:(char**)argv;
|
||||
|
||||
@end
|
||||
|
@ -86,6 +86,9 @@
|
||||
argv[argc++] = (char*)string;
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAudioSessionInterruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleMediaServicesWereReset:) name:AVAudioSessionMediaServicesWereResetNotification object:nil];
|
||||
|
||||
return [self launchPPSSPP:argc argv:argv];
|
||||
}
|
||||
|
||||
@ -113,9 +116,6 @@
|
||||
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAudioSessionInterruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleMediaServicesWereReset:) name:AVAudioSessionMediaServicesWereResetNotification object:nil];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@ -123,9 +123,19 @@
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (void)restart {
|
||||
- (void)restart:(const char*)restartArgs {
|
||||
INFO_LOG(G3D, "Restart requested: %s", restartArgs);
|
||||
[self.viewController willResignActive];
|
||||
self.viewController = nil;
|
||||
|
||||
// App was requested to restart, probably.
|
||||
INFO_LOG(G3D, "Restart requested");
|
||||
INFO_LOG(G3D, "viewController nilled");
|
||||
|
||||
NativeShutdown();
|
||||
|
||||
// TODO: Ignoring the command line for now.
|
||||
// Hoping that overwriting the viewController works as expected...
|
||||
[self launchPPSSPP:0 argv:nullptr];
|
||||
}
|
||||
|
||||
-(void) applicationWillResignActive:(UIApplication *)application {
|
||||
|
@ -393,7 +393,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||
switch (type) {
|
||||
case SystemRequestType::RESTART_APP:
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[(AppDelegate *)[[UIApplication sharedApplication] delegate] restart];
|
||||
[(AppDelegate *)[[UIApplication sharedApplication] delegate] restart:param1.c_str()];
|
||||
});
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user