fix zoom smoothness
authorkoda
Sun, 20 Jun 2010 18:35:59 +0200 (2010-06-20)
changeset 3523 6592fbb969da
parent 3522 156c04c6a3d8
child 3525 1d7b056ff866
fix zoom smoothness some more work for weapons on the ifrontend bugfix for the gameconfig page
hedgewars/CCHandlers.inc
hedgewars/PascalExports.pas
hedgewars/hwengine.pas
hedgewars/uConsts.pas
hedgewars/uKeys.pas
hedgewars/uStore.pas
hedgewars/uWorld.pas
project_files/HedgewarsMobile/Classes/GameConfigViewController.h
project_files/HedgewarsMobile/Classes/GameConfigViewController.m
project_files/HedgewarsMobile/Classes/GameSetup.m
project_files/HedgewarsMobile/Classes/OverlayViewController.m
project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m
project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h
project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m
project_files/HedgewarsMobile/Classes/otherSrc/UIImageExtra.m
project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj
--- a/hedgewars/CCHandlers.inc	Sat Jun 19 00:48:47 2010 +0200
+++ b/hedgewars/CCHandlers.inc	Sun Jun 20 18:35:59 2010 +0200
@@ -803,30 +803,26 @@
 
 procedure chZoomIn(var s: shortstring);
 begin
-s:= s; // avoid compiler hint
+    s:= s; // avoid compiler hint
 {$IFDEF IPHONEOS}
-if ZoomValue < 3.5 then
+    if ZoomValue < 4.0 then
 {$ELSE}
-if ZoomValue < 3.0 then
+    if ZoomValue < 3.0 then
 {$ENDIF}
-        ZoomValue:= ZoomValue + 0.25;
+        ZoomValue:= ZoomValue + 0.20;
 end;
 
 procedure chZoomOut(var s: shortstring);
 begin
-s:= s; // avoid compiler hint
-{$IFDEF IPHONEOS}
-if ZoomValue > 0.5 then
-{$ELSE}
-if ZoomValue > 1.0 then
-{$ENDIF}
-        ZoomValue:= ZoomValue - 0.25;
+    s:= s; // avoid compiler hint
+    if ZoomValue > 1.0 then
+        ZoomValue:= ZoomValue - 0.20;
 end;
 
 procedure chZoomReset(var s: shortstring);
 begin
-s:= s; // avoid compiler hint
-ZoomValue:= 2.0
+    s:= s; // avoid compiler hint
+    ZoomValue:= cDefaultZoomLevel;
 end;
 
 procedure chChat(var s: shortstring);
--- a/hedgewars/PascalExports.pas	Sat Jun 19 00:48:47 2010 +0200
+++ b/hedgewars/PascalExports.pas	Sun Jun 20 18:35:59 2010 +0200
@@ -35,12 +35,14 @@
 
 procedure HW_zoomIn; cdecl; export;
 begin
-    wheelUp:= true;
+    if wheelDown = false then
+        wheelUp:= true;
 end;
 
 procedure HW_zoomOut; cdecl; export;
 begin
-    wheelDown:= true;
+    if wheelUp = false then
+        wheelDown:= true;
 end;
 
 procedure HW_zoomReset; cdecl; export;
--- a/hedgewars/hwengine.pas	Sat Jun 19 00:48:47 2010 +0200
+++ b/hedgewars/hwengine.pas	Sun Jun 20 18:35:59 2010 +0200
@@ -140,9 +140,10 @@
                 end;
         end;
 
-    SDL_GL_SwapBuffers();
 {$IFDEF SDL13}
     SDL_RenderPresent();
+{$ELSE}
+    SDL_GL_SwapBuffers();
 {$ENDIF}
 {$IFNDEF IPHONEOS}
     // not going to make captures on the iPhone
@@ -183,8 +184,7 @@
     PrevTime:= SDL_GetTicks;
     while isTerminated = false do
     begin
-{$IFNDEF IPHONEOS}
-// have to remove this cycle because otherwise it segfaults at exit
+
         while SDL_PollEvent(@event) <> 0 do
         begin
             case event.type_ of
@@ -210,7 +210,6 @@
                 SDL_QUITEV: isTerminated:= true
             end; // end case event.type_
         end; // end while SDL_PollEvent(@event) <> 0
-{$ENDIF}
 
         if isTerminated = false then
         begin
--- a/hedgewars/uConsts.pas	Sat Jun 19 00:48:47 2010 +0200
+++ b/hedgewars/uConsts.pas	Sun Jun 20 18:35:59 2010 +0200
@@ -303,8 +303,10 @@
 
 {$IFDEF IPHONEOS}
     cMaxCaptions = 3;
+    cDefaultZoomLevel = 1.5;
 {$ELSE}
     cMaxCaptions = 4;
+    cDefaultZoomLevel = 2.0;
 {$ENDIF}
 
     cSendEmptyPacketTime = 1000;
--- a/hedgewars/uKeys.pas	Sat Jun 19 00:48:47 2010 +0200
+++ b/hedgewars/uKeys.pas	Sun Jun 20 18:35:59 2010 +0200
@@ -79,8 +79,6 @@
     chatAction: boolean;
     pauseAction: boolean;
     switchAction: boolean;
-
-    theJoystick: PSDL_Joystick;
     
     cursorUp: boolean;
     cursorDown: boolean;
@@ -373,11 +371,10 @@
 
 {$IFDEF IPHONEOS}
 procedure setiPhoneBinds;
-// set to false the keys that only need one stoke
 begin
-    tkbdn[1]:= ord(leftClick);
-    tkbdn[2]:= ord(middleClick);
-    tkbdn[3]:= ord(rightClick);
+    tkbdn[ 1]:= ord(leftClick);
+    tkbdn[ 2]:= ord(middleClick);
+    tkbdn[ 3]:= ord(rightClick);
 
     tkbdn[23]:= ord(upKey);
     tkbdn[24]:= ord(downKey);
@@ -398,6 +395,7 @@
     tkbdn[68]:= ord(cursorLeft);
     tkbdn[69]:= ord(cursorRight);
     
+    // set to false the keys that only need one stoke
     leftClick:= false;
     middleClick:= false;
     rightClick:= false;
@@ -478,9 +476,6 @@
     end
 else    
     WriteLnToConsole('Not using any game controller');
-{$IFDEF IPHONEOS}
-theJoystick:= Controller[0];
-{$ENDIF}
 end;
 
 procedure ControllerClose;
--- a/hedgewars/uStore.pas	Sat Jun 19 00:48:47 2010 +0200
+++ b/hedgewars/uStore.pas	Sun Jun 20 18:35:59 2010 +0200
@@ -1265,19 +1265,13 @@
 end;
 
 procedure SetScale(f: GLfloat);
-var
-{$IFDEF IPHONEOS}
-scale: GLfloat = 1.5;
-{$ELSE}
-scale: GLfloat = 2.0;
-{$ENDIF}
 begin
     // leave immediately if scale factor did not change
     if f = cScaleFactor then exit;
 
-    if f = scale then
-        glPopMatrix   // "return" to default scaling
-    else                // other scaling
+    if f = cDefaultZoomLevel then
+        glPopMatrix         // "return" to default scaling
+    else                    // other scaling
     begin
         glPushMatrix;       // save default scaling
         glLoadIdentity;
--- a/hedgewars/uWorld.pas	Sat Jun 19 00:48:47 2010 +0200
+++ b/hedgewars/uWorld.pas	Sun Jun 20 18:35:59 2010 +0200
@@ -531,20 +531,22 @@
     s: string[15];
     highlight: Boolean;
     offset, offsetX, offsetY, ScreenBottom: LongInt;
-    scale: GLfloat;
     VertexBuffer: array [0..3] of TVertex2f;
 begin
-if not isPaused then
+    if not isPaused then
     begin
-    if ZoomValue < zoom then
+        if ZoomValue < zoom then
         begin
-        zoom:= zoom - 0.002 * Lag;
-        if ZoomValue > zoom then zoom:= ZoomValue
-        end else
-    if ZoomValue > zoom then
+            zoom:= zoom - 0.002 * Lag;
+            if ZoomValue > zoom then 
+                zoom:= ZoomValue
+        end 
+    else 
+        if ZoomValue > zoom then
         begin
