project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
changeset 6656 6aeaba3ee584
parent 6624 e049b5bb0ad1
child 6667 142fe596e75e
equal deleted inserted replaced
6655:1edd500b2471 6656:6aeaba3ee584
    34 #pragma mark -
    34 #pragma mark -
    35 #pragma mark Instance methods for engine interaction
    35 #pragma mark Instance methods for engine interaction
    36 // prepares the controllers for hosting a game
    36 // prepares the controllers for hosting a game
    37 -(void) earlyEngineLaunch:(NSDictionary *)optionsOrNil {
    37 -(void) earlyEngineLaunch:(NSDictionary *)optionsOrNil {
    38     [self retain];
    38     [self retain];
    39     [AudioManagerController stopBackgroundMusic];
    39     [AudioManagerController fadeOutBackgroundMusic];
    40 
    40 
    41     EngineProtocolNetwork *engineProtocol = [[EngineProtocolNetwork alloc] init];
    41     EngineProtocolNetwork *engineProtocol = [[EngineProtocolNetwork alloc] init];
    42     self.proto = engineProtocol;
    42     self.proto = engineProtocol;
    43     [engineProtocol release];
    43     [engineProtocol release];
    44     [self.proto spawnThread:self.savePath withOptions:optionsOrNil];
    44     [self.proto spawnThread:self.savePath withOptions:optionsOrNil];
   105     // can remove the savefile if the replay has ended
   105     // can remove the savefile if the replay has ended
   106     if ([HWUtils gameType] == gtSave)
   106     if ([HWUtils gameType] == gtSave)
   107         [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
   107         [[NSFileManager defaultManager] removeItemAtPath:self.savePath error:nil];
   108 
   108 
   109     // restart music and we're done
   109     // restart music and we're done
   110     [AudioManagerController playBackgroundMusic];
   110     [AudioManagerController fadeInBackgroundMusic];
   111     [HWUtils setGameStatus:gsNone];
   111     [HWUtils setGameStatus:gsNone];
   112     [HWUtils setGameType:gtNone];
   112     [HWUtils setGameType:gtNone];
   113     [self release];
   113     [self release];
   114 }
   114 }
   115 
   115