*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
/* Garbage collection only exists if we are being compiled against the
10.6 SDK or newer, not if we are building against the 10.4 SDK.
/* Garbage collection only exists if we are being compiled against the
10.6 SDK or newer, not if we are building against the 10.4 SDK.
/* Stub definition of the superclass, for iPhone.
*/
@implementation ScreenSaverView
/* Stub definition of the superclass, for iPhone.
*/
@implementation ScreenSaverView
CFBundleRef cfb = CFBundleCreate (kCFAllocatorDefault, url);
CFRelease (url);
NSAssert1 (cfb, @"no CFBundle for \"%@\"", path);
CFBundleRef cfb = CFBundleCreate (kCFAllocatorDefault, url);
CFRelease (url);
NSAssert1 (cfb, @"no CFBundle for \"%@\"", path);
anyway, since that's a higher resolution than most desktop monitors
have even today. (This is only true for X11 programs, not GL
programs. Those are fine at full rez.)
anyway, since that's a higher resolution than most desktop monitors
have even today. (This is only true for X11 programs, not GL
programs. Those are fine at full rez.)
- if (((int) backbuffer_size.width != (int) (s * rot_current_size.width) ||
- (int) backbuffer_size.height != (int) (s * rot_current_size.height))
-/* && rotation_ratio == -1*/)
+ if (!ignore_rotation_p &&
+ /* rotation_ratio && */
+ ((int) backbuffer_size.width != (int) (s * rot_current_size.width) ||
+ (int) backbuffer_size.height != (int) (s * rot_current_size.height)))
- (void)alertView:(UIAlertView *)av clickedButtonAtIndex:(NSInteger)i
{
if (i == 0) exit (-1); // Cancel
- (void)alertView:(UIAlertView *)av clickedButtonAtIndex:(NSInteger)i
{
if (i == 0) exit (-1); // Cancel
- // The rotation origin for layer.affineTransform is in the center already.
- CGAffineTransform t =
- CGAffineTransformMakeRotation (rot_current_angle / (180.0 / M_PI));
+ if (!ignore_rotation_p) {
+ // The rotation origin for layer.affineTransform is in the center already.
+ CGAffineTransform t =
+ CGAffineTransformMakeRotation (rot_current_angle / (180.0 / M_PI));
- // Correct the aspect ratio.
- CGRect frame = [self bounds];
- double s = [self hackedContentScaleFactor];
- t = CGAffineTransformScale(t,
- backbuffer_size.width / (s * frame.size.width),
- backbuffer_size.height / (s * frame.size.height));
-
- self.layer.affineTransform = t;
+ // Correct the aspect ratio.
+ CGRect frame = [self bounds];
+ double s = [self hackedContentScaleFactor];
+ t = CGAffineTransformScale(t,
+ backbuffer_size.width / (s * frame.size.width),
+ backbuffer_size.height / (s * frame.size.height));
+ self.layer.affineTransform = t;
+ }
// #### am I expected to retain this, or not? wtf.
// I thought not, but if I don't do this, we (sometimes) crash.
// #### am I expected to retain this, or not? wtf.
// I thought not, but if I don't do this, we (sometimes) crash.
- [UIView animateWithDuration: 0.5
- animations:^{ fader.alpha = 0.0; }
- completion:^(BOOL finished) {
- [fader removeFromSuperview];
- fader.alpha = 1.0;
- }];
-}
-
-
-- (void) stopAndClose:(Bool)relaunch_p
-{
- [self stopAndClose];
- UIViewController *v = [[self window] rootViewController];
+ // Why is [self window] sometimes null here?
+ UIWindow *w = [[UIApplication sharedApplication] keyWindow];
+ UIViewController *v = [w rootViewController];
if ([v isKindOfClass: [UINavigationController class]]) {
UINavigationController *n = (UINavigationController *) v;
[[n topViewController] motionEnded: UIEventSubtypeMotionShake
withEvent: nil];
}
if ([v isKindOfClass: [UINavigationController class]]) {
UINavigationController *n = (UINavigationController *) v;
[[n topViewController] motionEnded: UIEventSubtypeMotionShake
withEvent: nil];
}
+ } else { // Not launching another, animate our return to the list.
+ [UIView animateWithDuration: 0.5
+ animations:^{ fader.alpha = 0.0; }
+ completion:^(BOOL finished) {
+ [fader removeFromSuperview];
+ fader.alpha = 1.0;
+ }];
double dist = sqrt (((p.x - tap_point.x) * (p.x - tap_point.x)) +
((p.y - tap_point.y) * (p.y - tap_point.y)));
if (tap_time + 0.5 >= double_time() && dist < 20) {
double dist = sqrt (((p.x - tap_point.x) * (p.x - tap_point.x)) +
((p.y - tap_point.y) * (p.y - tap_point.y)));
if (tap_time + 0.5 >= double_time() && dist < 20) {