cocoaTouch/otherSrc/CommodityFunctions.m
changeset 3352 ac5d14a35482
parent 3340 96dd168b080b
child 3365 37ac593e9027
equal deleted inserted replaced
3351:3fd3f116f2fc 3352:ac5d14a35482
    34                              @"Statue",@"grave", @"Plane",@"fort", @"Default",@"voicepack",
    34                              @"Statue",@"grave", @"Plane",@"fort", @"Default",@"voicepack",
    35                              @"hedgewars",@"flag", hedgehogs,@"hedgehogs", nil];
    35                              @"hedgewars",@"flag", hedgehogs,@"hedgehogs", nil];
    36     [hedgehogs release];
    36     [hedgehogs release];
    37     
    37     
    38     NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
    38     NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
    39     NSLog(@"%@",teamFile);
    39 
    40     [theTeam writeToFile:teamFile atomically:YES];
    40     [theTeam writeToFile:teamFile atomically:YES];
    41     [teamFile release];
    41     [teamFile release];
    42     [theTeam release];
    42     [theTeam release];
    43 }
       
    44 
       
    45 UIImage *mergeHogHatSprites (UIImage *firstImage, UIImage *secondImage) {
       
    46     UIGraphicsBeginImageContext(firstImage.size);
       
    47     [firstImage drawAtPoint:CGPointMake(0,0)];
       
    48     [secondImage drawAtPoint:CGPointMake(0,-5)];
       
    49     UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
       
    50     UIGraphicsEndImageContext();
       
    51     return resultImage; // autoreleased
       
    52 }
    43 }
    53 
    44 
    54 BOOL rotationManager (UIInterfaceOrientation interfaceOrientation) {
    45 BOOL rotationManager (UIInterfaceOrientation interfaceOrientation) {
    55     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    46     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    56         return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    47         return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);