diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-22 23:53:37 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-22 23:53:37 +0000 |
| commit | 531ad373b2c22e00a341a6635023cf8949571bd5 (patch) | |
| tree | 029961f0aa19ec396f6d7cc09f3ff93987c9aa62 /macosx/plugins/DFXVideo/macsrc | |
| parent | 9628a367530657e7fefb17be0a125dbe3f5d7614 (diff) | |
| download | pcsxr-531ad373b2c22e00a341a6635023cf8949571bd5.tar.gz | |
Moving most of the OS X preferences to auto layout, and all to 10.7.
Changing some lists of independent checkbox buttons to matrices.
Fix a discrepancy between SDL versions 1.2 and 2.0 APIs in OS X's input preferences.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86849 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFXVideo/macsrc')
| -rwxr-xr-x | macosx/plugins/DFXVideo/macsrc/PluginConfigController.h | 6 | ||||
| -rwxr-xr-x | macosx/plugins/DFXVideo/macsrc/PluginConfigController.m | 64 | ||||
| -rwxr-xr-x | macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h | 5 |
3 files changed, 35 insertions, 40 deletions
diff --git a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h index d4bac705..3a8ac98a 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h +++ b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h @@ -3,6 +3,7 @@ #define PluginConfigController NetSfPeopsSoftGPUPluginConfigController #import <Cocoa/Cocoa.h> +#import "ARCBridge.h" @interface NetSfPeopsSoftGPUPluginConfigController : NSWindowController { @@ -12,6 +13,7 @@ IBOutlet NSControl *frameSkipping; IBOutlet NSControl *hackEnable; IBOutlet NSView *hacksView; + IBOutlet NSMatrix *hacksMatrix; IBOutlet NSControl *vSync; IBOutlet NSControl *shaders; IBOutlet NSTextField *vertexShaderViewablePath; @@ -27,8 +29,8 @@ NSMutableDictionary *keyValues; } -@property (retain) NSURL *vertexPath; -@property (retain) NSURL *fragmentPath; +@property (arcretain) NSURL *vertexPath; +@property (arcretain) NSURL *fragmentPath; - (IBAction)cancel:(id)sender; - (IBAction)ok:(id)sender; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m index cbdbda74..d20849fb 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m @@ -5,6 +5,7 @@ #include "externals.h" #import "SGPUPreferences.h" #import "ARCBridge.h" +#import "PluginGLView.h" #ifdef ENABLE_NLS #include <libintl.h> @@ -81,18 +82,20 @@ void AboutDlgProc() void SoftDlgProc() { - NSWindow *window; - - if (windowController == nil) { - windowController = [[PluginConfigController alloc] initWithWindowNibName:@"NetSfPeopsSoftGPUConfig"]; - } - window = [windowController window]; - - /* load values */ - [windowController loadValues]; - - [window center]; - [window makeKeyAndOrderFront:nil]; + RunOnMainThreadSync(^{ + NSWindow *window; + + if (windowController == nil) { + windowController = [[PluginConfigController alloc] initWithWindowNibName:@"NetSfPeopsSoftGPUConfig"]; + } + window = [windowController window]; + + /* load values */ + [windowController loadValues]; + + [window center]; + [window makeKeyAndOrderFront:nil]; + }); } BOOL isShaderEnabled() @@ -211,11 +214,8 @@ void ReadConfig(void) [writeDic setObject:@([ditherMode indexOfSelectedItem]) forKey:@"Dither Mode"]; unsigned int hackValues = 0; - NSArray *views = [hacksView subviews]; - for (NSView *control in views) { - if ([control isKindOfClass:[NSButton class]]) { - hackValues |= [(NSControl *)control intValue] << ([control tag] - 1); - } + for (NSCell *control in [hacksMatrix cells]) { + hackValues |= [control intValue] << ([control tag] - 1); } [writeDic setObject:@(hackValues) forKey:@"Hacks"]; @@ -243,10 +243,13 @@ void ReadConfig(void) - (IBAction)hackToggle:(id)sender { BOOL enable = [sender intValue] ? YES : NO; - NSArray *views = [hacksView subviews]; + NSArray *views = [[[hacksView subviews] objectAtIndex:0] subviews]; for (NSView *control in views) { - if ([control isKindOfClass:[NSButton class]]) { + if ([control isKindOfClass:[NSControl class]]) { + if ([control isKindOfClass:[NSTextField class]]) { + [(NSTextField*)control setTextColor:enable ? [NSColor controlTextColor] : [NSColor disabledControlTextColor] ]; + } [(NSControl *)control setEnabled:enable]; } } @@ -254,10 +257,15 @@ void ReadConfig(void) - (IBAction)toggleShader:(id)sender { BOOL enable = [sender intValue] ? YES : NO; - NSArray *views = [shadersView subviews]; + NSArray *views = [[[shadersView subviews] objectAtIndex:0] subviews]; for (NSView *control in views) { - [(NSControl *)control setEnabled:enable]; + if ([control isKindOfClass:[NSControl class]]) { + if ([control isKindOfClass:[NSTextField class]]) { + [(NSTextField*)control setTextColor:enable ? [NSColor controlTextColor] : [NSColor disabledControlTextColor] ]; + } + [(NSControl *)control setEnabled:enable]; + } } } @@ -334,24 +342,14 @@ void ReadConfig(void) unsigned int hackValues = [[keyValues objectForKey:@"Hacks"] unsignedIntValue]; - NSArray *views = [hacksView subviews]; - for (NSView *control in views) { - if ([control isKindOfClass:[NSButton class]]) { - [(NSControl *)control setIntValue:(hackValues >> ([control tag] - 1)) & 1]; - } + for (NSCell *control in [hacksMatrix cells]) { + [control setIntValue:(hackValues >> ([control tag] - 1)) & 1]; } [self hackToggle:hackEnable]; [self toggleShader:shaders]; } -- (void)awakeFromNib -{ - //I don't know why we need to do this... - hacksView = [[hacksView subviews] objectAtIndex:0]; - shadersView = [[shadersView subviews] objectAtIndex:0]; -} - #if !__has_feature(objc_arc) - (void)dealloc { diff --git a/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h b/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h index 27449a69..f66f5f8a 100755 --- a/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h +++ b/macosx/plugins/DFXVideo/macsrc/SGPUPreferences.h @@ -6,14 +6,9 @@ // // -#ifndef PeopsSoftGPU_SGPUPreferences_h -#define PeopsSoftGPU_SGPUPreferences_h - #import <Cocoa/Cocoa.h> BOOL isShaderEnabled(); NSURL *PSXFragmentShader(); NSURL *PSXVertexShader(); float PSXShaderQuality(); - -#endif |
