project_files/HedgewarsMobile/Classes/MainMenuViewController.m
changeset 3667 9359a70df013
parent 3662 a44406f4369b
child 3697 d5b30d6373fc
equal deleted inserted replaced
3665:bc06dd09cb21 3667:9359a70df013
    10 #import "SDL_uikitappdelegate.h"
    10 #import "SDL_uikitappdelegate.h"
    11 #import "PascalImports.h"
    11 #import "PascalImports.h"
    12 #import "GameConfigViewController.h"
    12 #import "GameConfigViewController.h"
    13 #import "SplitViewRootController.h"
    13 #import "SplitViewRootController.h"
    14 #import "CommodityFunctions.h"
    14 #import "CommodityFunctions.h"
       
    15 #import "SDL_mixer.h"
    15 
    16 
    16 @implementation MainMenuViewController
    17 @implementation MainMenuViewController
    17 @synthesize versionLabel;
    18 @synthesize versionLabel;
    18 
    19 
    19 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    20 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    28     if (gameConfigViewController.view.superview == nil) 
    29     if (gameConfigViewController.view.superview == nil) 
    29         gameConfigViewController = nil;
    30         gameConfigViewController = nil;
    30     MSG_MEMCLEAN();
    31     MSG_MEMCLEAN();
    31 }
    32 }
    32 
    33 
       
    34 // using a different thread for audio 'cos it's slow
       
    35 -(void) initAudioThread {
       
    36     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
       
    37     Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 1, 512);
       
    38     [pool release];
       
    39 }
       
    40 
    33 -(void) viewDidLoad {
    41 -(void) viewDidLoad {
       
    42     [NSThread detachNewThreadSelector:@selector(initAudioThread)
       
    43                              toTarget:self
       
    44                            withObject:nil];
       
    45     
    34     char *ver;
    46     char *ver;
    35     HW_versionInfo(NULL, &ver);
    47     HW_versionInfo(NULL, &ver);
    36     NSString *versionNumber = [[NSString alloc] initWithCString:ver];
    48     NSString *versionNumber = [[NSString alloc] initWithCString:ver];
    37     self.versionLabel.text = versionNumber;
    49     self.versionLabel.text = versionNumber;
    38     [versionNumber release];
    50     [versionNumber release];