ios check for music preference also for fading methods
authorkoda
Sat, 11 Feb 2012 05:48:33 +0100
changeset 6667 142fe596e75e
parent 6666 0e2f5b81cbf2
child 6668 f2091a9a77fa
ios check for music preference also for fading methods
project_files/HedgewarsMobile/Classes/AudioManagerController.m
project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
--- a/project_files/HedgewarsMobile/Classes/AudioManagerController.m	Sat Feb 11 05:13:56 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/AudioManagerController.m	Sat Feb 11 05:48:33 2012 +0100
@@ -68,6 +68,9 @@
 }
 
 +(void) fadeOutBackgroundMusic {
+    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"music"] boolValue] == NO)
+        return;
+
     if (audioFaderQueue == nil)
         audioFaderQueue = [[NSOperationQueue alloc] init];
     if (backgroundMusic == nil)
@@ -79,6 +82,9 @@
 }
 
 +(void) fadeInBackgroundMusic {
+    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"music"] boolValue] == NO)
+        return;
+
     if (audioFaderQueue == nil)
         audioFaderQueue = [[NSOperationQueue alloc] init];
     if (backgroundMusic == nil)
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Sat Feb 11 05:13:56 2012 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Sat Feb 11 05:48:33 2012 +0100
@@ -44,12 +44,12 @@
     [self.proto spawnThread:self.savePath withOptions:optionsOrNil];
 
     // add a black view hiding the background
-    CGRect theFrame = [[UIScreen mainScreen] bounds];
     UIWindow *thisWindow = [[HedgewarsAppDelegate sharedAppDelegate] uiwindow];
-    self.blackView = [[UIView alloc] initWithFrame:theFrame];
+    self.blackView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     self.blackView.opaque = YES;
     self.blackView.backgroundColor = [UIColor blackColor];
     self.blackView.alpha = 0;
+    self.blackView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [UIView beginAnimations:@"fade out" context:NULL];
     [UIView setAnimationDuration:1];
     self.blackView.alpha = 1;