merge
authorkoda
Wed, 23 Jun 2010 21:18:48 +0200
changeset 3541 f4f90987e0fa
parent 3535 9e78c1f3d8d8 (diff)
parent 3539 c3d1fccbe0ed (current diff)
child 3545 b07ee704f35d
merge
share/hedgewars/Data/Themes/Art/Sky-lowres.png
share/hedgewars/Data/Themes/Art/horizont-lowres.png
share/hedgewars/Data/Themes/Bamboo/Sky-lowres.png
share/hedgewars/Data/Themes/Bamboo/horizont-lowres.png
share/hedgewars/Data/Themes/Bath/Sky-lowres.png
share/hedgewars/Data/Themes/Bath/horizont-lowres.png
share/hedgewars/Data/Themes/Blox/horizont-lowres.png
share/hedgewars/Data/Themes/Castle/Sky-lowres.png
share/hedgewars/Data/Themes/Castle/horizont-lowres.png
share/hedgewars/Data/Themes/City/Sky-lowres.png
share/hedgewars/Data/Themes/City/horizont-lowres.png
share/hedgewars/Data/Themes/Compost/Sky-lowres.png
share/hedgewars/Data/Themes/Compost/horizont-lowres.png
share/hedgewars/Data/Themes/CrazyMission/Sky-lowres.png
share/hedgewars/Data/Themes/CrazyMission/horizont-lowres.png
share/hedgewars/Data/Themes/Desert/Sky-lowres.png
share/hedgewars/Data/Themes/Desert/horizont-lowres.png
share/hedgewars/Data/Themes/EarthRise/Sky-lowres.png
share/hedgewars/Data/Themes/EarthRise/horizont-lowres.png
share/hedgewars/Data/Themes/Eyes/Sky-lowres.png
share/hedgewars/Data/Themes/Eyes/horizont-lowres.png
share/hedgewars/Data/Themes/Freeway/Sky-lowres.png
share/hedgewars/Data/Themes/Freeway/horizont-lowres.png
share/hedgewars/Data/Themes/Halloween/Sky-lowres.png
share/hedgewars/Data/Themes/Hell/horizont-lowres.png
share/hedgewars/Data/Themes/Island/Sky-lowres.png
share/hedgewars/Data/Themes/Island/horizont-lowres.png
share/hedgewars/Data/Themes/Nature/Sky-lowres.png
share/hedgewars/Data/Themes/Nature/horizont-lowres.png
share/hedgewars/Data/Themes/Planes/horizont-lowres.png
share/hedgewars/Data/Themes/Sheep/Sky-lowres.png
share/hedgewars/Data/Themes/Sheep/horizont-lowres.png
share/hedgewars/Data/Themes/Snow/horizont-lowres.png
share/hedgewars/Data/Themes/Stage/Sky-lowres.png
share/hedgewars/Data/Themes/Stage/horizont-lowres.png
share/hedgewars/Data/Themes/Underwater/Sky-lowres.png
share/hedgewars/Data/Themes/Underwater/horizont-lowres.png
--- a/project_files/HedgewarsMobile/Classes/DetailViewController.h	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/DetailViewController.h	Wed Jun 23 21:18:48 2010 +0200
@@ -13,11 +13,7 @@
 @class WeaponSettingsViewController;
 @class SchemeSettingsViewController;
 
-@interface DetailViewController : UITableViewController
-#if __IPHONE_3_2
-<UISplitViewControllerDelegate, UIPopoverControllerDelegate>
-#endif
-{
+@interface DetailViewController : UITableViewController <UISplitViewControllerDelegate, UIPopoverControllerDelegate> {
     NSArray *controllerNames;
     
     GeneralSettingsViewController *generalSettingsViewController;
--- a/project_files/HedgewarsMobile/Classes/DetailViewController.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/DetailViewController.m	Wed Jun 23 21:18:48 2010 +0200
@@ -128,7 +128,6 @@
     [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
 }
 
-#if __IPHONE_3_2
 #pragma mark -
 #pragma mark splitview support
 -(void) splitViewController:(UISplitViewController *)svc popoverController:(UIPopoverController *)pc willPresentViewController:(UIViewController *)aViewController {
@@ -170,7 +169,6 @@
         self.navigationItem.rightBarButtonItem = nil;
 
 }
-#endif
 
 -(void) didReceiveMemoryWarning {
     // Releases the view if it doesn't have a superview.
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Jun 23 21:18:48 2010 +0200
@@ -286,9 +286,6 @@
 				
 				// seed info
 				[self sendToEngine:[self.gameConfig objectForKey:@"seed_command"]];
-				
-                // scheme (returns initial health)
-                NSInteger health = [self provideScheme:[self.gameConfig objectForKey:@"scheme"]];
 
 				// dimension of the map
 				[self sendToEngine:[self.gameConfig objectForKey:@"templatefilter_command"]];
@@ -298,6 +295,9 @@
 				// theme info
 				[self sendToEngine:[self.gameConfig objectForKey:@"theme_command"]];
 				
+                // scheme (returns initial health)
+                NSInteger health = [self provideScheme:[self.gameConfig objectForKey:@"scheme"]];
+                
                 NSArray *teamsConfig = [self.gameConfig objectForKey:@"teams_list"];
                 for (NSDictionary *teamData in teamsConfig) {
                     [self provideTeamData:[teamData objectForKey:@"team"] 
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Wed Jun 23 21:18:48 2010 +0200
@@ -106,11 +106,10 @@
     switch (button.tag) {
         case 0:
             gameConfigViewController = [[GameConfigViewController alloc] initWithNibName:@"GameConfigViewController" bundle:nil];        
-#ifdef __IPHONE_3_2
+
             // bug in UIModalTransitionStylePartialCurl, displays the controller awkwardly if it is not allocated every time            
             if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
                 gameConfigViewController.modalTransitionStyle = UIModalTransitionStylePartialCurl;
-#endif
             [self presentModalViewController:gameConfigViewController animated:YES];
             break;
         case 2:
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.h	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.h	Wed Jun 23 21:18:48 2010 +0200
@@ -12,11 +12,10 @@
 
 @interface OverlayViewController : UIViewController {
     NSTimer *dimTimer;
-#if __IPHONE_3_2
+
+    // used only on the ipad
     UIPopoverController *popoverController;
-#else
-    id popoverController;
-#endif
+
     PopoverMenuViewController *popupMenu;
     BOOL isPopoverVisible;
     
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Wed Jun 23 21:18:48 2010 +0200
@@ -243,15 +243,16 @@
 -(IBAction) showPopover{
     isPopoverVisible = YES;
     CGRect anchorForPopover;
-    Class popoverControllerClass = NSClassFromString(@"UIPopoverController");
-    if (popoverControllerClass) {
-#if __IPHONE_3_2
+
+    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
         if (popupMenu == nil) 
             popupMenu = [[PopoverMenuViewController alloc] initWithStyle:UITableViewStylePlain];
-        popoverController = [[popoverControllerClass alloc] initWithContentViewController:popupMenu];
-        [popoverController setPopoverContentSize:CGSizeMake(220, 170) animated:YES];
-        [popoverController setPassthroughViews:[NSArray arrayWithObject:self.view]];
-
+        if (popoverController == nil) {
+            popoverController = [[UIPopoverController alloc] initWithContentViewController:popupMenu];
+            [popoverController setPopoverContentSize:CGSizeMake(220, 170) animated:YES];
+            [popoverController setPassthroughViews:[NSArray arrayWithObject:self.view]];
+        }
+        
         if (UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation]))
             anchorForPopover = CGRectMake(960, 0, 220, 32);
         else
@@ -261,14 +262,14 @@
                                            inView:self.view
                          permittedArrowDirections:UIPopoverArrowDirectionUp
                                          animated:YES];
-#endif
     } else {
-        if (popupMenu == nil) 
+        if (popupMenu == nil) {
             popupMenu = [[PopoverMenuViewController alloc] initWithStyle:UITableViewStyleGrouped];
-        popupMenu.view.backgroundColor = [UIColor clearColor];
-        popupMenu.view.frame = CGRectMake(480, 0, 200, 170);
+            popupMenu.view.backgroundColor = [UIColor clearColor];
+            popupMenu.view.frame = CGRectMake(480, 0, 200, 170);
+        }
         [self.view addSubview:popupMenu.view];
-
+        
         [UIView beginAnimations:@"showing popover" context:NULL];
         [UIView setAnimationDuration:0.35];
         popupMenu.view.frame = CGRectMake(280, 0, 200, 170);
@@ -283,9 +284,7 @@
         isPopoverVisible = NO;
         
         if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2
             [popoverController dismissPopoverAnimated:YES];
-#endif
         } else {
             [UIView beginAnimations:@"hiding popover" context:NULL];
             [UIView setAnimationDuration:0.35];
@@ -293,7 +292,6 @@
             [UIView commitAnimations];
         
             [popupMenu.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.35];
-            [popupMenu performSelector:@selector(release) withObject:nil afterDelay:0.35];
         }
         [self buttonReleased:nil];
     }
@@ -400,7 +398,7 @@
 			
             // the two ifs are not mutually exclusive
             if (deltaX >= minimumGestureLength) {
-                Dlog(@"deltaX: %f deltaY: %f", deltaX, deltaY);
+                DLog(@"deltaX: %f deltaY: %f", deltaX, deltaY);
                 if (currentPosition.x > gestureStartPoint.x) {
                     HW_cursorLeft(logCoeff*log(deltaX));
                 } else {
--- a/project_files/HedgewarsMobile/Classes/PopoverMenuViewController.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/PopoverMenuViewController.m	Wed Jun 23 21:18:48 2010 +0200
@@ -29,15 +29,19 @@
 -(void) viewDidLoad {
     isPaused = NO;
 
-    menuList = [[NSArray alloc] initWithObjects:
-                NSLocalizedString(@"Pause Game", @""),
-                NSLocalizedString(@"Chat", @""),
-                NSLocalizedString(@"End Game", @""),
-                nil];
+    NSArray *array = [[NSArray alloc] initWithObjects:
+                      NSLocalizedString(@"Pause Game", @""),
+                      NSLocalizedString(@"Chat", @""),
+                      NSLocalizedString(@"End Game", @""),
+                      nil];
+    self.menuList = array;
+    [array release];
+    
     [super viewDidLoad];
 }
 
 -(void) viewDidUnload {
+    self.menuList = nil;
     [super viewDidUnload];
     MSG_DIDUNLOAD();
 }
--- a/project_files/HedgewarsMobile/Classes/SplitViewRootController.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SplitViewRootController.m	Wed Jun 23 21:18:48 2010 +0200
@@ -38,9 +38,7 @@
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
         self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
         
-    Class splitViewControllerClass = NSClassFromString(@"UISplitViewController");
-    if (splitViewControllerClass) {
-#if __IPHONE_3_2
+    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
         UISplitViewController *splitViewRootController = [[UISplitViewController alloc] init];
         //splitViewRootController.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;        
         splitViewRootController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
@@ -57,7 +55,6 @@
         
         // add view to main controller
         [self.view addSubview:splitViewRootController.view];
-#endif
     } else {
         [self.view addSubview:detailedNavController.view];
     }
--- a/project_files/HedgewarsMobile/Classes/otherSrc/SDL_uikitappdelegate.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/otherSrc/SDL_uikitappdelegate.m	Wed Jun 23 21:18:48 2010 +0200
@@ -93,7 +93,7 @@
 	[setup release];
 
     // since the sdlwindow is not yet created, we add the overlayController with a delay
-    [self performSelector:@selector(displayOverlayLater) withObject:nil afterDelay:1];
+    [self performSelector:@selector(displayOverlayLater) withObject:nil afterDelay:0.5];
     
     // this is the pascal fuction that starts the game (wrapped around isInGame)
     isInGame = YES;
--- a/project_files/HedgewarsMobile/Classes/otherSrc/SquareButtonView.m	Wed Jun 23 13:43:56 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/otherSrc/SquareButtonView.m	Wed Jun 23 21:18:48 2010 +0200
@@ -33,25 +33,28 @@
         // set the color to the first available one
         [self nextColor];
         
-        // this makes the button round and nice
+        // this makes the button round and nice with a border
         [self.layer setCornerRadius:7.0f];
         [self.layer setMasksToBounds:YES];        
+        [self.layer setBorderWidth:2];
         
         // this changes the color at button press
         [self addTarget:self action:@selector(nextColor) forControlEvents:UIControlEventTouchUpInside];
-
-        self.backgroundColor = [UIColor blackColor];
     }
     return self;
 }
 
 -(void) nextColor {
     colorIndex++;
+
     if (colorIndex >= [colorArray count])
         colorIndex = 0;
 
     NSUInteger color = [[self.colorArray objectAtIndex:colorIndex] unsignedIntValue];
-    [self selectColor:color];
+    self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f 
+                                           green:((color & 0x0000FF00) >> 8)/255.0f 
+                                            blue: (color & 0x000000FF)/255.0f 
+                                           alpha:1.0f];
     
     [ownerDictionary setObject:[NSNumber numberWithInt:color] forKey:@"color"];
 }
@@ -59,28 +62,13 @@
 -(void) selectColor:(NSUInteger) color {
     if (color != selectedColor) {
         selectedColor = color;
-        
-        UIGraphicsBeginImageContext(self.frame.size);	
-        CGContextRef context = UIGraphicsGetCurrentContext();
-        CGContextSetRGBFillColor(context, ((color & 0x00FF0000) >> 16)/255.0f,
-                                          ((color & 0x0000FF00) >> 8)/255.0f,
-                                           (color & 0x000000FF)/255.0f,
-                                            1.0f);
-        CGContextFillRect(context, CGRectMake(1.1, 1.1, self.frame.size.width-2.2, self.frame.size.height-2.2));
+        colorIndex = [colorArray indexOfObject:[NSNumber numberWithUnsignedInt:color]];
         
-        UIImageView *resultingImage = [[UIImageView alloc] initWithImage: UIGraphicsGetImageFromCurrentImageContext()];
-        UIGraphicsEndImageContext();
-        
-        [self setImage:resultingImage.image forState:UIControlStateNormal];
-        [resultingImage release];
-        
+        self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f 
+                                               green:((color & 0x0000FF00) >> 8)/255.0f 
+                                                blue: (color & 0x000000FF)/255.0f 
+                                               alpha:1.0f];
     }
-    /*  
-    self.backgroundColor = [UIColor colorWithRed:((color & 0x00FF0000) >> 16)/255.0f 
-                                           green:((color & 0x0000FF00) >> 8)/255.0f 
-                                            blue: (color & 0x000000FF)/255.0f 
-                                           alpha:1.0f];
-    */
 }
 
 -(void) dealloc {
Binary file share/hedgewars/Data/Themes/Olympics/Sky-lowres.png has changed
Binary file share/hedgewars/Data/Themes/Olympics/horizont-lowres.png has changed