# HG changeset patch # User koda # Date 1265059575 0 # Node ID bfccb2ec4334a2b920d8fc432051cd3cdaec25a9 # Parent 4d1406bc8b3e1ff4066f786ef1347b452d27185e new graphics from Tiy and frontend is loaded in landscape mode diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/GameSetup.m --- a/cocoaTouch/GameSetup.m Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/GameSetup.m Mon Feb 01 21:26:15 2010 +0000 @@ -172,7 +172,7 @@ [self sendToEngine:@"ehat Bunny"]; // team 2 ammostore - [self sendToEngine:@"eammstore 93919294221991210322351110012010000002110404000441400444645644444774776112211144"]; + [self sendToEngine:@"eammstore 20501090003040000009000000000000000000010404000441400444645644444774776112211144"]; clientQuit = NO; } else { diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/MainMenuViewController.m --- a/cocoaTouch/MainMenuViewController.m Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/MainMenuViewController.m Mon Feb 01 21:26:15 2010 +0000 @@ -30,13 +30,10 @@ [super viewDidLoad]; } -/* -// Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return (interfaceOrientation == UIInterfaceOrientationPortrait); +-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation { + if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) return YES; + else return NO; } -*/ /* - (void)didReceiveMemoryWarning { diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/MainMenuViewController.xib --- a/cocoaTouch/MainMenuViewController.xib Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/MainMenuViewController.xib Mon Feb 01 21:26:15 2010 +0000 @@ -12,6 +12,7 @@ YES + YES @@ -42,9 +43,8 @@ 274 - {320, 431} + {480, 320} - 3 MCAwAA @@ -54,15 +54,14 @@ NO NSImage - Background.png + background.png 292 - {{44, 131}, {232, 61}} + {{223, 46}, {232, 61}} - 1 MCAwIDAgMAA @@ -90,15 +89,14 @@ NSImage - Button_play.png + playButton.png 292 - {{20, 215}, {232, 61}} + {{199, 130}, {232, 61}} - 1 MCAwIDAgMAA @@ -116,15 +114,14 @@ NSImage - Button_network.png + networkButton.png 292 - {{44, 298}, {232, 61}} + {{223, 213}, {232, 61}} - 1 MCAwIDAgMAA @@ -142,7 +139,7 @@ NSImage - Button_store.png + storeButton.png @@ -150,7 +147,6 @@ 292 {{44, 384}, {232, 21}} - NO YES NO @@ -170,11 +166,9 @@ 2 - {320, 431} + {480, 320} - - @@ -263,10 +257,10 @@ YES + - @@ -326,7 +320,7 @@ YES MainMenuViewController UIResponder - {{493, 454}, {320, 480}} + {{493, 614}, {480, 320}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/MainWindow.xib --- a/cocoaTouch/MainWindow.xib Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/MainWindow.xib Mon Feb 01 21:26:15 2010 +0000 @@ -12,7 +12,6 @@ YES - YES @@ -37,90 +36,21 @@ - + 1316 - {320, 480} + {480, 320} + + 1 MCAwIDAAA NO - - - YES - - Item 2 - - 1 - Teams - - NSImage - tabButton2.png - - - - - TeamEditViewController - - - YES - - Item 1 - - Main - - NSImage - tabButton1.png - - - - - MainMenuViewController - - - - Item 3 - - 2 - Schemes - - NSImage - tabButton3.png - - - - - - SchemeEditViewController - - - Item 4 - - 3 - Settings - - NSImage - tabButton4.png - - - - - - SettingsViewController - - - - - 266 - {{129, 330}, {163, 49}} - - 3 - MCAwAA - - NO - + + MainMenuViewController + YES @@ -136,20 +66,20 @@ - controller - - - - 23 - - - uiwindow 25 + + + viewController + + + + 28 + @@ -185,79 +115,10 @@ - 10 - - - YES - - - - - - + 26 + - - 11 - - - - - 12 - - - YES - - - - - - 13 - - - YES - - - - - - 14 - - - - - 15 - - - - - 16 - - - YES - - - - - - 17 - - - - - 18 - - - YES - - - - - - 19 - - - @@ -266,20 +127,12 @@ YES -1.CustomClassName -2.CustomClassName - 10.IBEditorWindowLastContentRect - 10.IBPluginDependency - 11.IBPluginDependency - 12.CustomClassName - 12.IBPluginDependency - 13.CustomClassName - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 16.CustomClassName - 18.CustomClassName 2.IBAttributePlaceholdersKey 2.IBEditorWindowLastContentRect 2.IBPluginDependency + 26.CustomClassName + 26.IBEditorWindowLastContentRect + 26.IBPluginDependency 3.CustomClassName 3.IBPluginDependency @@ -287,17 +140,6 @@ YES UIApplication UIResponder - {{144, 608}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MainMenuViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TeamEditViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - SchemeEditViewController - SettingsViewController YES @@ -305,7 +147,10 @@ YES - {{820, 472}, {320, 480}} + {{530, 261}, {480, 320}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + MainMenuViewController + {{349, 679}, {480, 320}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin SDLUIKitDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -327,7 +172,7 @@ - 25 + 28 @@ -377,13 +222,13 @@ YES YES - controller uiwindow + viewController YES - UITabBarController UIWindow + UIViewController @@ -391,83 +236,6 @@ ../../../hedge.build/trunk/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h - - SchemeEditViewController - UIViewController - - YES - - YES - cell0 - table - - - YES - UITableViewCell - UITableView - - - - IBProjectSource - ../../../hedge.build/trunk/cocoaTouch/SchemeEditViewController.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 - - - - TeamEditViewController - UIViewController - - IBProjectSource - ../../../hedge.build/trunk/cocoaTouch/TeamEditViewController.h - - YES @@ -613,14 +381,6 @@ - UIBarItem - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIBarItem.h - - - UIButton UIControl @@ -650,14 +410,6 @@ - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - UISearchBar UIView @@ -674,67 +426,14 @@ - UISlider - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISlider.h - - - - UITabBar - UIView + UIView IBFrameworkSource - UIKit.framework/Headers/UITabBar.h - - - - UITabBarController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UITabBarItem - UIBarItem - - IBFrameworkSource - UIKit.framework/Headers/UITabBarItem.h - - - - UITableView - UIScrollView - - 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 @@ -750,7 +449,10 @@ UIViewController - + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + UIViewController diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h --- a/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.h Mon Feb 01 21:26:15 2010 +0000 @@ -26,13 +26,13 @@ @interface SDLUIKitDelegate:NSObject { SDL_Window *window; UIWindow *uiwindow; - UITabBarController *controller; + UIViewController *viewController; } // the outlets are set in MainWindow.xib @property (readwrite, assign) SDL_Window *window; @property (readwrite, retain) IBOutlet UIWindow *uiwindow; -@property (nonatomic, retain) IBOutlet UITabBarController *controller; +@property (nonatomic, retain) IBOutlet UIViewController *viewController; +(SDLUIKitDelegate *)sharedAppDelegate; -(NSString *)dataFilePath:(NSString *)fileName; diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m --- a/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m Mon Feb 01 21:26:15 2010 +0000 @@ -47,7 +47,7 @@ @implementation SDLUIKitDelegate -@synthesize uiwindow, window, controller; +@synthesize uiwindow, window, viewController; /* convenience method */ +(SDLUIKitDelegate *)sharedAppDelegate { @@ -59,12 +59,12 @@ self = [super init]; self.uiwindow = nil; self.window = NULL; - self.controller = nil; + self.viewController = nil; return self; } -(void) dealloc { - [controller release]; + [viewController release]; [uiwindow release]; [super dealloc]; } @@ -80,9 +80,9 @@ // remove the current view to free resources [UIView beginAnimations:@"removing main controller" context:NULL]; [UIView setAnimationDuration:1]; - controller.view.alpha = 0; + viewController.view.alpha = 0; [UIView commitAnimations]; - [controller.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; + [viewController.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1]; NSLog(@"Game is launching..."); const char **gameArgs = [setup getSettings]; @@ -94,15 +94,14 @@ free(gameArgs); NSLog(@"Game is exting..."); - [[uiwindow viewWithTag:54321] removeFromSuperview]; [setup release]; [UIView beginAnimations:@"inserting main controller" context:NULL]; [UIView setAnimationDuration:1]; - controller.view.alpha = 1; + viewController.view.alpha = 1; [UIView commitAnimations]; - [uiwindow addSubview: controller.view]; + [uiwindow addSubview: viewController.view]; [uiwindow makeKeyAndVisible]; [internal_pool release]; @@ -152,16 +151,19 @@ #pragma mark - #pragma mark SDLUIKitDelegate methods + + // override the direct execution of SDL_main to allow us to implement the frontend (even using a nib) -(void) applicationDidFinishLaunching:(UIApplication *)application { [application setStatusBarHidden:YES animated:NO]; - + [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; + [self checkFirstRun]; /* Set working directory to resource path */ [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]]; - [uiwindow addSubview:controller.view]; + [uiwindow addSubview:viewController.view]; [uiwindow makeKeyAndVisible]; } diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/SDLOverrides/SDL_uikitview.h --- a/cocoaTouch/SDLOverrides/SDL_uikitview.h Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/SDLOverrides/SDL_uikitview.h Mon Feb 01 21:26:15 2010 +0000 @@ -58,9 +58,6 @@ +(void) attackButtonPressed; +(void) attackButtonReleased; -@property CGFloat initialDistance; -@property CGPoint gestureStartPoint; - #if SDL_IPHONE_KEYBOARD - (void)showKeyboard; - (void)hideKeyboard; diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/SDLOverrides/SDL_uikitview.m --- a/cocoaTouch/SDLOverrides/SDL_uikitview.m Mon Feb 01 19:43:57 2010 +0000 +++ b/cocoaTouch/SDLOverrides/SDL_uikitview.m Mon Feb 01 21:26:15 2010 +0000 @@ -276,13 +276,11 @@ if (0 == initialDistanceForPinching) initialDistanceForPinching = currentDistanceOfPinching; - if (currentDistanceOfPinching < initialDistanceForPinching + kMinimumPinchDelta) { - NSLog(@"Outward pinch detected"); + if (currentDistanceOfPinching < initialDistanceForPinching + kMinimumPinchDelta) HW_zoomOut(); - } else if (currentDistanceOfPinching > initialDistanceForPinching + kMinimumPinchDelta){ - NSLog(@"Inward pinch detected"); + else if (currentDistanceOfPinching > initialDistanceForPinching + kMinimumPinchDelta) HW_zoomIn(); - } + currentDistanceOfPinching = initialDistanceForPinching; break; default: diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/Background.png Binary file cocoaTouch/resources/Background.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/Button_network.png Binary file cocoaTouch/resources/Button_network.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/Button_play.png Binary file cocoaTouch/resources/Button_play.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/Button_store.png Binary file cocoaTouch/resources/Button_store.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/Default.png Binary file cocoaTouch/resources/Default.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/background.png Binary file cocoaTouch/resources/background.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/networkButton.png Binary file cocoaTouch/resources/networkButton.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/playButton.png Binary file cocoaTouch/resources/playButton.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/storeButton.png Binary file cocoaTouch/resources/storeButton.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/tabButton1.png Binary file cocoaTouch/resources/tabButton1.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/tabButton2.png Binary file cocoaTouch/resources/tabButton2.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/tabButton3.png Binary file cocoaTouch/resources/tabButton3.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/tabButton4.png Binary file cocoaTouch/resources/tabButton4.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 cocoaTouch/resources/title.png Binary file cocoaTouch/resources/title.png has changed diff -r 4d1406bc8b3e -r bfccb2ec4334 hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Mon Feb 01 19:43:57 2010 +0000 +++ b/hedgewars/CCHandlers.inc Mon Feb 01 21:26:15 2010 +0000 @@ -631,8 +631,7 @@ end; {$IFDEF SDL13} - window:= SDL_CreateWindow('Hedgewars', 0, 0, - {$IFDEF IPHONEOS}cScreenHeight, cScreenWidth,{$ELSE}cScreenWidth, cScreenHeight,{$ENDIF} + window:= SDL_CreateWindow('Hedgewars', 0, 0, cScreenWidth, cScreenHeight, SDL_WINDOW_OPENGL or SDL_WINDOW_SHOWN {$IFDEF IPHONEOS} or SDL_WINDOW_BORDERLESS{$ENDIF}); SDL_CreateRenderer(window, -1, 0);