-        zoom:= zoom + 0.002 * Lag;
-        if ZoomValue < zoom then zoom:= ZoomValue
+            zoom:= zoom + 0.002 * Lag;
+            if ZoomValue < zoom then
+                zoom:= ZoomValue
         end
     end
 else
@@ -648,12 +650,8 @@
     end;
 {$WARNINGS ON}
 
-{$IFDEF IPHONEOS}
-scale:= 1.5;
-{$ELSE}
-scale:= 2.0;
-{$ENDIF}
-SetScale(scale);
+// this scale is used to keep the various widgets at the same dimension at all zoom levels
+SetScale(cDefaultZoomLevel);
 
 
 // Turn time
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.h	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.h	Sun Jun 20 18:35:59 2010 +0200
@@ -21,6 +21,6 @@
 
 -(IBAction) buttonPressed:(id) sender;
 -(IBAction) segmentPressed:(id) sender;
--(void) startGame;
+-(void) startGame:(UIButton *)button;
 
 @end
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sun Jun 20 18:35:59 2010 +0200
@@ -28,8 +28,9 @@
             [[self parentViewController] dismissModalViewControllerAnimated:YES];
             break;
         case 1:
-            [self performSelector:@selector(startGame)
-                       withObject:nil
+            theButton.enabled = NO;
+            [self performSelector:@selector(startGame:)
+                       withObject:theButton
                        afterDelay:0.25];
             break;
         default:
@@ -68,7 +69,9 @@
     [self.view addSubview:activeController.view];
 }
 
--(void) startGame {
+-(void) startGame:(UIButton *)button {
+    button.enabled = YES;
+
     // don't start playing if the preview is in progress
     if ([mapConfigViewController busy]) {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Wait for the Preview",@"")
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m	Sun Jun 20 18:35:59 2010 +0200
@@ -103,7 +103,7 @@
 // unpacks ammostore data from the selected ammo.plist to a sequence of engine commands
 -(void) provideAmmoData:(NSString *)ammostoreName forPlayingTeams:(NSInteger) numberOfTeams {
     NSString *weaponPath = [[NSString alloc] initWithFormat:@"%@/%@",WEAPONS_DIRECTORY(),ammostoreName];
-    NSDictionary *ammoData = [[NSDictionary alloc] initWithContentsOfFile:ammoDataFile];
+    NSDictionary *ammoData = [[NSDictionary alloc] initWithContentsOfFile:weaponPath];
     [weaponPath release];
     
     NSString *ammloadt = [[NSString alloc] initWithFormat:@"eammloadt %@", [ammoData objectForKey:@"ammostore_initialqt"]];
@@ -306,7 +306,7 @@
                                   ofColor:[teamData objectForKey:@"color"]];
                 }
                 
-                [self provideAmmoData:@"Default" forPlayingTeams:[teamsConfig count]];
+                [self provideAmmoData:@"Default.plist" forPlayingTeams:[teamsConfig count]];
                 
                 clientQuit = NO;
 			} else {
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Sun Jun 20 18:35:59 2010 +0200
@@ -75,7 +75,6 @@
             }
             break;
         default:
-            DLog(@"Unknown rotation status");
             break;
     }
     self.view.frame = usefulRect;
@@ -108,6 +107,8 @@
     [dimTimer setFireDate:HIDING_TIME_DEFAULT];
 }
 
+#pragma mark -
+#pragma mark View Management
 -(void) viewDidLoad {
     isPopoverVisible = NO;
     self.view.alpha = 0;
@@ -160,6 +161,8 @@
     [super dealloc];
 }
 
