SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
iOS/GBHapticManagerLegacy.m
1 #import "GBHapticManagerLegacy.h"
2 #import <UIKit/UIKit.h>
3 #import <AudioToolbox/AudioToolbox.h>
4
5 @implementation GBHapticManagerLegacy
6
7 - (void)doTapHaptic
8 {
9 [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium] impactOccurred];
10 }
11
12 - (void)setRumbleStrength:(double)rumble
13 {
14 void AudioServicesStopSystemSound(SystemSoundID inSystemSoundID);
15 void AudioServicesPlaySystemSoundWithVibration(SystemSoundID inSystemSoundID, id arg, NSDictionary* vibratePattern);
16 if (rumble) {
17 AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate, nil, @{@"Intensity": @(rumble),
18 @"OffDuration": @0,
19 @"OnDuration": @100,
20 @"VibePattern": @[@YES, @1000],
21 });
22 }
23 else {
24 AudioServicesStopSystemSound(kSystemSoundID_Vibrate);
25 }
26 }
27 @end
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.