rarch_render_cached_frame - do early return if g_runloop.is_idle
is true - reduces CPU activity in iOS Cocoa menu substantially (from 96% CPU to 16%)
This commit is contained in:
parent
5b3ab881ba
commit
9027b35eb8
|
@ -226,18 +226,23 @@ enum
|
||||||
return (RetroArch_iOS*)[[UIApplication sharedApplication] delegate];
|
return (RetroArch_iOS*)[[UIApplication sharedApplication] delegate];
|
||||||
}
|
}
|
||||||
|
|
||||||
void switch_to_ios(void) {
|
void switch_to_ios(void)
|
||||||
if ( apple_platform != NULL ) {
|
{
|
||||||
RetroArch_iOS *ap = (RetroArch_iOS *)apple_platform;
|
if (!apple_platform)
|
||||||
[ap showPauseMenu:ap];
|
return;
|
||||||
}
|
|
||||||
|
RetroArch_iOS *ap = (RetroArch_iOS *)apple_platform;
|
||||||
|
g_runloop.is_idle = true;
|
||||||
|
[ap showPauseMenu:ap];
|
||||||
}
|
}
|
||||||
|
|
||||||
void notify_content_loaded(void) {
|
void notify_content_loaded(void)
|
||||||
if ( apple_platform != NULL ) {
|
{
|
||||||
RetroArch_iOS *ap = (RetroArch_iOS *)apple_platform;
|
if (!apple_platform)
|
||||||
[ap showGameView];
|
return;
|
||||||
}
|
|
||||||
|
RetroArch_iOS *ap = (RetroArch_iOS *)apple_platform;
|
||||||
|
[ap showGameView];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidFinishLaunching:(UIApplication *)application
|
- (void)applicationDidFinishLaunching:(UIApplication *)application
|
||||||
|
@ -334,11 +339,13 @@ void notify_content_loaded(void) {
|
||||||
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
|
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
|
||||||
[self.window setRootViewController:[RAGameView get]];
|
[self.window setRootViewController:[RAGameView get]];
|
||||||
g_runloop.is_paused = false;
|
g_runloop.is_paused = false;
|
||||||
|
g_runloop.is_idle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)showPauseMenu:(id)sender
|
- (IBAction)showPauseMenu:(id)sender
|
||||||
{
|
{
|
||||||
g_runloop.is_paused = true;
|
g_runloop.is_paused = true;
|
||||||
|
g_runloop.is_idle = true;
|
||||||
[[UIApplication sharedApplication] setStatusBarHidden:false withAnimation:UIStatusBarAnimationNone];
|
[[UIApplication sharedApplication] setStatusBarHidden:false withAnimation:UIStatusBarAnimationNone];
|
||||||
[[UIApplication sharedApplication] setIdleTimerDisabled:false];
|
[[UIApplication sharedApplication] setIdleTimerDisabled:false];
|
||||||
[self.window setRootViewController:self];
|
[self.window setRootViewController:self];
|
||||||
|
|
|
@ -78,6 +78,9 @@ void rarch_render_cached_frame(void)
|
||||||
{
|
{
|
||||||
void *recording = driver.recording_data;
|
void *recording = driver.recording_data;
|
||||||
|
|
||||||
|
if (g_runloop.is_idle)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Cannot allow recording when pushing duped frames. */
|
/* Cannot allow recording when pushing duped frames. */
|
||||||
driver.recording_data = NULL;
|
driver.recording_data = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue