code cleanup
authorkoda
Wed, 08 Dec 2010 15:16:57 +0100
changeset 4478 05029b4d8490
parent 4476 4bf74e158f44
child 4485 85695e3d2623
code cleanup
project_files/HedgewarsMobile/Classes/FlagsViewController.m
project_files/HedgewarsMobile/Classes/GameSetup.m
project_files/HedgewarsMobile/Classes/SingleTeamViewController.m
project_files/HedgewarsMobile/Classes/UIImageExtra.h
project_files/HedgewarsMobile/Classes/UIImageExtra.m
project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist
--- a/project_files/HedgewarsMobile/Classes/FlagsViewController.m	Wed Dec 08 14:47:52 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/FlagsViewController.m	Wed Dec 08 15:16:57 2010 +0100
@@ -20,6 +20,7 @@
 
 
 #import "FlagsViewController.h"
+#import <QuartzCore/QuartzCore.h>
 #import "CommodityFunctions.h"
 
 @implementation FlagsViewController
@@ -99,6 +100,7 @@
     UIImage *flagSprite = [[UIImage alloc] initWithContentsOfFile:flagFile];
     [flagFile release];
     cell.imageView.image = flagSprite;
+    cell.imageView.layer.borderWidth = 0.3;
     [flagSprite release];
 
     cell.textLabel.text = [[source objectAtIndex:row] stringByDeletingPathExtension];
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Dec 08 14:47:52 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Dec 08 15:16:57 2010 +0100
@@ -195,6 +195,10 @@
     [self sendToEngine:turnTime];
     [turnTime release];
 
+    NSString *minesTime = [[NSString alloc] initWithFormat:@"e$turntime %d",[[basicArray objectAtIndex:2] intValue] * 1000];
+    [self sendToEngine:minesTime];
+    [minesTime release];
+
     for (i = 2; i < [basicArray count]; i++) {
         NSDictionary *basicDict = [mods objectAtIndex:i];
         NSString *command = [basicDict objectForKey:@"command"];
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Wed Dec 08 14:47:52 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Wed Dec 08 15:16:57 2010 +0100
@@ -20,6 +20,7 @@
 
 
 #import "SingleTeamViewController.h"
+#import <QuartzCore/QuartzCore.h>
 #import "HogHatViewController.h"
 #import "GravesViewController.h"
 #import "VoicesViewController.h"
@@ -263,6 +264,7 @@
                     accessoryImage = [[UIImage alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png",
                                                                               FLAGS_DIRECTORY(),[teamDictionary objectForKey:@"flag"]]];
                     cell.imageView.image = [accessoryImage scaleToSize:CGSizeMake(27, 19)];
+                    cell.imageView.layer.borderWidth = 0.3;
                     [accessoryImage release];
                     break;
                 case 4: // level
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.h	Wed Dec 08 14:47:52 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.h	Wed Dec 08 15:16:57 2010 +0100
@@ -28,7 +28,6 @@
 
 -(UIImage *)scaleToSize:(CGSize) size;
 -(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint;
--(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint ofSize:(CGSize) resultingSize;
 -(id) initWithContentsOfFile:(NSString *)path andCutAt:(CGRect) rect;
 -(UIImage *)cutAt:(CGRect) rect;
 -(UIImage *)convertToGrayScale;
--- a/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Wed Dec 08 14:47:52 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/UIImageExtra.m	Wed Dec 08 15:16:57 2010 +0100
@@ -54,18 +54,13 @@
 }
 
 -(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint {
-    // create a contex of size of the background image
-    return [self mergeWith:secondImage atPoint:secondImagePoint ofSize:self.size];
-}
-
--(UIImage *)mergeWith:(UIImage *)secondImage atPoint:(CGPoint) secondImagePoint ofSize:(CGSize) resultingSize {
     if (secondImage == nil) {
         DLog(@"Warning, secondImage == nil");
         return self;
     }
     CGFloat screenScale = getScreenScale();
-    int w = resultingSize.width * screenScale;
-    int h = resultingSize.height * screenScale;
+    int w = self.size.width * screenScale;
+    int h = self.size.height * screenScale;
     
     if (w == 0 || h == 0) {
         DLog(@"Can have 0 dimesions");
@@ -255,6 +250,7 @@
 +(UIImage *)whiteImage:(CGSize) ofSize {
     CGFloat w = ofSize.width;
     CGFloat h = ofSize.height;
+    DLog(@"w: %f, h: %f", w, h);
 
     CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
     CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);
--- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist	Wed Dec 08 14:47:52 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist	Wed Dec 08 15:16:57 2010 +0100
@@ -20,7 +20,7 @@
 	</dict>
 	<dict>
 		<key>checkOverMax</key>
-		<true/>
+		<false/>
 		<key>command</key>
 		<string>e$turntime</string>
 		<key>default</key>