+#pragma mark -
+#pragma mark Overlay actions and members
 // dim the overlay when there's no more input for a certain amount of time
 -(IBAction) buttonReleased:(id) sender {
 	HW_allKeysUp();
@@ -297,10 +300,6 @@
 
 #pragma mark -
 #pragma mark Custom touch event handling
-
-#define kMinimumPinchDelta      50
-
-
 -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
 	NSArray *twoTouches;
 	UITouch *touch = [touches anyObject];
@@ -316,7 +315,7 @@
     gestureStartPoint = [touch locationInView:self.view];
         
 	switch ([touches count]) {
-		case 1:
+		/*case 1:
 			initialDistanceForPinching = 0;
 			switch ([touch tapCount]) {
 				case 1:
@@ -331,15 +330,14 @@
 				default:
 					break;
 			}
-			break;
+			break;*/
 		case 2:
 			if (2 == [touch tapCount]) {
 				HW_zoomReset();
 			}
 			
 			// pinching
-            gestureStartPoint.x = 0;
-            gestureStartPoint.y = 0;
+            gestureStartPoint = CGPointMake(0, 0);
 			twoTouches = [touches allObjects];
 			UITouch *first = [twoTouches objectAtIndex:0];
 			UITouch *second = [twoTouches objectAtIndex:1];
@@ -352,8 +350,9 @@
 }
 
 -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+    gestureStartPoint = CGPointMake(0, 0);
 	initialDistanceForPinching = 0;
-	HW_allKeysUp();
+	//HW_allKeysUp();
 }
 
 -(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -378,14 +377,15 @@
 	UITouch *touch = [touches anyObject];
 
 	switch ([touches count]) {
-		case 1:
+		/*case 1:
 			currentPosition = [touch locationInView:self.view];
 			// panning
 			CGFloat deltaX = fabsf(gestureStartPoint.x - currentPosition.x);
 			CGFloat deltaY = fabsf(gestureStartPoint.y - currentPosition.y);
 			
+            // the two ifs are not mutually exclusive
             if (deltaX >= minimumGestureLength) {
-                NSLog(@"Horizontal swipe detected, deltaX: %f deltaY: %f",deltaX, deltaY);
+                Dlog(@"deltaX: %f deltaY: %f", deltaX, deltaY);
                 if (currentPosition.x > gestureStartPoint.x) {
                     HW_cursorLeft(logCoeff*log(deltaX));
                 } else {
@@ -394,7 +394,7 @@
 
             } 
             if (deltaY >= minimumGestureLength) {
-                NSLog(@"Horizontal swipe detected, deltaX: %f deltaY: %f",deltaX, deltaY);
+                DLog(@"deltaX: %f deltaY: %f", deltaX, deltaY);
                 if (currentPosition.y < gestureStartPoint.y) {
                     HW_cursorDown(logCoeff*log(deltaY));
                 } else {
@@ -402,22 +402,26 @@
                 }            
             }
 
-			break;
+			break;*/
 		case 2:
 			twoTouches = [touches allObjects];
 			UITouch *first = [twoTouches objectAtIndex:0];
 			UITouch *second = [twoTouches objectAtIndex:1];
 			CGFloat currentDistanceOfPinching = distanceBetweenPoints([first locationInView:self.view], [second locationInView:self.view]);
-			
-			if (0 == initialDistanceForPinching) 
-				initialDistanceForPinching = currentDistanceOfPinching;
-
-			if (currentDistanceOfPinching < initialDistanceForPinching + kMinimumPinchDelta)
-				HW_zoomOut();
-			else if (currentDistanceOfPinching > initialDistanceForPinching + kMinimumPinchDelta)
-				HW_zoomIn();
-
-			currentDistanceOfPinching = initialDistanceForPinching;
+			const int pinchDelta = 40;
+            
+			if (0 != initialDistanceForPinching) {
+                if (currentDistanceOfPinching - initialDistanceForPinching > pinchDelta) {
+                    HW_zoomIn();
+                    initialDistanceForPinching = currentDistanceOfPinching;
+                }
+                else if (initialDistanceForPinching - currentDistanceOfPinching > pinchDelta) {
+                    HW_zoomOut();
+                    initialDistanceForPinching = currentDistanceOfPinching;
+                }
+            } else 
+                initialDistanceForPinching = currentDistanceOfPinching;
+            
 			break;
 		default:
 			break;
--- a/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeSettingsViewController.m	Sun Jun 20 18:35:59 2010 +0200
@@ -116,6 +116,14 @@
     [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
 }
 
+-(BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
+    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
+    if (![cell.textLabel.text isEqualToString:@"Default"]) 
+        return YES;
+    else
+        return NO;
+}
+
 #pragma mark -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.h	Sun Jun 20 18:35:59 2010 +0200
@@ -13,14 +13,17 @@
     NSArray *listOfSchemes;
     NSArray *listOfWeapons;
     
-    NSIndexPath *lastIndexPath;
+    NSIndexPath *lastIndexPath_sc;
+    NSIndexPath *lastIndexPath_we;
+
     NSString *selectedScheme;
     NSString *selectedWeapon;
 }
 
 @property (nonatomic, retain) NSArray *listOfSchemes;
 @property (nonatomic, retain) NSArray *listOfWeapons;
-@property (nonatomic,retain) NSIndexPath *lastIndexPath;
+@property (nonatomic,retain) NSIndexPath *lastIndexPath_sc;
+@property (nonatomic,retain) NSIndexPath *lastIndexPath_we;
 @property (nonatomic,retain) NSString *selectedScheme;
 @property (nonatomic,retain) NSString *selectedWeapon;
 
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Sun Jun 20 18:35:59 2010 +0200
@@ -10,7 +10,7 @@
 #import "CommodityFunctions.h"
 
 @implementation SchemeWeaponConfigViewController
-@synthesize listOfSchemes, listOfWeapons, lastIndexPath, selectedScheme, selectedWeapon;
+@synthesize listOfSchemes, listOfWeapons, lastIndexPath_sc, lastIndexPath_we, selectedScheme, selectedWeapon;
 
 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
     return rotationManager(interfaceOrientation);
@@ -23,9 +23,6 @@
 
     CGSize screenSize = [[UIScreen mainScreen] bounds].size;
     self.view.frame = CGRectMake(0, 0, screenSize.height, screenSize.width - 44);
-
-    self.selectedScheme = @"Default.plist";
-    self.selectedWeapon = @"Default.plist";
 }
 
 -(void) viewWillAppear:(BOOL) animated {
@@ -34,24 +31,15 @@
     NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SCHEMES_DIRECTORY() error:NULL];
     self.listOfSchemes = contentsOfDir;
     
