Fix SetVideoFX not being called from the mainthread

This commit is contained in:
Olivier Goguel 2017-11-09 23:49:52 +01:00
parent 79ef40e872
commit da55e8a888
4 changed files with 11 additions and 4 deletions

View File

@ -133,6 +133,7 @@ enum
-(void)resetSpecialKeys;
-(void)unloadSpecialKeys;
- (void) animateDisk:(id)_id ;
-(void) animateDiskEjection:(id)_id;
-(void)refreshControls:(id)sender;
- (void) detectHardwareKeyboard:(id)_id ;
- (void)setLoading:(NSNumber*)_nsvisible;

View File

@ -70,12 +70,14 @@ void x_notify_eject()
@autoreleasepool {
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(animateDiskEjection:) withObject:nil waitUntilDone:NO];
}
}
void x_set_video_fx(videofxenum _vfx)
{
[pManager getEmulatorView].zv.crt.hidden = (_vfx==VIDEOFX_CRT?0:1);
@autoreleasepool {
[[pManager getEmulatorView] performSelectorOnMainThread:@selector(setVideoFx:) withObject:[NSNumber numberWithInt:_vfx] waitUntilDone:NO];
}
}

View File

@ -69,6 +69,7 @@ enum attachMode
#endif
-(void) updateView;
-(void)setVideoFx: (NSNumber*)_vfxNumber;
@property (nonatomic, strong) customView* contentView;
@property (nonatomic, strong) zoomEmulatorView* zv;

View File

@ -672,10 +672,13 @@ int x_lock_zoom = 0;
}
- (void)dealloc {
self.zv;
self.zv = nil;
}
- (void)setVideoFx: (NSNumber*)_vfxNumber
{
int vfx = [_vfxNumber intValue];
self.zv.crt.hidden = (vfx==VIDEOFX_CRT?0:1);
}
@end