project_files/HedgewarsMobile/Classes/GameConfigViewController.m
changeset 5666 cc79eb30346e
parent 5455 df05cdb998ed
child 5699 1a9a6a7662aa
equal deleted inserted replaced
5664:dfc574d7f49e 5666:cc79eb30346e
    28 #import "CommodityFunctions.h"
    28 #import "CommodityFunctions.h"
    29 #import "UIImageExtra.h"
    29 #import "UIImageExtra.h"
    30 #import "PascalImports.h"
    30 #import "PascalImports.h"
    31 
    31 
    32 @implementation GameConfigViewController
    32 @implementation GameConfigViewController
    33 @synthesize imgContainer, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController;
    33 @synthesize imgContainer, helpPage, mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController, interfaceBridge;
    34 
    34 
    35 
    35 
    36 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    36 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    37     return rotationManager(interfaceOrientation);
    37     return rotationManager(interfaceOrientation);
    38 }
    38 }
   228                                     self.schemeWeaponConfigViewController.selectedScheme,@"scheme",
   228                                     self.schemeWeaponConfigViewController.selectedScheme,@"scheme",
   229                                     self.schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   229                                     self.schemeWeaponConfigViewController.selectedWeapon,@"weapon",
   230                                     script,@"mission_command",
   230                                     script,@"mission_command",
   231                                     nil];
   231                                     nil];
   232 
   232 
   233     GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self];
   233     if (self.interfaceBridge == nil) {
   234 
   234         GameInterfaceBridge *bridge = [[GameInterfaceBridge alloc] initWithController:self];
   235     [bridge startLocalGame:gameDictionary];
   235         self.interfaceBridge = bridge;
   236 
   236         [bridge release];
   237     [bridge release];
   237     }
       
   238     [self.interfaceBridge startLocalGame:gameDictionary];
   238 }
   239 }
   239 
   240 
   240 -(void) loadNiceHogs {
   241 -(void) loadNiceHogs {
   241     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   242     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   242     NSString *filePath = [NSString stringWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
   243     NSString *filePath = [NSString stringWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()];
   375         self.helpPage = nil;
   376         self.helpPage = nil;
   376     if (self.mapConfigViewController.view.superview == nil)
   377     if (self.mapConfigViewController.view.superview == nil)
   377         self.mapConfigViewController = nil;
   378         self.mapConfigViewController = nil;
   378 
   379 
   379     self.imgContainer = nil;
   380     self.imgContainer = nil;
       
   381     self.interfaceBridge = nil;
   380     MSG_MEMCLEAN();
   382     MSG_MEMCLEAN();
   381     [super didReceiveMemoryWarning];
   383     [super didReceiveMemoryWarning];
   382 }
   384 }
   383 
   385 
   384 -(void) viewDidUnload {
   386 -(void) viewDidUnload {
   385     self.imgContainer = nil;
   387     self.imgContainer = nil;
       
   388     self.interfaceBridge = nil;
   386     self.mapConfigViewController = nil;
   389     self.mapConfigViewController = nil;
   387     self.teamConfigViewController = nil;
   390     self.teamConfigViewController = nil;
   388     self.schemeWeaponConfigViewController = nil;
   391     self.schemeWeaponConfigViewController = nil;
   389     self.helpPage = nil;
   392     self.helpPage = nil;
   390     MSG_DIDUNLOAD();
   393     MSG_DIDUNLOAD();
   391     [super viewDidUnload];
   394     [super viewDidUnload];
   392 }
   395 }
   393 
   396 
   394 -(void) dealloc {
   397 -(void) dealloc {
   395     releaseAndNil(imgContainer);
   398     releaseAndNil(imgContainer);
       
   399     releaseAndNil(interfaceBridge);
   396     releaseAndNil(mapConfigViewController);
   400     releaseAndNil(mapConfigViewController);
   397     releaseAndNil(teamConfigViewController);
   401     releaseAndNil(teamConfigViewController);
   398     releaseAndNil(schemeWeaponConfigViewController);
   402     releaseAndNil(schemeWeaponConfigViewController);
   399     releaseAndNil(helpPage);
   403     releaseAndNil(helpPage);
   400     [super dealloc];
   404     [super dealloc];