diff options
Diffstat (limited to 'macosx/PcsxrMemCardController.m')
| -rwxr-xr-x | macosx/PcsxrMemCardController.m | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m index 0620fbf4..7fb139ea 100755 --- a/macosx/PcsxrMemCardController.m +++ b/macosx/PcsxrMemCardController.m @@ -25,6 +25,20 @@ @synthesize memCard1Array; @synthesize memCard2Array; +- (void)stopMemoryAnimation +{ + [self.imageAnimateTimer invalidate]; + self.imageAnimateTimer = nil; +} + +- (void)beginMemoryAnimation +{ + if (!_imageAnimateTimer) { + self.imageAnimateTimer = [[NSTimer alloc] initWithFireDate:[NSDate date] interval:0.30 target:self selector:@selector(animateMemCards:) userInfo:nil repeats:YES]; + [[NSRunLoop mainRunLoop] addTimer:self.imageAnimateTimer forMode:NSRunLoopCommonModes]; + } +} + - (void)setupValues:(int)theCards { NSParameterAssert(theCards < 4 && theCards > 0); @@ -84,8 +98,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(memoryCardDidChangeNotification:) name:memChangeNotifier object:nil]; - self.imageAnimateTimer = [[NSTimer alloc] initWithFireDate:[NSDate date] interval:3.0/10.0 target:self selector:@selector(animateMemCards:) userInfo:nil repeats:YES]; - [[NSRunLoop mainRunLoop] addTimer:self.imageAnimateTimer forMode:NSRunLoopCommonModes]; + [self beginMemoryAnimation]; } - (void)animateMemCards:(NSTimer*)theTimer @@ -216,16 +229,6 @@ } } -- (IBAction)changeMemCard:(id)sender -{ - [ConfigurationController mcdChangeClicked:sender]; -} - -- (IBAction)newMemCard:(id)sender -{ - [ConfigurationController mcdNewClicked:sender]; -} - - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; |