+    contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:WEAPONS_DIRECTORY() error:NULL];
+    self.listOfWeapons = contentsOfDir;
+    
+    self.selectedScheme = @"Default.plist";
+    self.selectedWeapon = @"Default.plist";
+    
     [self.tableView reloadData];
 }
 
-/*
-- (void)viewDidAppear:(BOOL)animated {
-    [super viewDidAppear:animated];
-}
-*/
-/*
-- (void)viewWillDisappear:(BOOL)animated {
-    [super viewWillDisappear:animated];
-}
-*/
-/*
-- (void)viewDidDisappear:(BOOL)animated {
-    [super viewDidDisappear:animated];
-}
-*/
 
 
 #pragma mark -
@@ -84,13 +72,13 @@
         cell.textLabel.text = [[self.listOfSchemes objectAtIndex:row] stringByDeletingPathExtension];
         if ([[self.listOfSchemes objectAtIndex:row] isEqualToString:self.selectedScheme]) {
             cell.accessoryType = UITableViewCellAccessoryCheckmark;
-            self.lastIndexPath = indexPath;
+            self.lastIndexPath_sc = indexPath;
         }
     } else {
         cell.textLabel.text = [[self.listOfWeapons objectAtIndex:row] stringByDeletingPathExtension];
         if ([[self.listOfWeapons objectAtIndex:row] isEqualToString:self.selectedWeapon]) {
             cell.accessoryType = UITableViewCellAccessoryCheckmark;
-            self.lastIndexPath = indexPath;
+            self.lastIndexPath_we = indexPath;
         }
     }
 
@@ -101,6 +89,12 @@
 #pragma mark -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    NSIndexPath *lastIndexPath;
