SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 052e2429e097bab333619f9f1caa75d95e03e148 parent cfee59918e52e0e7c64f58ae64b95c4aced69b4b Author: Lior Halphon <LIJI32@gmail.com> Date: Mon, 31 Oct 2022 21:17:32 +0200 Minor optimization Diffstat:
| M | Cocoa/GBJoyConManager.h | 2 | +- |
| M | Cocoa/GBJoyConManager.m | 24 | ++++++++++++++++++++---- |
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/Cocoa/GBJoyConManager.h b/Cocoa/GBJoyConManager.h @@ -5,7 +5,7 @@ @interface GBJoyConManager : NSObject<JOYListener, NSTableViewDataSource, NSTableViewDelegate> + (instancetype) sharedInstance; -@property bool arrangementMode; +@property (nonatomic) bool arrangementMode; @property (weak) IBOutlet NSTableView *tableView; @property (nonatomic) IBOutlet NSButton *autoPairCheckbox; @property (nonatomic) IBOutlet NSButton *horizontalCheckbox; diff --git a/Cocoa/GBJoyConManager.m b/Cocoa/GBJoyConManager.m @@ -195,7 +195,9 @@ if (controller.joyconType == JOYJoyConTypeLeft || controller.joyconType == JOYJoyConTypeRight) { [self autopair]; } - [self.tableView reloadData]; + if (_arrangementMode) { + [self.tableView reloadData]; + } } - (void)autopair @@ -213,12 +215,16 @@ break; } } - [self.tableView reloadData]; + if (_arrangementMode) { + [self.tableView reloadData]; + } } - (void)controllerDisconnected:(JOYController *)controller { - [self.tableView reloadData]; + if (_arrangementMode) { + [self.tableView reloadData]; + } } - (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row @@ -301,7 +307,17 @@ for (JOYController *controller in self.joycons) { [self updateOrientationForController:controller]; } - [self.tableView reloadData]; + if (_arrangementMode) { + [self.tableView reloadData]; + } +} + +- (void)setArrangementMode:(bool)arrangementMode +{ + _arrangementMode = arrangementMode; + if (arrangementMode) { + [self.tableView reloadData]; + } } @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.