mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-02 14:52:52 +02:00
Minor stylistic changes
This commit is contained in:
@@ -258,8 +258,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
|
||||
}
|
||||
|
||||
// Use a discovery session to gather the capture devices (all back cameras as well as the front camera)
|
||||
AVCaptureDeviceDiscoverySession *cameraDiscoverySession = [AVCaptureDeviceDiscoverySession
|
||||
discoverySessionWithDeviceTypes:deviceTypes
|
||||
AVCaptureDeviceDiscoverySession *cameraDiscoverySession = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:deviceTypes
|
||||
mediaType:AVMediaTypeVideo
|
||||
position:AVCaptureDevicePositionUnspecified];
|
||||
_allCaptureDevices = cameraDiscoverySession.devices;
|
||||
@@ -743,7 +742,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
|
||||
_backgroundView.bounds.size.height - 8 - insets.bottom - 32,
|
||||
32,
|
||||
32);
|
||||
if (_changeCameraButton != nil) {
|
||||
if (_changeCameraButton) {
|
||||
_changeCameraButton.frame = CGRectMake(insets.left + 8,
|
||||
_backgroundView.bounds.size.height - 8 - insets.bottom - 32 - 32 - 8,
|
||||
32,
|
||||
@@ -1250,13 +1249,15 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||
_cameraPositionButton.alpha = 1;
|
||||
}];
|
||||
}
|
||||
if (_changeCameraButton != nil) {
|
||||
if (_changeCameraButton) {
|
||||
// The change camera button is only available when we are using a capture device on the back of the device
|
||||
int changeCameraButtonAlpha = (_cameraPosition == AVCaptureDevicePositionFront) ? 0 : 1;
|
||||
double changeCameraButtonAlpha = (_cameraPosition == AVCaptureDevicePositionFront) ? 0 : 1;
|
||||
if (changeCameraButtonAlpha != _changeCameraButton.alpha) {
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
_changeCameraButton.alpha = changeCameraButtonAlpha;
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
_disableCameraTimer = [NSTimer scheduledTimerWithTimeInterval:1
|
||||
repeats:false
|
||||
@@ -1266,13 +1267,11 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||
_cameraPositionButton.alpha = 0;
|
||||
}];
|
||||
}
|
||||
if (_changeCameraButton != nil) {
|
||||
if (_changeCameraButton.alpha) {
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
_changeCameraButton.alpha = 0;
|
||||
}];
|
||||
}
|
||||
}
|
||||
dispatch_async(_cameraQueue, ^{
|
||||
[_cameraSession stopRunning];
|
||||
_cameraSession = nil;
|
||||
|
Reference in New Issue
Block a user