OS X: make all ivars either be in the implementation block, or converted to Objective C 2.0 properties.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@92227 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
parent
0f8e66e194
commit
a96ba17632
|
@ -3492,7 +3492,10 @@
|
|||
SDKROOT = macosx;
|
||||
SKIP_INSTALL = YES;
|
||||
STRINGS_FILE_OUTPUT_ENCODING = binary;
|
||||
WARNING_CFLAGS = "-Wno-comment";
|
||||
WARNING_CFLAGS = (
|
||||
"-Wno-comment",
|
||||
"-Wobjc-interface-ivars",
|
||||
);
|
||||
};
|
||||
name = Instrument;
|
||||
};
|
||||
|
@ -3777,7 +3780,10 @@
|
|||
SKIP_INSTALL = YES;
|
||||
STRINGS_FILE_OUTPUT_ENCODING = binary;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
WARNING_CFLAGS = "-Wno-comment";
|
||||
WARNING_CFLAGS = (
|
||||
"-Wno-comment",
|
||||
"-Wobjc-interface-ivars",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -3831,7 +3837,10 @@
|
|||
SDKROOT = macosx;
|
||||
SKIP_INSTALL = YES;
|
||||
STRINGS_FILE_OUTPUT_ENCODING = binary;
|
||||
WARNING_CFLAGS = "-Wno-comment";
|
||||
WARNING_CFLAGS = (
|
||||
"-Wno-comment",
|
||||
"-Wobjc-interface-ivars",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
|
@ -15,9 +15,7 @@ typedef NS_ENUM(char, EmuThreadPauseStatus) {
|
|||
PauseStateIsPaused
|
||||
};
|
||||
|
||||
@interface EmuThread : NSObject {
|
||||
jmp_buf restartJmp;
|
||||
}
|
||||
@interface EmuThread : NSObject
|
||||
|
||||
- (void)EmuThreadRun:(id)anObject;
|
||||
- (void)EmuThreadRunBios:(id)anObject;
|
||||
|
|
|
@ -34,6 +34,7 @@ static pthread_mutex_t eventMutex;
|
|||
@implementation EmuThread
|
||||
{
|
||||
BOOL wasPaused;
|
||||
jmp_buf restartJmp;
|
||||
}
|
||||
|
||||
- (void)setUpThread
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface Bladesio1PluginConfigController : NSWindowController
|
||||
{
|
||||
IBOutlet NSButton *enabledButton;
|
||||
IBOutlet NSTextField *ipAddressField;
|
||||
IBOutlet NSTextField *portField;
|
||||
IBOutlet NSPopUpButton *playerMenu;
|
||||
IBOutlet NSBox *configBox;
|
||||
@property (weak) IBOutlet NSButton *enabledButton;
|
||||
@property (weak) IBOutlet NSTextField *ipAddressField;
|
||||
@property (weak) IBOutlet NSTextField *portField;
|
||||
@property (weak) IBOutlet NSPopUpButton *playerMenu;
|
||||
@property (weak) IBOutlet NSBox *configBox;
|
||||
|
||||
@property (strong) NSMutableDictionary *keyValues;
|
||||
|
||||
NSMutableDictionary *keyValues;
|
||||
}
|
||||
- (IBAction)cancel:(id)sender;
|
||||
- (IBAction)ok:(id)sender;
|
||||
- (IBAction)toggleEnabled:(id)sender;
|
||||
|
|
|
@ -120,9 +120,9 @@ void ReadConfig()
|
|||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues];
|
||||
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:self.keyValues];
|
||||
|
||||
NSString *theAddress = [ipAddressField stringValue];
|
||||
NSString *theAddress = [self.ipAddressField stringValue];
|
||||
NSInteger asciiLen = [theAddress lengthOfBytesUsingEncoding:NSASCIIStringEncoding];
|
||||
if (asciiLen > (sizeof(settings.ip) - 1)) {
|
||||
NSBeginAlertSheet(@"Address too long", nil, nil, nil, [self window], nil, NULL, NULL, NULL, @"The address is too long.\n\nTry to use only the IP address and not a host name.");
|
||||
|
@ -132,13 +132,13 @@ void ReadConfig()
|
|||
return;
|
||||
}
|
||||
|
||||
writeDic[kSioEnabled] = (([enabledButton state] == NSOnState) ? @YES : @NO);
|
||||
writeDic[kSioEnabled] = (([self.enabledButton state] == NSOnState) ? @YES : @NO);
|
||||
writeDic[kSioIPAddress] = theAddress;
|
||||
writeDic[kSioPort] = @((u16)[portField intValue]);
|
||||
writeDic[kSioPort] = @((u16)[self.portField intValue]);
|
||||
|
||||
{
|
||||
int player;
|
||||
switch ([playerMenu indexOfSelectedItem]) {
|
||||
switch ([self.playerMenu indexOfSelectedItem]) {
|
||||
default:
|
||||
case 0:
|
||||
player = PLAYER_DISABLED;
|
||||
|
@ -166,9 +166,9 @@ void ReadConfig()
|
|||
|
||||
- (IBAction)toggleEnabled:(id)sender
|
||||
{
|
||||
BOOL isEnabled = [enabledButton state] == NSOnState ? YES : NO;
|
||||
BOOL isEnabled = [self.enabledButton state] == NSOnState ? YES : NO;
|
||||
|
||||
for (NSView *subView in [[configBox subviews][0] subviews]) {
|
||||
for (NSView *subView in [[self.configBox subviews][0] subviews]) {
|
||||
if ([subView isKindOfClass:[NSTextField class]] && ![(NSTextField*)subView isEditable]) {
|
||||
[(NSTextField*)subView setTextColor:isEnabled ? [NSColor controlTextColor] : [NSColor disabledControlTextColor]];
|
||||
} else {
|
||||
|
@ -192,24 +192,24 @@ void ReadConfig()
|
|||
ReadConfig();
|
||||
|
||||
// load from preferences
|
||||
keyValues = [[defaults dictionaryForKey:PrefsKey] mutableCopy];
|
||||
self.keyValues = [[defaults dictionaryForKey:PrefsKey] mutableCopy];
|
||||
|
||||
[enabledButton setState: [keyValues[kSioEnabled] boolValue] ? NSOnState : NSOffState];
|
||||
[ipAddressField setStringValue:keyValues[kSioIPAddress]];
|
||||
[portField setIntValue:[keyValues[kSioPort] intValue]];
|
||||
[self.enabledButton setState: [self.keyValues[kSioEnabled] boolValue] ? NSOnState : NSOffState];
|
||||
[self.ipAddressField setStringValue:self.keyValues[kSioIPAddress]];
|
||||
[self.portField setIntValue:[self.keyValues[kSioPort] intValue]];
|
||||
|
||||
switch ([keyValues[kSioPlayer] integerValue]) {
|
||||
switch ([self.keyValues[kSioPlayer] integerValue]) {
|
||||
default:
|
||||
case PLAYER_DISABLED:
|
||||
[playerMenu selectItemAtIndex:0];
|
||||
[self.playerMenu selectItemAtIndex:0];
|
||||
break;
|
||||
|
||||
case PLAYER_MASTER:
|
||||
[playerMenu selectItemAtIndex:1];
|
||||
[self.playerMenu selectItemAtIndex:1];
|
||||
break;
|
||||
|
||||
case PLAYER_SLAVE:
|
||||
[playerMenu selectItemAtIndex:2];
|
||||
[self.playerMenu selectItemAtIndex:2];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,14 +3,10 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface PluginConfigController : NSWindowController
|
||||
{
|
||||
IBOutlet NSControl *Cached;
|
||||
IBOutlet NSSlider *CacheSize;
|
||||
IBOutlet NSPopUpButton *CdSpeed;
|
||||
|
||||
NSMutableDictionary *keyValues;
|
||||
}
|
||||
@property (retain) NSMutableDictionary *keyValues;
|
||||
@property (weak) IBOutlet NSControl *Cached;
|
||||
@property (weak) IBOutlet NSSlider *CacheSize;
|
||||
@property (weak) IBOutlet NSPopUpButton *CdSpeed;
|
||||
@property (strong) NSMutableDictionary *keyValues;
|
||||
|
||||
- (IBAction)cancel:(id)sender;
|
||||
- (IBAction)ok:(id)sender;
|
||||
|
|
|
@ -104,6 +104,7 @@ void ReadConfig()
|
|||
|
||||
@implementation PluginConfigController
|
||||
@synthesize keyValues;
|
||||
@synthesize CdSpeed;
|
||||
|
||||
- (IBAction)cancel:(id)sender
|
||||
{
|
||||
|
@ -115,12 +116,12 @@ void ReadConfig()
|
|||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSMutableDictionary *writeDic = [keyValues mutableCopy];
|
||||
NSMutableDictionary *writeDic = [self.keyValues mutableCopy];
|
||||
|
||||
writeDic[@"Threaded"] = ([Cached intValue] ? @YES : @NO);
|
||||
writeDic[@"Cache Size"] = @([CacheSize integerValue]);
|
||||
writeDic[@"Threaded"] = ([self.Cached intValue] ? @YES : @NO);
|
||||
writeDic[@"Cache Size"] = @([self.CacheSize integerValue]);
|
||||
|
||||
switch ([CdSpeed indexOfSelectedItem]) {
|
||||
switch ([self.CdSpeed indexOfSelectedItem]) {
|
||||
case 1: writeDic[@"Speed"] = @1; break;
|
||||
case 2: writeDic[@"Speed"] = @2; break;
|
||||
case 3: writeDic[@"Speed"] = @4; break;
|
||||
|
@ -150,8 +151,8 @@ void ReadConfig()
|
|||
// load from preferences
|
||||
self.keyValues = [[NSMutableDictionary alloc] initWithDictionary:[defaults dictionaryForKey:PrefsKey]];
|
||||
|
||||
[Cached setIntValue:[keyValues[@"Threaded"] intValue]];
|
||||
[CacheSize setIntegerValue:[keyValues[@"Cache Size"] integerValue]];
|
||||
[self.Cached setIntValue:[keyValues[@"Threaded"] intValue]];
|
||||
[self.CacheSize setIntegerValue:[keyValues[@"Cache Size"] integerValue]];
|
||||
|
||||
switch ([keyValues[@"Speed"] intValue]) {
|
||||
case 1: [CdSpeed selectItemAtIndex:1]; break;
|
||||
|
|
|
@ -25,14 +25,12 @@
|
|||
#import "ControllerList.h"
|
||||
|
||||
@interface PadView : NSView
|
||||
{
|
||||
IBOutlet NSTableView *tableView;
|
||||
IBOutlet NSPopUpButton *typeMenu;
|
||||
IBOutlet NSPopUpButton *deviceMenu;
|
||||
|
||||
ControllerList *controller;
|
||||
}
|
||||
@property (weak) IBOutlet NSTableView *tableView;
|
||||
@property (weak) IBOutlet NSPopUpButton *typeMenu;
|
||||
@property (weak) IBOutlet NSPopUpButton *deviceMenu;
|
||||
@property (weak) IBOutlet NSButton *useSDL2Check;
|
||||
@property (strong) ControllerList *controllerList;
|
||||
|
||||
- (IBAction)setType:(id)sender;
|
||||
- (IBAction)setDevice:(id)sender;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "pad.h"
|
||||
|
||||
@implementation PadView
|
||||
@synthesize controllerList = controller;
|
||||
|
||||
- (id)initWithFrame:(NSRect)frameRect
|
||||
{
|
||||
|
@ -43,7 +44,7 @@
|
|||
g.cfg.PadDef[[ControllerList currentController]].Type =
|
||||
([sender indexOfSelectedItem] > 0 ? PSE_PAD_TYPE_ANALOGPAD : PSE_PAD_TYPE_STANDARD);
|
||||
|
||||
[tableView reloadData];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (IBAction)setDevice:(id)sender
|
||||
|
@ -55,7 +56,7 @@
|
|||
{
|
||||
controller.usingSDL2 = !controller.usingSDL2;
|
||||
|
||||
[tableView reloadData];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)setController:(int)which
|
||||
|
@ -63,10 +64,10 @@
|
|||
int i;
|
||||
|
||||
[ControllerList setCurrentController:which];
|
||||
[tableView setDataSource:controller];
|
||||
[self.tableView setDataSource:controller];
|
||||
|
||||
[deviceMenu removeAllItems];
|
||||
[deviceMenu addItemWithTitle:[[NSBundle bundleForClass:[self class]] localizedStringForKey:@"(Keyboard only)" value:@"" table:nil]];
|
||||
[self.deviceMenu removeAllItems];
|
||||
[self.deviceMenu addItemWithTitle:[[NSBundle bundleForClass:[self class]] localizedStringForKey:@"(Keyboard only)" value:@"" table:nil]];
|
||||
|
||||
for (i = 0; i < SDL_NumJoysticks(); i++) {
|
||||
NSMenuItem *joystickItem;
|
||||
|
@ -82,19 +83,19 @@
|
|||
joystickItem = [[NSMenuItem alloc] initWithTitle:@(SDL_JoystickName(i)) action:NULL keyEquivalent:@""];
|
||||
#endif
|
||||
[joystickItem setTag:i + 1];
|
||||
[[deviceMenu menu] addItem:joystickItem];
|
||||
[[self.deviceMenu menu] addItem:joystickItem];
|
||||
}
|
||||
|
||||
if (g.cfg.PadDef[which].DevNum >= SDL_NumJoysticks()) {
|
||||
g.cfg.PadDef[which].DevNum = -1;
|
||||
}
|
||||
|
||||
[deviceMenu selectItemAtIndex:g.cfg.PadDef[which].DevNum + 1];
|
||||
[typeMenu selectItemAtIndex:(g.cfg.PadDef[which].Type == PSE_PAD_TYPE_ANALOGPAD ? 1 : 0)];
|
||||
[self.deviceMenu selectItemAtIndex:g.cfg.PadDef[which].DevNum + 1];
|
||||
[self.typeMenu selectItemAtIndex:(g.cfg.PadDef[which].Type == PSE_PAD_TYPE_ANALOGPAD ? 1 : 0)];
|
||||
|
||||
[self.useSDL2Check setState:g.cfg.PadDef[which].UseSDL2 ? NSOnState : NSOffState];
|
||||
|
||||
[tableView reloadData];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor
|
||||
|
@ -107,15 +108,15 @@
|
|||
{
|
||||
unsigned short key = [theEvent keyCode];
|
||||
|
||||
if ([[theEvent window] firstResponder] == tableView) {
|
||||
if ([[theEvent window] firstResponder] == self.tableView) {
|
||||
if (key == 51 || key == 117) {
|
||||
// delete keys - remove the mappings for the selected item
|
||||
[controller deleteRow:[tableView selectedRow]];
|
||||
[tableView reloadData];
|
||||
[controller deleteRow:[self.tableView selectedRow]];
|
||||
[self.tableView reloadData];
|
||||
return;
|
||||
} else if (key == 36) {
|
||||
// return key - configure the selected item
|
||||
[tableView editColumn:[tableView columnWithIdentifier:@"button"] row:[tableView selectedRow] withEvent:nil select:YES];
|
||||
[self.tableView editColumn:[self.tableView columnWithIdentifier:@"button"] row:[self.tableView selectedRow] withEvent:nil select:YES];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface PluginConfigController : NSWindowController
|
||||
{
|
||||
IBOutlet NSTextField *ipAddress;
|
||||
IBOutlet NSTextField *portNum;
|
||||
IBOutlet NSTextField *playerNum;
|
||||
}
|
||||
@property (weak) IBOutlet NSTextField *ipAddress;
|
||||
@property (weak) IBOutlet NSTextField *portNum;
|
||||
@property (weak) IBOutlet NSTextField *playerNum;
|
||||
|
||||
- (IBAction)cancel:(id)sender;
|
||||
- (IBAction)ok:(id)sender;
|
||||
|
||||
|
|
|
@ -109,6 +109,9 @@ void ReadConfig()
|
|||
}
|
||||
|
||||
@implementation PluginConfigController
|
||||
@synthesize ipAddress;
|
||||
@synthesize portNum;
|
||||
@synthesize playerNum;
|
||||
|
||||
- (IBAction)cancel:(id)sender
|
||||
{
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NamedSlider : NSSlider
|
||||
{
|
||||
NSArray *strings;
|
||||
__unsafe_unretained Class pluginClass;
|
||||
}
|
||||
@property (strong) NSArray *strings;
|
||||
@property (unsafe_unretained) Class pluginClass;
|
||||
@end
|
||||
|
|
|
@ -144,15 +144,15 @@ void ReadConfig(void)
|
|||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:self.keyValues];
|
||||
writeDic[@"High Compatibility Mode"] = ([hiCompBox intValue] ? @YES : @NO);
|
||||
writeDic[@"SPU IRQ Wait"] = ([irqWaitBox intValue] ? @YES : @NO);
|
||||
writeDic[@"Mono Sound Output"] = ([monoSoundBox intValue] ? @YES : @NO);
|
||||
writeDic[@"XA Pitch"] = ([xaSpeedBox intValue] ? @YES : @NO);
|
||||
writeDic[@"High Compatibility Mode"] = ([self.hiCompBox intValue] ? @YES : @NO);
|
||||
writeDic[@"SPU IRQ Wait"] = ([self.irqWaitBox intValue] ? @YES : @NO);
|
||||
writeDic[@"Mono Sound Output"] = ([self.monoSoundBox intValue] ? @YES : @NO);
|
||||
writeDic[@"XA Pitch"] = ([self.xaSpeedBox intValue] ? @YES : @NO);
|
||||
|
||||
writeDic[@"Interpolation Quality"] = @([interpolValue intValue]);
|
||||
writeDic[@"Reverb Quality"] = @([reverbValue intValue]);
|
||||
writeDic[@"Interpolation Quality"] = @([self.interpolValue intValue]);
|
||||
writeDic[@"Reverb Quality"] = @([self.reverbValue intValue]);
|
||||
|
||||
writeDic[@"Volume"] = @([volumeValue intValue]);
|
||||
writeDic[@"Volume"] = @([self.volumeValue intValue]);
|
||||
|
||||
// write to defaults
|
||||
[defaults setObject:writeDic forKey:PrefsKey];
|
||||
|
@ -180,14 +180,14 @@ void ReadConfig(void)
|
|||
/* load from preferences */
|
||||
self.keyValues = [NSMutableDictionary dictionaryWithDictionary:[defaults dictionaryForKey:PrefsKey]];
|
||||
|
||||
[hiCompBox setIntValue:[keyValues[@"High Compatibility Mode"] boolValue]];
|
||||
[irqWaitBox setIntValue:[keyValues[@"SPU IRQ Wait"] boolValue]];
|
||||
[monoSoundBox setIntValue:[keyValues[@"Mono Sound Output"] boolValue]];
|
||||
[xaSpeedBox setIntValue:[keyValues[@"XA Pitch"] boolValue]];
|
||||
[self.hiCompBox setIntValue:[self.keyValues[@"High Compatibility Mode"] boolValue]];
|
||||
[self.irqWaitBox setIntValue:[self.keyValues[@"SPU IRQ Wait"] boolValue]];
|
||||
[self.monoSoundBox setIntValue:[self.keyValues[@"Mono Sound Output"] boolValue]];
|
||||
[self.xaSpeedBox setIntValue:[self.keyValues[@"XA Pitch"] boolValue]];
|
||||
|
||||
[interpolValue setIntValue:[keyValues[@"Interpolation Quality"] intValue]];
|
||||
[reverbValue setIntValue:[keyValues[@"Reverb Quality"] intValue]];
|
||||
[volumeValue setIntValue:[keyValues[@"Volume"] intValue]];
|
||||
[self.interpolValue setIntValue:[self.keyValues[@"Interpolation Quality"] intValue]];
|
||||
[self.reverbValue setIntValue:[self.keyValues[@"Reverb Quality"] intValue]];
|
||||
[self.volumeValue setIntValue:[self.keyValues[@"Volume"] intValue]];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
|
@ -196,26 +196,26 @@ void ReadConfig(void)
|
|||
|
||||
NSBundle *spuBundle = [NSBundle bundleForClass:thisClass];
|
||||
|
||||
[interpolValue setStrings:@[
|
||||
[self.interpolValue setStrings:@[
|
||||
[spuBundle localizedStringForKey:@"(No Interpolation)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Simple Interpolation)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Gaussian Interpolation)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Cubic Interpolation)" value:@"" table:nil]]];
|
||||
interpolValue.pluginClass = thisClass;
|
||||
self.interpolValue.pluginClass = thisClass;
|
||||
|
||||
[reverbValue setStrings:@[
|
||||
[self.reverbValue setStrings:@[
|
||||
[spuBundle localizedStringForKey:@"(No Reverb)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Simple Reverb)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(PSX Reverb)" value:@"" table:nil]]];
|
||||
reverbValue.pluginClass = thisClass;
|
||||
self.reverbValue.pluginClass = thisClass;
|
||||
|
||||
[volumeValue setStrings:@[
|
||||
[self.volumeValue setStrings:@[
|
||||
[spuBundle localizedStringForKey:@"(Muted)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Low)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Medium)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Loud)" value:@"" table:nil],
|
||||
[spuBundle localizedStringForKey:@"(Loudest)" value:@"" table:nil]]];
|
||||
volumeValue.pluginClass = thisClass;
|
||||
self.volumeValue.pluginClass = thisClass;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -10,19 +10,16 @@
|
|||
#import "NamedSlider.h"
|
||||
|
||||
@interface SPUPluginController : NSWindowController
|
||||
{
|
||||
IBOutlet NSCell *hiCompBox;
|
||||
IBOutlet NamedSlider *interpolValue;
|
||||
IBOutlet NSCell *irqWaitBox;
|
||||
IBOutlet NSCell *monoSoundBox;
|
||||
IBOutlet NamedSlider *reverbValue;
|
||||
IBOutlet NSCell *xaEnableBox;
|
||||
IBOutlet NSCell *xaSpeedBox;
|
||||
IBOutlet NamedSlider *volumeValue;
|
||||
|
||||
NSMutableDictionary *keyValues;
|
||||
}
|
||||
@property (weak) IBOutlet NSCell *hiCompBox;
|
||||
@property (weak) IBOutlet NamedSlider *interpolValue;
|
||||
@property (weak) IBOutlet NSCell *irqWaitBox;
|
||||
@property (weak) IBOutlet NSCell *monoSoundBox;
|
||||
@property (weak) IBOutlet NamedSlider *reverbValue;
|
||||
@property (weak) IBOutlet NSCell *xaEnableBox;
|
||||
@property (weak) IBOutlet NSCell *xaSpeedBox;
|
||||
@property (weak) IBOutlet NamedSlider *volumeValue;
|
||||
@property (readwrite, strong) NSMutableDictionary *keyValues;
|
||||
|
||||
- (IBAction)cancel:(id)sender;
|
||||
- (IBAction)ok:(id)sender;
|
||||
- (IBAction)reset:(id)sender;
|
||||
|
|
|
@ -5,33 +5,27 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NetSfPeopsSoftGPUPluginConfigController : NSWindowController
|
||||
{
|
||||
IBOutlet NSControl *autoFullScreen;
|
||||
IBOutlet NSPopUpButton *ditherMode;
|
||||
IBOutlet NSControl *fpsCounter;
|
||||
IBOutlet NSControl *frameSkipping;
|
||||
IBOutlet NSControl *hackEnable;
|
||||
IBOutlet NSView *hacksView;
|
||||
IBOutlet NSMatrix *hacksMatrix;
|
||||
IBOutlet NSControl *vSync;
|
||||
IBOutlet NSControl *shaders;
|
||||
IBOutlet NSTextField *vertexShaderViewablePath;
|
||||
IBOutlet NSTextField *fragmentShaderViewablePath;
|
||||
IBOutlet NSControl *vertexChooser;
|
||||
IBOutlet NSControl *fragmentChooser;
|
||||
IBOutlet NSView *shadersView;
|
||||
IBOutlet NSPopUpButton *shaderQualitySelector;
|
||||
|
||||
NSURL *vertexPath;
|
||||
NSURL *fragmentPath;
|
||||
|
||||
NSMutableDictionary *keyValues;
|
||||
}
|
||||
|
||||
@property (strong) NSURL *vertexPath;
|
||||
@property (strong) NSURL *fragmentPath;
|
||||
@property (strong) NSMutableDictionary *keyValues;
|
||||
|
||||
@property (weak) IBOutlet NSFormCell *displayWidth;
|
||||
@property (weak) IBOutlet NSFormCell *displayHeight;
|
||||
@property (weak) IBOutlet NSControl *autoFullScreen;
|
||||
@property (weak) IBOutlet NSPopUpButton *ditherMode;
|
||||
@property (weak) IBOutlet NSControl *fpsCounter;
|
||||
@property (weak) IBOutlet NSControl *frameSkipping;
|
||||
@property (weak) IBOutlet NSControl *hackEnable;
|
||||
@property (weak) IBOutlet NSView *hacksView;
|
||||
@property (weak) IBOutlet NSMatrix *hacksMatrix;
|
||||
@property (weak) IBOutlet NSControl *vSync;
|
||||
@property (weak) IBOutlet NSControl *shaders;
|
||||
@property (weak) IBOutlet NSTextField *vertexShaderViewablePath;
|
||||
@property (weak) IBOutlet NSTextField *fragmentShaderViewablePath;
|
||||
@property (weak) IBOutlet NSControl *vertexChooser;
|
||||
@property (weak) IBOutlet NSControl *fragmentChooser;
|
||||
@property (weak) IBOutlet NSView *shadersView;
|
||||
@property (weak) IBOutlet NSPopUpButton *shaderQualitySelector;
|
||||
|
||||
- (IBAction)cancel:(id)sender;
|
||||
- (IBAction)ok:(id)sender;
|
||||
|
|
|
@ -205,9 +205,23 @@ void ReadConfig(void)
|
|||
}
|
||||
|
||||
@implementation NetSfPeopsSoftGPUPluginConfigController
|
||||
|
||||
@synthesize fragmentPath;
|
||||
@synthesize vertexPath;
|
||||
@synthesize autoFullScreen;
|
||||
@synthesize ditherMode;
|
||||
@synthesize fpsCounter;
|
||||
@synthesize frameSkipping;
|
||||
@synthesize hackEnable;
|
||||
@synthesize hacksView;
|
||||
@synthesize hacksMatrix;
|
||||
@synthesize vSync;
|
||||
@synthesize shaders;
|
||||
@synthesize vertexShaderViewablePath;
|
||||
@synthesize fragmentShaderViewablePath;
|
||||
@synthesize vertexChooser;
|
||||
@synthesize fragmentChooser;
|
||||
@synthesize shadersView;
|
||||
@synthesize shaderQualitySelector;
|
||||
|
||||
- (IBAction)cancel:(id)sender
|
||||
{
|
||||
|
@ -218,7 +232,7 @@ void ReadConfig(void)
|
|||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues];
|
||||
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:self.keyValues];
|
||||
writeDic[@"FPS Counter"] = ([fpsCounter intValue] ? @YES : @NO);
|
||||
writeDic[@"Auto Full Screen"] = ([autoFullScreen intValue] ? @YES : @NO);
|
||||
writeDic[@"Frame Skipping"] = ([frameSkipping intValue] ? @YES : @NO);
|
||||
|
@ -326,15 +340,15 @@ void ReadConfig(void)
|
|||
ReadConfig();
|
||||
|
||||
/* load from preferences */
|
||||
keyValues = [[defaults dictionaryForKey:PrefsKey] mutableCopy];
|
||||
self.keyValues = [[defaults dictionaryForKey:PrefsKey] mutableCopy];
|
||||
|
||||
{
|
||||
BOOL resetPrefs = NO;
|
||||
[self setVertexPathInfo:[NSURL URLByResolvingBookmarkData:keyValues[@"VertexShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil]];
|
||||
[self setVertexPathInfo:[NSURL URLByResolvingBookmarkData:self.keyValues[@"VertexShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil]];
|
||||
if (!vertexPath) {
|
||||
resetPrefs = YES;
|
||||
}
|
||||
[self setFragmentPathInfo:[NSURL URLByResolvingBookmarkData:keyValues[@"FragmentShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil]];
|
||||
[self setFragmentPathInfo:[NSURL URLByResolvingBookmarkData:self.keyValues[@"FragmentShader"] options:NSURLBookmarkResolutionWithoutUI relativeToURL:nil bookmarkDataIsStale:NULL error:nil]];
|
||||
if (!fragmentPath) {
|
||||
resetPrefs = YES;
|
||||
}
|
||||
|
@ -344,22 +358,22 @@ void ReadConfig(void)
|
|||
[self setFragmentPathInfo:[selfBundle URLForResource:@"gpuPeteOGL2" withExtension:@"slf"]];
|
||||
}
|
||||
}
|
||||
[fpsCounter setIntValue:[keyValues[@"FPS Counter"] intValue]];
|
||||
[autoFullScreen setIntValue:[keyValues[@"Auto Full Screen"] intValue]];
|
||||
[frameSkipping setIntValue:[keyValues[@"Frame Skipping"] intValue]];
|
||||
[vSync setIntValue:[keyValues[@"VSync"] intValue]];
|
||||
[hackEnable setIntValue:[keyValues[@"Enable Hacks"] intValue]];
|
||||
[shaders setIntValue:[keyValues[@"UseShader"] intValue]];
|
||||
[fpsCounter setIntValue:[self.keyValues[@"FPS Counter"] intValue]];
|
||||
[autoFullScreen setIntValue:[self.keyValues[@"Auto Full Screen"] intValue]];
|
||||
[frameSkipping setIntValue:[self.keyValues[@"Frame Skipping"] intValue]];
|
||||
[vSync setIntValue:[self.keyValues[@"VSync"] intValue]];
|
||||
[hackEnable setIntValue:[self.keyValues[@"Enable Hacks"] intValue]];
|
||||
[shaders setIntValue:[self.keyValues[@"UseShader"] intValue]];
|
||||
|
||||
[ditherMode selectItemAtIndex:[keyValues[@"Dither Mode"] intValue]];
|
||||
[shaderQualitySelector selectItemAtIndex:[keyValues[@"ShaderQuality"] intValue] - 1];
|
||||
[ditherMode selectItemAtIndex:[self.keyValues[@"Dither Mode"] intValue]];
|
||||
[shaderQualitySelector selectItemAtIndex:[self.keyValues[@"ShaderQuality"] intValue] - 1];
|
||||
|
||||
unsigned int hackValues = [keyValues[@"Hacks"] unsignedIntValue];
|
||||
unsigned int hackValues = [self.keyValues[@"Hacks"] unsignedIntValue];
|
||||
|
||||
for (NSCell *control in [hacksMatrix cells]) {
|
||||
[control setIntValue:(hackValues >> ([control tag] - 1)) & 1];
|
||||
}
|
||||
theSize = NSSizeFromString(keyValues[kWindowSize]);
|
||||
theSize = NSSizeFromString(self.keyValues[kWindowSize]);
|
||||
[self.displayWidth setIntegerValue:theSize.width];
|
||||
[self.displayHeight setIntegerValue:theSize.height];
|
||||
|
||||
|
|
|
@ -34,41 +34,7 @@ static inline void RunOnMainThreadSync(dispatch_block_t block)
|
|||
}
|
||||
|
||||
@interface PluginGLView : NSOpenGLView
|
||||
{
|
||||
GLubyte *image_base;
|
||||
GLubyte *image[IMAGE_COUNT];
|
||||
|
||||
GLboolean useShader;
|
||||
float shaderQuality;
|
||||
GLint buffers;
|
||||
GLuint vertexShader;
|
||||
GLuint fragmentShader;
|
||||
GLuint program;
|
||||
//GLint frame_rate;
|
||||
|
||||
GLenum texture_hint;
|
||||
GLboolean rect_texture;
|
||||
GLboolean client_storage;
|
||||
GLboolean texture_range;
|
||||
|
||||
struct timeval cycle_time;
|
||||
|
||||
NSLock *glLock;
|
||||
BOOL noDisplay;
|
||||
BOOL drawBG;
|
||||
|
||||
int image_width;
|
||||
int image_height;
|
||||
int image_width2;
|
||||
int image_height2;
|
||||
int image_depth;
|
||||
int image_type;
|
||||
float image_tx;
|
||||
float image_ty;
|
||||
int whichImage;
|
||||
BOOL isFullscreen;
|
||||
NSOpenGLPixelFormatAttribute oglProfile;
|
||||
}
|
||||
@property (readonly, strong) NSLock *glLock;
|
||||
|
||||
- (void)renderScreen;
|
||||
|
|
|
@ -27,6 +27,40 @@
|
|||
extern time_t tStart;
|
||||
|
||||
@implementation PluginGLView
|
||||
{
|
||||
GLubyte *image_base;
|
||||
GLubyte *image[IMAGE_COUNT];
|
||||
|
||||
GLboolean useShader;
|
||||
float shaderQuality;
|
||||
GLint buffers;
|
||||
GLuint vertexShader;
|
||||
GLuint fragmentShader;
|
||||
GLuint program;
|
||||
//GLint frame_rate;
|
||||
|
||||
GLenum texture_hint;
|
||||
GLboolean rect_texture;
|
||||
GLboolean client_storage;
|
||||
GLboolean texture_range;
|
||||
|
||||
struct timeval cycle_time;
|
||||
|
||||
BOOL noDisplay;
|
||||
BOOL drawBG;
|
||||
|
||||
int image_width;
|
||||
int image_height;
|
||||
int image_width2;
|
||||
int image_height2;
|
||||
int image_depth;
|
||||
int image_type;
|
||||
float image_tx;
|
||||
float image_ty;
|
||||
int whichImage;
|
||||
BOOL isFullscreen;
|
||||
NSOpenGLPixelFormatAttribute oglProfile;
|
||||
}
|
||||
@synthesize glLock;
|
||||
|
||||
//- (id)initWithFrame:(NSRect)frameRect
|
||||
|
|
|
@ -27,13 +27,9 @@ extern NSWindow *gameWindow;
|
|||
extern PluginWindowController *gameController;
|
||||
|
||||
@interface PluginWindowController : NSWindowController <NSWindowDelegate>
|
||||
{
|
||||
IBOutlet NSOpenGLView *glView;
|
||||
|
||||
NSWindow *fullWindow;
|
||||
}
|
||||
@property (getter = isFullscreen) BOOL fullscreen;
|
||||
|
||||
@property (getter = isFullscreen) BOOL fullscreen;
|
||||
@property (weak) IBOutlet NSOpenGLView *glView;
|
||||
+ (id)openGameView;
|
||||
- (PluginGLView *)openGLView;
|
||||
|
||||
|
|
|
@ -26,7 +26,9 @@ PluginWindowController *gameController;
|
|||
NSRect windowFrame;
|
||||
|
||||
@implementation PluginWindowController
|
||||
|
||||
{
|
||||
NSWindow *fullWindow;
|
||||
}
|
||||
+ (id)openGameView
|
||||
{
|
||||
if (gameWindow == nil) {
|
||||
|
@ -59,7 +61,7 @@ NSRect windowFrame;
|
|||
|
||||
- (PluginGLView *)openGLView
|
||||
{
|
||||
return (PluginGLView *)glView;
|
||||
return (PluginGLView *)self.glView;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
|
@ -132,8 +134,8 @@ NSRect windowFrame;
|
|||
screen:screen];
|
||||
|
||||
//[[glView openGLContext] setFullScreen];
|
||||
[[glView openGLContext] setView:[fullWindow contentView]];
|
||||
[glView reshape];
|
||||
[[self.glView openGLContext] setView:[fullWindow contentView]];
|
||||
[self.glView reshape];
|
||||
//[[glView openGLContext] update];
|
||||
//[fullWindow setContentView:glView];
|
||||
|
||||
|
@ -156,8 +158,8 @@ NSRect windowFrame;
|
|||
[fullWindow orderOut:self];
|
||||
fullWindow = nil;
|
||||
|
||||
[[glView openGLContext] setView:glView];
|
||||
[glView reshape];
|
||||
[[self.glView openGLContext] setView:_glView];
|
||||
[self.glView reshape];
|
||||
//[window setContentView:glView];
|
||||
}
|
||||
|
||||
|
@ -178,7 +180,7 @@ NSRect windowFrame;
|
|||
{
|
||||
if (!(([sender resizeFlags] & NSShiftKeyMask) == NSShiftKeyMask)) {
|
||||
NSRect oldSize = [sender frame];
|
||||
NSRect viewSize = [glView frame];
|
||||
NSRect viewSize = [self.glView frame];
|
||||
|
||||
float xDiff = NSWidth(oldSize) - NSWidth(viewSize);
|
||||
float yDiff = NSHeight(oldSize) - NSHeight(viewSize);
|
||||
|
|
|
@ -34,14 +34,6 @@ static inline void RunOnMainThreadSync(dispatch_block_t block)
|
|||
}
|
||||
|
||||
@interface PluginGLView : NSOpenGLView
|
||||
{
|
||||
struct timeval cycle_time;
|
||||
|
||||
NSLock *glLock; // FIXME: wha?
|
||||
BOOL noDisplay;
|
||||
BOOL drawBG;
|
||||
|
||||
}
|
||||
|
||||
- (void)swapBuffer; // I wonder what this does ;-)
|
||||
- (void)clearBuffer:(BOOL)display;
|
||||
|
|
|
@ -30,6 +30,13 @@
|
|||
#undef BOOL
|
||||
|
||||
@implementation PluginGLView
|
||||
{
|
||||
struct timeval cycle_time;
|
||||
|
||||
NSLock *glLock; // FIXME: wha?
|
||||
BOOL noDisplay;
|
||||
BOOL drawBG;
|
||||
}
|
||||
|
||||
- (BOOL)isOpaque
|
||||
{
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NetSfPeopsOpenGLGPUPluginWindow : NSWindow
|
||||
{
|
||||
NSWindow* myParent;
|
||||
NSPoint initialLocation;
|
||||
}
|
||||
|
||||
@property (readonly) BOOL canBecomeKeyWindow; // to stop the beeping
|
||||
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
|
||||
#import "PluginWindow.h"
|
||||
@implementation NetSfPeopsOpenGLGPUPluginWindow
|
||||
{
|
||||
NSWindow* myParent;
|
||||
NSPoint initialLocation;
|
||||
}
|
||||
/*
|
||||
- (BOOL)windowShouldClose:(id)sender
|
||||
{
|
||||
|
|
|
@ -36,12 +36,8 @@ extern NSWindow *gameWindow;
|
|||
extern PluginWindowController *gameController;
|
||||
|
||||
@interface PluginWindowController : NSWindowController
|
||||
{
|
||||
IBOutlet NSOpenGLView *glView;
|
||||
|
||||
// NSWindow *fullWindow;
|
||||
BOOL inFullscreen;
|
||||
}
|
||||
|
||||
@property (weak) IBOutlet NSOpenGLView *glView;
|
||||
|
||||
+ (id)openGameView;
|
||||
- (PluginGLView *)openGLView;
|
||||
|
|
|
@ -61,7 +61,9 @@ NSRect FitRectInRect(NSRect source, NSRect destination)
|
|||
}
|
||||
|
||||
@implementation PluginWindowController
|
||||
|
||||
{
|
||||
BOOL inFullscreen;
|
||||
}
|
||||
+ (id)openGameView
|
||||
{
|
||||
// create a window for the GPU and return
|
||||
|
@ -168,7 +170,7 @@ NSRect FitRectInRect(NSRect source, NSRect destination)
|
|||
|
||||
- (PluginGLView *)openGLView
|
||||
{
|
||||
return (PluginGLView *)glView;
|
||||
return (PluginGLView *)self.glView;
|
||||
}
|
||||
|
||||
- (void) cureAllIlls
|
||||
|
@ -184,7 +186,7 @@ NSRect FitRectInRect(NSRect source, NSRect destination)
|
|||
rRatioRect.right = iResX;
|
||||
rRatioRect.bottom = iResY;
|
||||
|
||||
[[glView openGLContext] makeCurrentContext];
|
||||
[[self.glView openGLContext] makeCurrentContext];
|
||||
|
||||
glFlush();
|
||||
glFinish();
|
||||
|
@ -209,7 +211,7 @@ NSRect FitRectInRect(NSRect source, NSRect destination)
|
|||
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
|
||||
[glView reshape]; // to get rid of fuglies on screen
|
||||
[self.glView reshape]; // to get rid of fuglies on screen
|
||||
// GLinitialize(); // blunt instrument method of setting a proper state.
|
||||
|
||||
}
|
||||
|
@ -313,7 +315,7 @@ NSRect FitRectInRect(NSRect source, NSRect destination)
|
|||
|
||||
if (!(([sender resizeFlags] & NSShiftKeyMask) == NSShiftKeyMask)) {
|
||||
NSRect oldSize = [sender frame];
|
||||
NSRect viewSize = [glView frame];
|
||||
NSRect viewSize = [self.glView frame];
|
||||
|
||||
float xDiff = NSWidth(oldSize) - NSWidth(viewSize);
|
||||
float yDiff = NSHeight(oldSize) - NSHeight(viewSize);
|
||||
|
@ -404,8 +406,8 @@ NSRect FitRectInRect(NSRect source, NSRect destination)
|
|||
roundf((aFrame.size.height - proportionalHeight)/2.0),
|
||||
roundf(proportionalWidth), roundf(proportionalHeight));
|
||||
|
||||
[glView setFrame:fitToWindow];
|
||||
[glView reshape];
|
||||
[self.glView setFrame:fitToWindow];
|
||||
[self.glView reshape];
|
||||
iResX = roundf(proportionalWidth);
|
||||
iResY = roundf(proportionalHeight);
|
||||
|
||||
|
|
Loading…
Reference in New Issue