Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Vittorio Giovara fixed bug 1528: move hint registration from SDLUikit…
Browse files Browse the repository at this point in the history
…AppDelegate

When subclassing SDLUikitAppDelegate you usually override the -postFinishLaunch
method so that you can (for example) call a different function than SDL_main.

As it is now, however, overriding -postFinishLaunch will bar out the
SDL_SetHint for the idle timer. Attached a simple patch the moves the hint
callback to the -application:didiFinishLaunchingWithOptions:
  • Loading branch information
slouken committed Jul 2, 2012
1 parent 208da59 commit a6469c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/video/uikit/SDL_uikitappdelegate.m
Expand Up @@ -101,10 +101,6 @@ - (id)init

- (void)postFinishLaunch
{
/* register a callback for the idletimer hint */
SDL_SetHint(SDL_HINT_IDLE_TIMER_DISABLED, "0");
SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged);

/* run the user's application, passing argc and argv */
SDL_iPhoneSetEventPump(SDL_TRUE);
exit_status = SDL_main(forward_argc, forward_argv);
Expand All @@ -121,6 +117,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
/* Set working directory to resource path */
[[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];

/* register a callback for the idletimer hint */
SDL_SetHint(SDL_HINT_IDLE_TIMER_DISABLED, "0");
SDL_RegisterHintChangedCb(SDL_HINT_IDLE_TIMER_DISABLED, &SDL_IdleTimerDisabledChanged);

[self performSelector:@selector(postFinishLaunch) withObject:nil afterDelay:0.0];

return YES;
Expand Down

0 comments on commit a6469c4

Please sign in to comment.