diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-11-10 20:22:50 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-11-10 20:22:50 +0000 |
| commit | a96ba176322566d9d15b51c714984affcdfc6355 (patch) | |
| tree | fe6496196975b981955a580d0a0442c235037749 /macosx/plugins/DFXVideo/macsrc | |
| parent | 0f8e66e194b903763b6c580599eb47c11f154bdd (diff) | |
| download | pcsxr-a96ba176322566d9d15b51c714984affcdfc6355.tar.gz | |
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
Diffstat (limited to 'macosx/plugins/DFXVideo/macsrc')
6 files changed, 92 insertions, 86 deletions
diff --git a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h index ea8e10ff..43d0b6df 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h +++ b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.h @@ -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; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m index 7b79adfd..019a1301 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginConfigController.m @@ -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]; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.h b/macosx/plugins/DFXVideo/macsrc/PluginGLView.h index a8667b11..d75f7ee3 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.h +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.h @@ -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; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m index a3dda640..49dfe7b2 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginGLView.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginGLView.m @@ -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 diff --git a/macosx/plugins/DFXVideo/macsrc/PluginWindowController.h b/macosx/plugins/DFXVideo/macsrc/PluginWindowController.h index 3d5d89e0..2ac5cc21 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginWindowController.h +++ b/macosx/plugins/DFXVideo/macsrc/PluginWindowController.h @@ -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; diff --git a/macosx/plugins/DFXVideo/macsrc/PluginWindowController.m b/macosx/plugins/DFXVideo/macsrc/PluginWindowController.m index d6ddb17d..29b8b387 100755 --- a/macosx/plugins/DFXVideo/macsrc/PluginWindowController.m +++ b/macosx/plugins/DFXVideo/macsrc/PluginWindowController.m @@ -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); |
