# HG changeset patch
# User koda
# Date 1265240202 0
# Node ID 39d097ac2276bb2a19ff441efd05ece8859b3175
# Parent 21c0d2e6975397560146cbac55757014780caf74
implement transition in the way i had in mind
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/GameSetup.m
--- a/cocoaTouch/GameSetup.m Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/GameSetup.m Wed Feb 03 23:36:42 2010 +0000
@@ -247,7 +247,7 @@
#pragma mark -
#pragma mark Setting methods
-(const char **)getSettings {
- const char **gameArgs = (const char**) malloc(sizeof(char*) * 7);
+ const char **gameArgs = (const char**) malloc(sizeof(char*) * 6);
NSString *ipcString = [[NSString alloc] initWithFormat:@"%d", ipcPort];
NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt", [[NSLocale currentLocale] localeIdentifier]];
@@ -256,8 +256,7 @@
gameArgs[2] = [[systemSettings objectForKey:@"sounds"] UTF8String]; //isSoundEnabled
gameArgs[3] = [[systemSettings objectForKey:@"music"] UTF8String]; //isMusicEnabled
gameArgs[4] = [localeString UTF8String]; //cLocaleFName
- gameArgs[5] = [[systemSettings objectForKey:@"volume"] UTF8String]; //cInitVolume
- gameArgs[6] = [[systemSettings objectForKey:@"alternate"] UTF8String]; //cAltDamage
+ gameArgs[5] = [[systemSettings objectForKey:@"alternate"] UTF8String]; //cAltDamage
[localeString release];
[ipcString release];
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/MainMenuViewController.h
--- a/cocoaTouch/MainMenuViewController.h Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/MainMenuViewController.h Wed Feb 03 23:36:42 2010 +0000
@@ -11,10 +11,12 @@
@interface MainMenuViewController : UIViewController {
UILabel *versionLabel;
+ UIView *mainView;
SettingsViewController *settingsViewController;
}
@property (nonatomic, retain) IBOutlet UILabel *versionLabel;
+@property (nonatomic, retain) IBOutlet UIView *mainView;
@property (nonatomic, retain) SettingsViewController *settingsViewController;
-(IBAction) startPlaying;
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/MainMenuViewController.m
--- a/cocoaTouch/MainMenuViewController.m Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/MainMenuViewController.m Wed Feb 03 23:36:42 2010 +0000
@@ -11,7 +11,7 @@
@implementation MainMenuViewController
-@synthesize versionLabel, settingsViewController;
+@synthesize versionLabel, settingsViewController, mainView;
/*
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
@@ -58,13 +58,13 @@
// disable the buttons when to prevent launching twice the game
-(void) viewWillDisappear:(BOOL)animated {
- self.view.userInteractionEnabled = NO;
+ self.mainView.userInteractionEnabled = NO;
[super viewWillDisappear:animated];
}
--(void) viewWillAppear:(BOOL)animated {
- self.view.userInteractionEnabled = YES;
- [super viewWillAppear:animated];
+-(void) viewDidAppear:(BOOL)animated {
+ self.mainView.userInteractionEnabled = YES;
+ [super viewDidAppear:animated];
}
#pragma mark -
@@ -92,16 +92,17 @@
SettingsViewController *controller = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController"
bundle:nil];
self.settingsViewController = controller;
+ self.settingsViewController.parentView = self.mainView;
[controller release];
}
- self.settingsViewController.view.frame = CGRectMake(0, -480, 480, 320);
+ self.settingsViewController.view.frame = CGRectMake(0, -320, 480, 320);
[UIView beginAnimations:@"View Switch" context:NULL];
[UIView setAnimationDuration:3];
[UIView setAnimationDuration:UIViewAnimationCurveEaseOut];
self.settingsViewController.view.frame = CGRectMake(0, 0, 480, 320);
+ self.mainView.frame = CGRectMake(0, 320, 480, 320);
- // we have the new controller, let's switch
[self.view addSubview:settingsViewController.view];
[UIView commitAnimations];
}
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/MainMenuViewController.xib
--- a/cocoaTouch/MainMenuViewController.xib Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/MainMenuViewController.xib Wed Feb 03 23:36:42 2010 +0000
@@ -12,7 +12,7 @@
- 4
-
-
-
-
- 5
-
-
-
-
- 7
-
+ 21
+
+
+ YES
+
+
+
+
+
+
+
+
- 8
-
-
+ 22
+
+
+
+
+ 23
+
+
+
+
+ 24
+
+
- 13
-
-
+ 25
+
+
- 18
-
-
+ 26
+
+
- 19
-
-
+ 27
+
+
+
+
+ 28
+
+
@@ -340,19 +363,21 @@
-2.CustomClassName
1.IBEditorWindowLastContentRect
1.IBPluginDependency
- 13.IBPluginDependency
- 18.IBPluginDependency
- 19.IBPluginDependency
- 4.IBPluginDependency
- 5.IBPluginDependency
- 7.IBPluginDependency
- 8.IBPluginDependency
+ 21.IBPluginDependency
+ 22.IBPluginDependency
+ 23.IBPluginDependency
+ 24.IBPluginDependency
+ 25.IBPluginDependency
+ 26.IBPluginDependency
+ 27.IBPluginDependency
+ 28.IBPluginDependency
YES
MainMenuViewController
UIResponder
- {{577, 514}, {480, 320}}
+ {{619, 293}, {480, 320}}
+ com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
@@ -379,7 +404,7 @@
- 20
+ 33
@@ -406,12 +431,12 @@
YES
YES
- settingsViewController
+ mainView
versionLabel
YES
- SettingsViewController
+ UIView
UILabel
@@ -420,54 +445,6 @@
../../../hedge.build/trunk/cocoaTouch/MainMenuViewController.h
-
- SettingsViewController
- UIViewController
-
- YES
-
- YES
- backgroundTap:
- deleteData:
- sliderChanged:
- textFieldDoneEditing:
-
-
- YES
- id
- id
- id
- id
-
-
-
- YES
-
- YES
- buttonContainer
- password
- table
- username
- volumeCell
- volumeLabel
- volumeSlider
-
-
- YES
- UIView
- UITextField
- UITableView
- UITextField
- UITableViewCell
- UILabel
- UISlider
-
-
-
- IBProjectSource
- ../../../hedge.build/trunk/cocoaTouch/SettingsViewController.h
-
-
YES
@@ -642,14 +619,6 @@
- UIScrollView
- UIView
-
- IBFrameworkSource
- UIKit.framework/Headers/UIScrollView.h
-
-
-
UISearchBar
UIView
@@ -666,43 +635,14 @@
- UISlider
- UIControl
-
- IBFrameworkSource
- UIKit.framework/Headers/UISlider.h
-
-
-
- UITableView
- UIScrollView
+ UIView
IBFrameworkSource
- UIKit.framework/Headers/UITableView.h
-
-
-
- UITableViewCell
- UIView
-
- IBFrameworkSource
- UIKit.framework/Headers/UITableViewCell.h
-
-
-
- UITextField
- UIControl
-
- IBFrameworkSource
UIKit.framework/Headers/UITextField.h
UIView
-
-
-
- UIView
UIResponder
IBFrameworkSource
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m
--- a/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m Wed Feb 03 23:36:42 2010 +0000
@@ -80,7 +80,7 @@
// remove the current view to free resources
[UIView beginAnimations:@"removing main controller" context:NULL];
[UIView setAnimationDuration:1];
- self.viewController.view.alpha = 0;
+ self.viewController.mainView.alpha = 0;
[UIView commitAnimations];
NSLog(@"Game is launching...");
@@ -100,7 +100,7 @@
[UIView beginAnimations:@"inserting main controller" context:NULL];
[UIView setAnimationDuration:1];
- self.viewController.view.alpha = 1;
+ self.viewController.mainView.alpha = 1;
[UIView commitAnimations];
[internal_pool release];
@@ -122,7 +122,6 @@
[saveDict setObject:@"1" forKey:@"music"];
[saveDict setObject:@"1" forKey:@"sounds"];
[saveDict setObject:@"0" forKey:@"alternate"];
- [saveDict setObject:@"100" forKey:@"volume"];
[saveDict writeToFile:filePath atomically:YES];
[saveDict release];
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/SettingsViewController.h
--- a/cocoaTouch/SettingsViewController.h Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/SettingsViewController.h Wed Feb 03 23:36:42 2010 +0000
@@ -16,11 +16,10 @@
UISwitch *musicSwitch;
UISwitch *soundsSwitch;
UISwitch *altDamageSwitch;
- UISlider *volumeSlider;
- UILabel *volumeLabel;
- UITableView *table;
+ UITableView *settingsTable;
UITableViewCell *volumeCell;
UIView *buttonContainer;
+ UIView *parentView;
BOOL needsReset;
}
@@ -29,13 +28,10 @@
@property (nonatomic, retain) UISwitch *musicSwitch;
@property (nonatomic, retain) UISwitch *soundsSwitch;
@property (nonatomic, retain) UISwitch *altDamageSwitch;
-@property (nonatomic, retain) IBOutlet UISlider *volumeSlider;
-@property (nonatomic, retain) IBOutlet UILabel *volumeLabel;
-@property (nonatomic, retain) IBOutlet UITableView *table;
-@property (nonatomic, retain) IBOutlet UITableViewCell *volumeCell;
+@property (nonatomic, retain) IBOutlet UITableView *settingsTable;
@property (nonatomic, retain) IBOutlet UIView *buttonContainer;
+@property (nonatomic, retain) UIView *parentView;
--(IBAction) sliderChanged: (id)sender;
-(IBAction) backgroundTap: (id)sender;
-(IBAction) textFieldDoneEditing: (id)sender;
-(IBAction) deleteData: (id)sender;
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/SettingsViewController.m
--- a/cocoaTouch/SettingsViewController.m Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/SettingsViewController.m Wed Feb 03 23:36:42 2010 +0000
@@ -12,7 +12,7 @@
@implementation SettingsViewController
@synthesize username, password, musicSwitch, soundsSwitch, altDamageSwitch,
- volumeSlider, volumeLabel, table, volumeCell, buttonContainer;
+ settingsTable, buttonContainer, parentView;
-(void) loadView {
@@ -48,24 +48,18 @@
} else {
altDamageSwitch.on = NO;
}
-
- [volumeSlider setValue:[[data objectForKey:@"volume"] intValue] animated:NO];
[data release];
} else {
[NSException raise:@"File NOT found" format:@"The file settings.plist was not found at %@", filePath];
}
- NSString *tmpVol = [[NSString alloc] initWithFormat:@"%d", (int) volumeSlider.value];
- volumeLabel.text = tmpVol;
- [tmpVol release];
username.textColor = [UIColor grayColor];
password.textColor = [UIColor grayColor];
- volumeLabel.textColor = [UIColor grayColor];
- table.backgroundColor = [UIColor clearColor];
- table.allowsSelection = NO;
+ settingsTable.backgroundColor = [UIColor clearColor];
+ settingsTable.allowsSelection = NO;
buttonContainer.backgroundColor = [UIColor clearColor];
- table.tableFooterView = buttonContainer;
+ settingsTable.tableFooterView = buttonContainer;
[super viewDidLoad];
}
@@ -76,10 +70,7 @@
self.musicSwitch = nil;
self.soundsSwitch = nil;
self.altDamageSwitch = nil;
- self.volumeLabel = nil;
- self.volumeSlider = nil;
- self.table = nil;
- self.volumeCell = nil;
+ self.settingsTable = nil;
self.buttonContainer = nil;
[super viewDidUnload];
}
@@ -97,7 +88,6 @@
[saveDict setObject:tmpMus forKey:@"music"];
[saveDict setObject:tmpEff forKey:@"sounds"];
[saveDict setObject:tmpAlt forKey:@"alternate"];
- [saveDict setObject:volumeLabel.text forKey:@"volume"];
[saveDict writeToFile:[[SDLUIKitDelegate sharedAppDelegate] dataFilePath:@"settings.plist"] atomically:YES];
[saveDict release];
@@ -111,10 +101,7 @@
[musicSwitch release];
[soundsSwitch release];
[altDamageSwitch release];
- [volumeLabel release];
- [volumeSlider release];
- [table release];
- [volumeCell release];
+ [settingsTable release];
[buttonContainer release];
[super dealloc];
}
@@ -137,15 +124,6 @@
[sender resignFirstResponder];
}
-// update the value of the label when slider is updated
--(IBAction) sliderChanged: (id) sender {
- UISlider *slider = (UISlider *)sender;
- int progress = slider.value;
- NSString *newLabel = [[NSString alloc] initWithFormat:@"%d",progress];
- self.volumeLabel.text = newLabel;
- [newLabel release];
-}
-
// set music off when sound is turned off
-(void) sameValueSwitch {
if (YES == self.musicSwitch.on) {
@@ -176,10 +154,12 @@
[UIView setAnimationDuration:3];
[UIView setAnimationDuration:UIViewAnimationCurveEaseOut];
- self.view.frame = CGRectMake(0, -480, 480, 320);
+ self.view.frame = CGRectMake(0, -320, 480, 320);
+ self.parentView.frame = CGRectMake(0, 0, 480, 320);
[UIView commitAnimations];
-
+
[self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:2];
+ self.parentView = nil;
}
-(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
@@ -227,7 +207,7 @@
return 2;
break;
case kAudioFields:
- return 3;
+ return 2;
break;
case kOtherFields:
return 1;
@@ -277,9 +257,6 @@
cell.accessoryView = musicSwitch;
cell.textLabel.text = NSLocalizedString(@"Music", @"");
break;
- case 2:
- cell = volumeCell;
- break;
default:
NSLog(@"Warning: unset case value in kAudioFields section!");
break;
@@ -325,12 +302,14 @@
return containerView;
}
+/*
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (kAudioFields == [indexPath section] && 2 == [indexPath row])
return volumeCell.frame.size.height;
else
return table.rowHeight;
}
+*/
-(CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 57.0;
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/SettingsViewController.xib
--- a/cocoaTouch/SettingsViewController.xib Wed Feb 03 13:02:28 2010 +0000
+++ b/cocoaTouch/SettingsViewController.xib Wed Feb 03 23:36:42 2010 +0000
@@ -128,94 +128,11 @@
{480, 320}
-
+
1
MCAwIDAAA
-
-
- 292
-
- YES
-
-
- 256
-
- YES
-
-
- 292
- {{10, 37}, {284, 23}}
-
- NO
- YES
- YES
- 0
- 0
- 100
- 100
- NO
-
-
-
- 292
- {{250, 8}, {42, 21}}
-
- NO
- YES
- NO
-
-
- 1
- MCAwLjUwMTk2MDgxNCAxAA
-
-
- 1
- 10
- 2
-
-
-
- 292
- {{12, 8}, {62, 21}}
-
- NO
- YES
- NO
- Volume
-
- Helvetica-Bold
- 17
- 16
-
-
-
- 1
- 10
-
-
- {320, 69}
-
-
- 3
- MCAwAA
-
- NO
- YES
- 4
- YES
-
-
- {320, 70}
-
- 1
- MSAxIDEAA
-
- NO
- 1
-
-
292
@@ -320,32 +237,6 @@
- volumeSlider
-
-
-
- 23
-
-
-
- sliderChanged:
-
-
- 3
-
- 25
-
-
-
- sliderChanged:
-
-
- 4
-
- 26
-
-
-
dataSource
@@ -361,30 +252,6 @@
32
-
- table
-
-
-
- 34
-
-
-
- volumeLabel
-
-
-
- 36
-
-
-
- volumeCell
-
-
-
- 39
-
-
deleteData:
@@ -401,6 +268,14 @@
46
+
+
+ settingsTable
+
+
+
+ 47
+
@@ -438,32 +313,6 @@
- 37
-
-
- YES
-
-
-
-
-
-
-
- 7
-
-
-
-
- 35
-
-
-
-
- 38
-
-
-
-
5
@@ -504,10 +353,6 @@
1.IBEditorWindowLastContentRect
1.IBPluginDependency
30.IBPluginDependency
- 35.IBPluginDependency
- 37.IBEditorWindowLastContentRect
- 37.IBPluginDependency
- 38.IBPluginDependency
4.IBPluginDependency
41.IBEditorWindowLastContentRect
41.IBPluginDependency
@@ -515,7 +360,6 @@
44.IBPluginDependency
5.IBPluginDependency
6.IBPluginDependency
- 7.IBPluginDependency
YES
@@ -526,17 +370,12 @@
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- {{564, 553}, {320, 70}}
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
{{1352, 334}, {220, 50}}
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
{{476, 500}, {480, 100}}
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
com.apple.InterfaceBuilder.IBCocoaTouchPlugin
- com.apple.InterfaceBuilder.IBCocoaTouchPlugin
@@ -555,7 +394,7 @@
- 46
+ 47
@@ -586,11 +425,8 @@
YES
buttonContainer
password
- table
+ settingsTable
username
- volumeCell
- volumeLabel
- volumeSlider
YES
@@ -598,9 +434,6 @@
UITextField
UITableView
UITextField
- UITableViewCell
- UILabel
- UISlider
@@ -769,14 +602,6 @@
- UILabel
- UIView
-
- IBFrameworkSource
- UIKit.framework/Headers/UILabel.h
-
-
-
UIResponder
NSObject
@@ -806,14 +631,6 @@
- UISlider
- UIControl
-
- IBFrameworkSource
- UIKit.framework/Headers/UISlider.h
-
-
-
UITableView
UIScrollView
@@ -822,14 +639,6 @@
- UITableViewCell
- UIView
-
- IBFrameworkSource
- UIKit.framework/Headers/UITableViewCell.h
-
-
-
UITextField
UIControl
diff -r 21c0d2e69753 -r 39d097ac2276 cocoaTouch/resources/settingsButton.png
Binary file cocoaTouch/resources/settingsButton.png has changed
diff -r 21c0d2e69753 -r 39d097ac2276 hedgewars/hwengine.pas
--- a/hedgewars/hwengine.pas Wed Feb 03 13:02:28 2010 +0000
+++ b/hedgewars/hwengine.pas Wed Feb 03 23:36:42 2010 +0000
@@ -69,7 +69,7 @@
// proto.inc
{$IFDEF IPHONEOS}
-type arrayofpchar = array[0..6] of PChar;
+type arrayofpchar = array[0..5] of PChar;
procedure DoTimer(Lag: LongInt);
procedure OnDestroy;
procedure MainLoop;
@@ -232,26 +232,25 @@
initEverything();
Randomize();
- val('480', cScreenWidth);
- val('320', cScreenHeight);
+ cScreenWidth:= 480;
+ cScreenHeight:= 320;
cInitWidth:= cScreenWidth;
cInitHeight:= cScreenHeight;
- cBitsStr:= '32';
- val(cBitsStr, cBits);
+ cBits:= 32;
cFullScreen:= false;
cVSyncInUse:= true;
- val('8', cTimerInterval);
+ cTimerInterval:= 8;
PathPrefix:= 'Data';
cReducedQuality:= false;
cShowFPS:= true;
+ cInitVolume:= 100;
UserNick:= gameArgs[0];
val(gameArgs[1], ipcPort);
isSoundEnabled:= gameArgs[2] = '1';
isMusicEnabled:= gameArgs[3] = '1';
cLocaleFName:= gameArgs[4];
- val(gameArgs[5], cInitVolume);
- cAltDamage:= gameArgs[6] = '1';
+ cAltDamage:= gameArgs[5] = '1';
{$ENDIF}
for p:= Succ(Low(TPathType)) to High(TPathType) do