summaryrefslogtreecommitdiff
path: root/macosx/plugins
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-21 23:19:04 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-21 23:19:04 +0000
commitde13f7dcbaa84255fa578aafe862f90c46225a01 (patch)
tree0da83fa6b6e634d1f3e4a7af7e629d5473cfd76e /macosx/plugins
parente57165ae3f1706afec533d7b3cae17555a0f38ad (diff)
downloadpcsxr-de13f7dcbaa84255fa578aafe862f90c46225a01.tar.gz
Fix OS X 10.8-only behavior in the XGL plug-in.
Remove some commented-out code on Cocoa code. Change some ints passed in Cocoa code to NSIntegers. Replace a deprecated function call to NSRunAlertPanelRelativeToWindow. Other minor fixes and improvements. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86808 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins')
-rwxr-xr-xmacosx/plugins/DFInput/macsrc/ControllerList.h2
-rwxr-xr-xmacosx/plugins/DFInput/macsrc/ControllerList.m2
-rw-r--r--macosx/plugins/PeopsXgl/English.lproj/NetSfPeopsOpenGLConfig.xib21
-rwxr-xr-xmacosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m66
4 files changed, 46 insertions, 45 deletions
diff --git a/macosx/plugins/DFInput/macsrc/ControllerList.h b/macosx/plugins/DFInput/macsrc/ControllerList.h
index d0d1fb13..7eab9a54 100755
--- a/macosx/plugins/DFInput/macsrc/ControllerList.h
+++ b/macosx/plugins/DFInput/macsrc/ControllerList.h
@@ -33,7 +33,7 @@
+ (void)setCurrentController:(int)which;
+ (int)currentController;
-+ (int)buttonOfRow:(int)row;
++ (int)buttonOfRow:(NSInteger)row;
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;
- (void)deleteRow:(NSInteger)which;
diff --git a/macosx/plugins/DFInput/macsrc/ControllerList.m b/macosx/plugins/DFInput/macsrc/ControllerList.m
index 4e208cab..a1d4deed 100755
--- a/macosx/plugins/DFInput/macsrc/ControllerList.m
+++ b/macosx/plugins/DFInput/macsrc/ControllerList.m
@@ -105,7 +105,7 @@ static const int DPad[DKEY_TOTAL] = {
DKEY_ANALOG
};
-+ (int)buttonOfRow:(int)row
++ (int)buttonOfRow:(NSInteger)row
{
return DPad[row];
}
diff --git a/macosx/plugins/PeopsXgl/English.lproj/NetSfPeopsOpenGLConfig.xib b/macosx/plugins/PeopsXgl/English.lproj/NetSfPeopsOpenGLConfig.xib
index 6e528364..9d08f139 100644
--- a/macosx/plugins/PeopsXgl/English.lproj/NetSfPeopsOpenGLConfig.xib
+++ b/macosx/plugins/PeopsXgl/English.lproj/NetSfPeopsOpenGLConfig.xib
@@ -102,7 +102,6 @@
<string key="NSFrame">{{413, 13}, {122, 32}}</string>
<reference key="NSSuperview" ref="675926718"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="972260448">
<int key="NSCellFlags">67108864</int>
@@ -656,7 +655,6 @@
<bytes key="NSWhite">MQA</bytes>
</object>
<reference key="NSFont" ref="917501388"/>
- <bool key="NSAutorecalculatesCellSize">YES</bool>
</object>
</object>
<string key="NSFrame">{{2, 2}, {510, 127}}</string>
@@ -1577,7 +1575,7 @@
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="713073715">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1596,7 +1594,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{17, 13}, {420, 178}}</string>
<reference key="NSSuperview" ref="138033641"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="599923"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1896,13 +1893,11 @@
</object>
<string key="NSFrame">{{2, 2}, {459, 202}}</string>
<reference key="NSSuperview" ref="671483095"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="232960397"/>
</object>
</object>
<string key="NSFrame">{{17, 57}, {463, 206}}</string>
<reference key="NSSuperview" ref="713073715"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="138033641"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
@@ -1927,7 +1922,6 @@
<int key="NSvFlags">269</int>
<string key="NSFrame">{{143, 269}, {211, 56}}</string>
<reference key="NSSuperview" ref="713073715"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="671483095"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="688135460">
@@ -1949,7 +1943,6 @@ A</string>
<int key="NSvFlags">269</int>
<string key="NSFrame">{{195, 331}, {106, 18}}</string>
<reference key="NSSuperview" ref="713073715"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="320711766"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="46903452">
@@ -1973,8 +1966,6 @@ A</string>
<int key="NSvFlags">269</int>
<string key="NSFrame">{{424, 13}, {59, 32}}</string>
<reference key="NSSuperview" ref="713073715"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSTag">1</int>
<bool key="NSEnabled">YES</bool>
@@ -1999,7 +1990,6 @@ A</string>
<int key="NSvFlags">269</int>
<string key="NSFrame">{{342, 13}, {82, 32}}</string>
<reference key="NSSuperview" ref="713073715"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="91253578"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2021,8 +2011,6 @@ A</string>
</object>
</object>
<string key="NSFrameSize">{497, 367}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1031376586"/>
<string key="NSReuseIdentifierKey">_NS:20</string>
</object>
@@ -4326,7 +4314,6 @@ A</string>
<string>texFiltering</string>
<string>vSync</string>
<string>windowHeighth</string>
- <string>windowSize</string>
<string>windowWidth</string>
<string>wireframeOnly</string>
<string>zMaskClipping</string>
@@ -4357,7 +4344,6 @@ A</string>
<string>NSSlider</string>
<string>NSControl</string>
<string>NSFormCell</string>
- <string>NSPopUpButton</string>
<string>NSFormCell</string>
<string>NSControl</string>
<string>NSControl</string>
@@ -4391,7 +4377,6 @@ A</string>
<string>texFiltering</string>
<string>vSync</string>
<string>windowHeighth</string>
- <string>windowSize</string>
<string>windowWidth</string>
<string>wireframeOnly</string>
<string>zMaskClipping</string>
@@ -4495,10 +4480,6 @@ A</string>
<string key="candidateClassName">NSFormCell</string>
</object>
<object class="IBToOneOutletInfo">
- <string key="name">windowSize</string>
- <string key="candidateClassName">NSPopUpButton</string>
- </object>
- <object class="IBToOneOutletInfo">
<string key="name">windowWidth</string>
<string key="candidateClassName">NSFormCell</string>
</object>
diff --git a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m
index c963c35a..12994a8e 100755
--- a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m
+++ b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m
@@ -48,12 +48,10 @@ extern char* PLUGLOC(char* toloc);
#define PrefsKey APP_ID @" Settings"
static NetSfPeopsOpenGLPluginConfigController *windowController = nil;
-char * pConfigFile=NULL;
void AboutDlgProc()
{
// Get parent application instance
- NSApplication *app = [NSApplication sharedApplication];
NSBundle *bundle = [NSBundle bundleWithIdentifier:APP_ID];
// Get Credits.rtf
@@ -80,7 +78,7 @@ void AboutDlgProc()
credits, @"Credits",
nil];
dispatch_async(dispatch_get_main_queue(), ^{
- [app orderFrontStandardAboutPanelWithOptions:infoPaneDict];
+ [NSApp orderFrontStandardAboutPanelWithOptions:infoPaneDict];
});
RELEASEOBJ(infoPaneDict);
}
@@ -110,6 +108,7 @@ void DlgProc()
#define kFrameLimit @"Frame Limit"
#define kVSync @"VSync"
#define kHacksEnable @"Enable Hacks"
+#define kWindowSize @"Window Size"
void PrepFactoryDefaultPreferences(void)
{
@@ -124,15 +123,25 @@ void PrepFactoryDefaultPreferences(void)
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary* keyValues = [defaults dictionaryForKey:PrefsKey];
-
- if (keyValues && [[keyValues objectForKey:@"Window Size"] isKindOfClass:[NSNumber class]]) {
+ BOOL windowSizeNeedsReset = NO;
+ if (keyValues) {
+ NSSize size = NSSizeFromString([keyValues objectForKey:kWindowSize]);
+ if (![keyValues objectForKey:kWindowSize]) {
+ windowSizeNeedsReset = YES;
+ } else if ([[keyValues objectForKey:kWindowSize] isKindOfClass:[NSNumber class]]) {
+ windowSizeNeedsReset = YES;
+ } else if (size.height == 0 || size.width == 0) {
+ windowSizeNeedsReset = YES;
+ }
+ }
+ if (windowSizeNeedsReset) {
NSMutableDictionary *tmpDict = [[NSMutableDictionary alloc] initWithDictionary:keyValues];
- [tmpDict setObject:NSStringFromSize(NSMakeSize(800, 600)) forKey:@"Window Size"];
+ [tmpDict setObject:NSStringFromSize(NSMakeSize(800, 600)) forKey:kWindowSize];
[defaults setObject:tmpDict forKey:PrefsKey];
[defaults synchronize];
RELEASEOBJ(tmpDict);
}
-
+ keyValues = nil;
[defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
[NSDictionary dictionaryWithObjectsAndKeys:
@@ -143,7 +152,7 @@ void PrepFactoryDefaultPreferences(void)
@NO, kVSync,
@NO, kHacksEnable,
@0, @"Dither Mode",
- @((unsigned int)0), kHacks,
+ @0, kHacks,
@YES, @"Proportional Resize",
//[NSSize stringWithCString: @"default"], @"Fullscreen Resolution",
@@ -152,7 +161,7 @@ void PrepFactoryDefaultPreferences(void)
@0, @"Texture Enhancement Level",
@0, @"Texture Filter Level",
@0, @"Frame Buffer Level",
- NSStringFromSize(NSMakeSize(800, 600)), @"Window Size",
+ NSStringFromSize(NSMakeSize(800, 600)), kWindowSize,
@NO, @"Draw Scanlines",
// nasty:
[NSArchiver archivedDataWithRootObject: [NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.25]], @"Scanline Color",
@@ -202,7 +211,7 @@ void ReadConfig(void)
// we always start out at 800x600 (at least until resizing the window is implemented)
- NSSize winSize = NSSizeFromString([keyValues objectForKey:@"Window Size"]);
+ NSSize winSize = NSSizeFromString([keyValues objectForKey:kWindowSize]);
if (bChangeWinMode == 1) {
iResX = winSize.width;
iResY = winSize.height;
@@ -213,7 +222,7 @@ void ReadConfig(void)
iBlurBuffer = [[keyValues objectForKey:@"Blur"] boolValue]; // not noticeable, but doesn't harm
iUseScanLines = [[keyValues objectForKey:@"Draw Scanlines"] boolValue]; // works
- NSColor* scanColor = [NSUnarchiver unarchiveObjectWithData: [keyValues objectForKey:@"Scanline Color"]];
+ NSColor* scanColor = [NSUnarchiver unarchiveObjectWithData:[keyValues objectForKey:@"Scanline Color"]];
scanColor = [scanColor colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]];
iScanlineColor[0] = [scanColor redComponent];
iScanlineColor[1] = [scanColor greenComponent];
@@ -296,17 +305,19 @@ void ReadConfig(void)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+#if 0
unsigned int hackValues = 0;
NSArray *views = [hacksMatrix cells];
for (NSControl *control in views) {
hackValues |= [control intValue] << ([control tag] - 1);
}
+#endif
- self.keyValues = [NSMutableDictionary dictionaryWithDictionary: [[NSUserDefaults standardUserDefaults] dictionaryForKey:PrefsKey]];
+ //self.keyValues = [NSMutableDictionary dictionaryWithDictionary: [[NSUserDefaults standardUserDefaults] dictionaryForKey:PrefsKey]];
NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues];
- [writeDic setObject:@(hackValues) forKey:kHacks];
+ //[writeDic setObject:@(hackValues) forKey:kHacks];
[writeDic setObject:([hackEnable integerValue] ? @YES : @NO) forKey:kHacksEnable];
[writeDic setObject:([fpsCounter integerValue] ? @YES : @NO) forKey:kFPSCounter];
[writeDic setObject:[NSArchiver archivedDataWithRootObject:[scanlineColorWell color]] forKey:@"Scanline Color"];
@@ -330,10 +341,8 @@ void ReadConfig(void)
[writeDic setObject:([mjpegDecoder15bit integerValue] ? @YES : @NO) forKey:@"Fast mjpeg decoder"];
[writeDic setObject:([gteAccuracy integerValue] ? @YES : @NO) forKey:@"GteAccuracy"];
[writeDic setObject:([vSync integerValue] ? @YES : @NO) forKey:kVSync];
- [writeDic setObject:NSStringFromSize(NSMakeSize([windowWidth integerValue], [windowHeighth integerValue])) forKey:@"Window Size"];
- //[writeDic setObject:@([windowSize indexOfItem:[windowSize selectedItem]]) forKey:@"Window Size"];
-
-
+ [writeDic setObject:NSStringFromSize(NSMakeSize([windowWidth integerValue], [windowHeighth integerValue])) forKey:kWindowSize];
+
[defaults setObject:writeDic forKey:PrefsKey];
[defaults synchronize];
@@ -364,8 +373,7 @@ void ReadConfig(void)
[hackEnable setIntegerValue:[[self.keyValues objectForKey:kHacksEnable] boolValue]];
// build refs to hacks checkboxes
- NSArray *views = [hacksMatrix cells];
- for (NSControl *control in views) {
+ for (NSControl *control in [hacksMatrix cells]) {
[control setIntValue:(hackValues >> ([control tag] - 1)) & 1];
}
@@ -408,16 +416,13 @@ void ReadConfig(void)
[frameBufferEffects selectItemAtIndex:[[keyValues objectForKey:@"Frame Buffer Level"] integerValue]];
[vSync setIntegerValue:[[keyValues objectForKey:kVSync] boolValue]];
[proportionalResize setIntegerValue:[[keyValues objectForKey:@"Proportional Resize"] boolValue]];
- NSSize winSize = NSSizeFromString([keyValues objectForKey:@"Window Size"]);
+ NSSize winSize = NSSizeFromString([keyValues objectForKey:kWindowSize]);
[windowWidth setIntegerValue:winSize.width];
[windowHeighth setIntegerValue:winSize.height];
-
- //[windowSize selectItemAtIndex:[[keyValues objectForKey:@"Window Size"] integerValue]];
}
- (void)awakeFromNib
{
- //hacksView = [[hacksView subviews] objectAtIndex:0];
[[NSColorPanel sharedColorPanel] setShowsAlpha:YES]; // eliminate dumb behavior!
}
@@ -427,6 +432,12 @@ void ReadConfig(void)
if (returnCode == NSCancelButton) {
//Reset hack preferences.
[self loadHacksValues];
+ } else {
+ unsigned int hackValues = 0;
+ for (NSControl *control in [hacksMatrix cells]) {
+ hackValues |= [control intValue] << ([control tag] - 1);
+ }
+ [self.keyValues setObject:@(hackValues) forKey:kHacks];
}
[sheet orderOut:nil];
}
@@ -453,6 +464,15 @@ void ReadConfig(void)
}
}
+#if !__has_feature(objc_arc)
+- (void)dealloc
+{
+ self.keyValues = nil;
+
+ [super dealloc];
+}
+#endif
+
@end
#import "OSXPlugLocalization.h"