+    if ([indexPath section] == 0)
+        lastIndexPath = self.lastIndexPath_sc;
+    else
+        lastIndexPath = self.lastIndexPath_we;
+    
     int newRow = [indexPath row];
     int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
     
@@ -110,8 +104,15 @@
         newCell.accessoryType = UITableViewCellAccessoryCheckmark;
         UITableViewCell *oldCell = [aTableView cellForRowAtIndexPath:lastIndexPath];
         oldCell.accessoryType = UITableViewCellAccessoryNone;
-        self.lastIndexPath = indexPath;
-        self.selectedScheme = [self.listOfSchemes objectAtIndex:newRow];
+        
+        if ([indexPath section] == 0) {
+            self.lastIndexPath_sc = indexPath;
+            self.selectedScheme = [self.listOfSchemes objectAtIndex:newRow];
+        } else {
+            self.lastIndexPath_we = indexPath;
+            self.selectedWeapon = [self.listOfWeapons objectAtIndex:newRow];
+        }        
+        
         [aTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
     }
     [aTableView deselectRowAtIndexPath:indexPath animated:YES];
@@ -136,7 +137,8 @@
 -(void) viewDidUnload {
     self.listOfSchemes = nil;
     self.listOfWeapons = nil;
-    self.lastIndexPath = nil;
+    self.lastIndexPath_sc = nil;
+    self.lastIndexPath_we = nil;
     self.selectedScheme = nil;
     self.selectedWeapon = nil;
     MSG_DIDUNLOAD();
@@ -146,7 +148,8 @@
 -(void) dealloc {
     [listOfSchemes release];
     [listOfWeapons release];
-    [lastIndexPath release];
+    [lastIndexPath_sc release];
+    [lastIndexPath_we release];
     [selectedScheme release];
     [selectedWeapon release];
     [super dealloc];
--- a/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/WeaponSettingsViewController.m	Sun Jun 20 18:35:59 2010 +0200
@@ -115,6 +115,14 @@
     [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
 }
 
+-(BOOL) tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
+    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
+    if (![cell.textLabel.text isEqualToString:@"Default"]) 
+        return YES;
+    else
+        return NO;
+}
+
 #pragma mark -
 #pragma mark Table view delegate
 -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
--- a/project_files/HedgewarsMobile/Classes/otherSrc/UIImageExtra.m	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/otherSrc/UIImageExtra.m	Sun Jun 20 18:35:59 2010 +0200
@@ -73,7 +73,7 @@
         // return resulting image
         return sprite;
     } else {
-        NSLog(@"initWithContentsOfFile: andCutAt: FAILED");
+        DLog(@"error - image == nil");
         return nil;
     }
 }
--- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sat Jun 19 00:48:47 2010 +0200
+++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj	Sun Jun 20 18:35:59 2010 +0200
@@ -616,12 +616,12 @@
 		6163EE4F11CC2497001C0453 /* Second Level */ = {
 			isa = PBXGroup;
 			children = (
-				616591FE11CA9BA200D6E256 /* SingleSchemeViewController.h */,
-				616591FF11CA9BA200D6E256 /* SingleSchemeViewController.m */,
 				6165920011CA9BA200D6E256 /* SingleTeamViewController.h */,
 				6165920111CA9BA200D6E256 /* SingleTeamViewController.m */,
 				6163EE7C11CC2600001C0453 /* SingleWeaponViewController.h */,
 				6163EE7D11CC2600001C0453 /* SingleWeaponViewController.m */,
+				616591FE11CA9BA200D6E256 /* SingleSchemeViewController.h */,
+				616591FF11CA9BA200D6E256 /* SingleSchemeViewController.m */,
 			);
 			name = "Second Level";
 			sourceTree = "<group>";
@@ -907,8 +907,8 @@
 			);
 			projectRoot = "";
 			targets = (
+				1D6058900D05DD3D006BFB54 /* Hedgewars */,
 				928301160F10CAFC00CC5A3C /* fpc */,
-				1D6058900D05DD3D006BFB54 /* Hedgewars */,
 				61C3251C1179A300001E70B1 /* openalbridge */,
 				6179928B114AE0C800BA94A9 /* UpdateDataFolder */,
 			);