diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-24 02:19:14 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-24 02:19:14 +0000 |
| commit | 8b64ca8414e1dcf56b1d3d3a481090e551499445 (patch) | |
| tree | ec0ca496628d928ab03f4488626cb30bfab8593a | |
| parent | 0fe00d6450e7f0288cad751d46fff70118857859 (diff) | |
| download | pcsxr-8b64ca8414e1dcf56b1d3d3a481090e551499445.tar.gz | |
Continual improvement to OS X code.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86890 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | macosx/Configs/Pcsxr-Release.xcconfig | 1 | ||||
| -rwxr-xr-x | macosx/PcsxrPlugin.m | 10 | ||||
| -rwxr-xr-x | macosx/PluginController.m | 30 | ||||
| -rwxr-xr-x | macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m | 15 |
4 files changed, 35 insertions, 21 deletions
diff --git a/macosx/Configs/Pcsxr-Release.xcconfig b/macosx/Configs/Pcsxr-Release.xcconfig index e3ee3f60..5f0b2ea9 100644 --- a/macosx/Configs/Pcsxr-Release.xcconfig +++ b/macosx/Configs/Pcsxr-Release.xcconfig @@ -8,3 +8,4 @@ GCC_UNROLL_LOOPS = YES COPY_PHASE_STRIP = YES OPTIMIZATION_CFLAGS = -finline-functions -fomit-frame-pointer -fno-exceptions -funroll-loops -ffast-math STRIP_INSTALLED_PRODUCT = YES +DEAD_CODE_STRIPPING = YES diff --git a/macosx/PcsxrPlugin.m b/macosx/PcsxrPlugin.m index e64ce9ce..3d5b68b7 100755 --- a/macosx/PcsxrPlugin.m +++ b/macosx/PcsxrPlugin.m @@ -232,7 +232,10 @@ } } - if (pluginRef) SysCloseLibrary(pluginRef); + if (pluginRef) { + SysCloseLibrary(pluginRef); + pluginRef = NULL; + } #if !__has_feature(objc_arc) self.modDate = nil; @@ -306,6 +309,7 @@ - (long)shutdownAs:(int)aType { +#if 0 long (*shutdown)(void); shutdown = SysLoadSym(pluginRef, [PluginSymbolName(aType, @"shutdown") @@ -316,6 +320,10 @@ } return PSE_ERR_FATAL; +#else + active &= ~aType; + return PSE_ERR_SUCCESS; +#endif } #define PluginSymbolNameConfigure(type) PluginSymbolName(type, @"configure") diff --git a/macosx/PluginController.m b/macosx/PluginController.m index 1d74f9cc..27ff6f01 100755 --- a/macosx/PluginController.m +++ b/macosx/PluginController.m @@ -3,7 +3,14 @@ #import "PcsxrController.h" #import "ARCBridge.h" +@interface PluginController () +@property (arcstrong) NSArray *plugins; +@property (arcstrong) NSString *defaultKey; +@end + @implementation PluginController +@synthesize defaultKey; +@synthesize plugins; - (IBAction)doAbout:(id)sender { @@ -14,13 +21,12 @@ - (IBAction)doConfigure:(id)sender { PcsxrPlugin *plugin = [plugins objectAtIndex:[pluginMenu indexOfSelectedItem]]; - [plugin configureAs:pluginType]; } - (IBAction)selectPlugin:(id)sender { - if (sender==pluginMenu) { + if (sender == pluginMenu) { NSInteger index = [pluginMenu indexOfSelectedItem]; if (index != -1) { PcsxrPlugin *plugin = [plugins objectAtIndex:index]; @@ -47,12 +53,11 @@ - (void)setPluginsTo:(NSArray *)list withType:(int)type { NSString *sel; - NSUInteger i; // remember the list pluginType = type; - plugins = RETAINOBJ(list); - defaultKey = RETAINOBJ([PcsxrPlugin defaultKeyForType:pluginType]); + self.plugins = list; + self.defaultKey = [PcsxrPlugin defaultKeyForType:pluginType]; // clear the previous menu items [pluginMenu removeAllItems]; @@ -61,12 +66,13 @@ sel = [[NSUserDefaults standardUserDefaults] stringForKey:defaultKey]; // add the menu entries - for (i = 0; i < [plugins count]; i++) { - [pluginMenu addItemWithTitle:[[plugins objectAtIndex:i] description]]; - + for (PcsxrPlugin *plug in plugins) { + NSString *description = [plug description]; + [pluginMenu addItemWithTitle:description]; + // make sure the currently selected is set as such - if ([sel isEqualToString:[[plugins objectAtIndex:i] path]]) { - [pluginMenu selectItemAtIndex:i]; + if ([sel isEqualToString:[plug path]]) { + [pluginMenu selectItemWithTitle:description]; } } @@ -76,8 +82,8 @@ #if !__has_feature(objc_arc) - (void)dealloc { - [plugins release]; - [defaultKey release]; + self.plugins = nil; + self.defaultKey = nil; [super dealloc]; } diff --git a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m index 9097ffe8..fbcf0cf4 100755 --- a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m +++ b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m @@ -59,7 +59,7 @@ void AboutDlgProc() NSString *path = [bundle pathForResource:@"Credits" ofType:@"rtf"]; NSAttributedString *credits; if (path) { - credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithPath: path documentAttributes:NULL]); + credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithPath:path documentAttributes:NULL]); } else { credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithString:@""]); } @@ -167,7 +167,7 @@ void PrepFactoryDefaultPreferences(void) NSStringFromSize(NSMakeSize(800, 600)), kWindowSize, @NO, @"Draw Scanlines", // nasty: - [NSArchiver archivedDataWithRootObject: [NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.25]], @"Scanline Color", + [NSArchiver archivedDataWithRootObject: [NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.25]], @"Scanline Color", @NO, @"Advanced Blending", @NO, @"Opaque Pass", @NO, @"Blur", @@ -278,8 +278,7 @@ void ReadConfig(void) // additional checks if(!iColDepth) iColDepth=32; - if(bUseFixes) - { + if(bUseFixes) { dwActFixes = dwCfgFixes; } else { dwActFixes = 0; @@ -315,12 +314,12 @@ void ReadConfig(void) [writeDic setObject:([autoFullScreen integerValue] ? @YES : @NO) forKey:kAutoFullScreen]; //[writeDic setObject:([frameLimit integerValue] ? @YES : @NO) forKey:kFrameLimit]; [writeDic setObject:([proportionalResize integerValue] ? @YES : @NO) forKey:@"Proportional Resize"]; - [writeDic setObject:@([ditherMode indexOfItem:[ditherMode selectedItem]]) forKey:@"Dither Mode"]; - [writeDic setObject:@([offscreenDrawing indexOfItem:[offscreenDrawing selectedItem]]) forKey:@"Offscreen Drawing Level"]; - [writeDic setObject:@([texColorDepth indexOfItem:[texColorDepth selectedItem]]) forKey:@"Texture Color Depth Level"]; + [writeDic setObject:@([ditherMode indexOfSelectedItem]) forKey:@"Dither Mode"]; + [writeDic setObject:@([offscreenDrawing indexOfSelectedItem]) forKey:@"Offscreen Drawing Level"]; + [writeDic setObject:@([texColorDepth indexOfSelectedItem]) forKey:@"Texture Color Depth Level"]; [writeDic setObject:@([texEnhancment integerValue]) forKey:@"Texture Enhancement Level"]; [writeDic setObject:@([texFiltering integerValue]) forKey:@"Texture Filter Level"]; - [writeDic setObject:@([frameBufferEffects indexOfItem:[frameBufferEffects selectedItem]]) forKey:@"Frame Buffer Level"]; + [writeDic setObject:@([frameBufferEffects indexOfSelectedItem]) forKey:@"Frame Buffer Level"]; [writeDic setObject:([drawScanlines integerValue] ? @YES : @NO) forKey:@"Draw Scanlines"]; [writeDic setObject:([advancedBlending integerValue] ? @YES : @NO) forKey:@"Advanced Blending"]; [writeDic setObject:([opaquePass integerValue] ? @YES : @NO) forKey:@"Opaque Pass"]; |
