diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-04 03:07:44 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-07-04 03:07:44 +0000 |
| commit | dd7da2fae96b9ba6bdbc28f7b26469373801f21e (patch) | |
| tree | 9faf6aa7f2fa2900dcabc3d88d11e87285693e9b /macosx/plugins/PeopsXgl | |
| parent | a012af37d7bd3a972d2b3fbb7ed09bc8662e91eb (diff) | |
| download | pcsxr-dd7da2fae96b9ba6bdbc28f7b26469373801f21e.tar.gz | |
Make the plug-ins use ARC in 64-bit mode.
Change how the preprocessor macros are managed on OS X.
Set the name of the product to the target name.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85795 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/PeopsXgl')
| -rw-r--r-- | macosx/plugins/PeopsXgl/ARCBridge.h | 36 | ||||
| -rw-r--r-- | macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj | 32 | ||||
| -rwxr-xr-x | macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m | 51 | ||||
| -rwxr-xr-x | macosx/plugins/PeopsXgl/macsrc/PluginGLView.h | 2 | ||||
| -rwxr-xr-x | macosx/plugins/PeopsXgl/macsrc/PluginGLView.m | 11 | ||||
| -rwxr-xr-x | macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m | 14 | ||||
| -rwxr-xr-x | macosx/plugins/PeopsXgl/macsrc/drawgl.m | 3 |
7 files changed, 99 insertions, 50 deletions
diff --git a/macosx/plugins/PeopsXgl/ARCBridge.h b/macosx/plugins/PeopsXgl/ARCBridge.h new file mode 100644 index 00000000..ea274b84 --- /dev/null +++ b/macosx/plugins/PeopsXgl/ARCBridge.h @@ -0,0 +1,36 @@ +// +// ARCBridge.h +// PPMacho +// +// Created by C.W. Betts on 12/23/12. +// +// + +#ifndef PPMacho_ARCBridge_h +#define PPMacho_ARCBridge_h + +#if __has_feature(objc_arc) + +#define SUPERDEALLOC +#define RELEASEOBJ(obj) +#define RETAINOBJ(obj) obj +#define RETAINOBJNORETURN(obj) +#define AUTORELEASEOBJ(obj) obj +#define AUTORELEASEOBJNORETURN(obj) +#define BRIDGE(toType, obj) (__bridge toType)(obj) +#define __arcweak __weak + +#else + +#define SUPERDEALLOC [super dealloc] +#define RELEASEOBJ(obj) [obj release] +#define RETAINOBJ(obj) [obj retain] +#define RETAINOBJNORETURN(obj) [obj retain] +#define AUTORELEASEOBJ(obj) [obj autorelease] +#define AUTORELEASEOBJNORETURN(obj) [obj autorelease] +#define BRIDGE(toType, obj) (toType)obj +#define __arcweak + +#endif + +#endif diff --git a/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj b/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj index c6e7770f..37cf76c0 100644 --- a/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj +++ b/macosx/plugins/PeopsXgl/PeopsXGL.xcodeproj/project.pbxproj @@ -37,7 +37,7 @@ 2B038D2206918AA80082466B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 2B51949E06B3D2D200744730 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = /System/Library/Frameworks/GLUT.framework; sourceTree = "<absolute>"; }; 2B959E4306342D32000F2A2D /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; - 2BAF50930632BB1A00DB9A16 /* PeopsXGL.psxplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PeopsXGL.psxplugin; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BAF50930632BB1A00DB9A16 /* gpuPeopsXGL.psxplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = gpuPeopsXGL.psxplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 2BD2E768077AF53E00657C69 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; }; 3F31AF6A1302D4B600CBB551 /* drawgl.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = drawgl.m; path = macsrc/drawgl.m; sourceTree = SOURCE_ROOT; }; 3F31AF6E1302D4B600CBB551 /* PluginGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PluginGLView.h; path = macsrc/PluginGLView.h; sourceTree = SOURCE_ROOT; }; @@ -68,6 +68,7 @@ 3F7F384613079BFD00556C34 /* draw.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = draw.h; path = ../../../plugins/peopsxgl/draw.h; sourceTree = SOURCE_ROOT; }; 3F7F384713079BFD00556C34 /* draw.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; lineEnding = 2; name = draw.c; path = ../../../plugins/peopsxgl/draw.c; sourceTree = SOURCE_ROOT; }; 552E4CCA1474742F00FB231F /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; }; + 558600711785139200CB3D85 /* ARCBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARCBridge.h; sourceTree = "<group>"; }; 55D42F10168D9AAE0027EBF0 /* ExtendedKeys.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ExtendedKeys.h; path = macsrc/ExtendedKeys.h; sourceTree = "<group>"; }; 55F36E4A146C9F9900718DE6 /* drawgl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = drawgl.h; path = macsrc/drawgl.h; sourceTree = "<group>"; }; A191B90513F6741300D0971F /* gte_accuracy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gte_accuracy.c; path = ../../../plugins/peopsxgl/gte_accuracy.c; sourceTree = SOURCE_ROOT; }; @@ -111,7 +112,7 @@ 2B3E5A46062AACF3001D796E /* Products */ = { isa = PBXGroup; children = ( - 2BAF50930632BB1A00DB9A16 /* PeopsXGL.psxplugin */, + 2BAF50930632BB1A00DB9A16 /* gpuPeopsXGL.psxplugin */, ); name = Products; sourceTree = "<group>"; @@ -119,6 +120,7 @@ 2BD2E2F40779F50B00657C69 /* macsrc */ = { isa = PBXGroup; children = ( + 558600711785139200CB3D85 /* ARCBridge.h */, 55D42F10168D9AAE0027EBF0 /* ExtendedKeys.h */, 3F7F38021307999800556C34 /* NetSfPeopsOpenGLPluginConfigController.h */, 3F7F38031307999800556C34 /* NetSfPeopsOpenGLPluginConfigController.m */, @@ -191,7 +193,7 @@ ); name = gpuPeopsXGL; productName = gpuPeopsSoftGL; - productReference = 2BAF50930632BB1A00DB9A16 /* PeopsXGL.psxplugin */; + productReference = 2BAF50930632BB1A00DB9A16 /* gpuPeopsXGL.psxplugin */; productType = "com.apple.product-type.bundle"; }; /* End PBXNativeTarget section */ @@ -301,6 +303,7 @@ 7170842D0FDFD328004F3EB4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + "CLANG_ENABLE_OBJC_ARC[arch=x86_64]" = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; @@ -311,7 +314,7 @@ "PCSXRPLUG=PeopsXGL", _MACGL, _DARWIN, - "_MACOSX=1", + "$(inherited)", ); GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; @@ -325,9 +328,8 @@ "-framework", AppKit, ); - PRODUCT_NAME = PeopsXGL; + PRODUCT_NAME = "$(TARGET_NAME)"; SECTORDER_FLAGS = ""; - SYMROOT = ../../build; WRAPPER_EXTENSION = psxplugin; }; name = Debug; @@ -335,6 +337,7 @@ 7170842E0FDFD328004F3EB4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + "CLANG_ENABLE_OBJC_ARC[arch=x86_64]" = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; GCC_DYNAMIC_NO_PIC = NO; @@ -345,7 +348,7 @@ "PCSXRPLUG=PeopsXGL", _MACGL, _DARWIN, - "_MACOSX=1", + "$(inherited)", ); GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; GCC_WARN_UNKNOWN_PRAGMAS = NO; @@ -358,9 +361,8 @@ "-framework", AppKit, ); - PRODUCT_NAME = PeopsXGL; + PRODUCT_NAME = "$(TARGET_NAME)"; SECTORDER_FLAGS = ""; - SYMROOT = ../../build; WRAPPER_EXTENSION = psxplugin; }; name = Release; @@ -374,7 +376,12 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "_MACOSX=1", + "$(DEBUG_PREPROCESSOR_DEFINITIONS)", + ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; GCC_WARN_ABOUT_RETURN_TYPE = YES; @@ -387,7 +394,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.6; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; - SYMROOT = ../../build; VALID_ARCHS = "i386 x86_64"; WARNING_CFLAGS = "-Wall"; }; @@ -402,9 +408,14 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_PREPROCESSOR_DEFINITIONS = ""; GCC_ENABLE_SSE3_EXTENSIONS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = 3; + GCC_PREPROCESSOR_DEFINITIONS = ( + "_MACOSX=1", + "$(DEBUG_PREPROCESSOR_DEFINITIONS)", + ); GCC_UNROLL_LOOPS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; @@ -418,7 +429,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.6; OTHER_CFLAGS = "-fomit-frame-pointer"; SDKROOT = macosx; - SYMROOT = ../../build; VALID_ARCHS = "i386 x86_64"; WARNING_CFLAGS = "-Wall"; }; diff --git a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m index 63efc6a0..02c58366 100755 --- a/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m +++ b/macosx/plugins/PeopsXgl/macsrc/NetSfPeopsOpenGLPluginConfigController.m @@ -11,6 +11,7 @@ #include "menu.h" #include <OpenGL/gl.h> // bah, "externals.h" thinks include files are for wimps; OpenGL header, in fact, is needed #include "externals.h" +#import "ARCBridge.h" #ifdef ENABLE_NLS #include <libintl.h> @@ -59,9 +60,9 @@ void AboutDlgProc() NSString *path = [bundle pathForResource:@"Credits" ofType:@"rtf"]; NSAttributedString *credits; if (path) { - credits = [[[NSAttributedString alloc] initWithPath: path documentAttributes:NULL] autorelease]; + credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithPath: path documentAttributes:NULL]); } else { - credits = [[[NSAttributedString alloc] initWithString:@""] autorelease]; + credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithString:@""]); } // Get Application Icon @@ -113,32 +114,32 @@ void PrepFactoryDefaultPreferences(void) [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:NO], @"FPS Counter", - [NSNumber numberWithBool:NO], @"Auto Full Screen", - [NSNumber numberWithBool:NO], @"Frame Skipping", - [NSNumber numberWithBool:YES], @"Frame Limit", - [NSNumber numberWithBool:NO], @"VSync", - [NSNumber numberWithBool:NO], @"Enable Hacks", - [NSNumber numberWithInt:0], @"Dither Mode", - [NSNumber numberWithUnsignedInt:0], @"Hacks", + @NO, @"FPS Counter", + @NO, @"Auto Full Screen", + @NO, @"Frame Skipping", + @YES, @"Frame Limit", + @NO, @"VSync", + @NO, @"Enable Hacks", + @0, @"Dither Mode", + @((unsigned int)0), @"Hacks", - [NSNumber numberWithBool:YES], @"Proportional Resize", + @YES, @"Proportional Resize", //[NSSize stringWithCString: @"default"], @"Fullscreen Resolution", - [NSNumber numberWithInt:2], @"Offscreen Drawing Level", - [NSNumber numberWithInt:0], @"Texture Color Depth Level", - [NSNumber numberWithInt:0], @"Texture Enhancement Level", - [NSNumber numberWithInt:0], @"Texture Filter Level", - [NSNumber numberWithInt:0], @"Frame Buffer Level", - [NSNumber numberWithBool:NO], @"Draw Scanlines", + @2, @"Offscreen Drawing Level", + @0, @"Texture Color Depth Level", + @0, @"Texture Enhancement Level", + @0, @"Texture Filter Level", + @0, @"Frame Buffer Level", + @NO, @"Draw Scanlines", // nasty: [NSArchiver archivedDataWithRootObject: [NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.25]], @"Scanline Color", - [NSNumber numberWithBool:NO], @"Advanced Blending", - [NSNumber numberWithBool:NO], @"Opaque Pass", - [NSNumber numberWithBool:NO], @"Blur", - [NSNumber numberWithBool:YES], @"Z Mask Clipping", - [NSNumber numberWithBool:NO], @"Wireframe Mode", - [NSNumber numberWithBool:YES], @"Emulate mjpeg decoder", // helps remove unsightly vertical line in movies - [NSNumber numberWithBool:NO], @"Fast mjpeg decoder", + @NO, @"Advanced Blending", + @NO, @"Opaque Pass", + @NO, @"Blur", + @YES, @"Z Mask Clipping", + @NO, @"Wireframe Mode", + @YES, @"Emulate mjpeg decoder", // helps remove unsightly vertical line in movies + @NO, @"Fast mjpeg decoder", nil], PrefsKey, nil]]; } @@ -291,7 +292,7 @@ void ReadConfig(void) keyValues = [NSMutableDictionary dictionaryWithDictionary: [[NSUserDefaults standardUserDefaults] dictionaryForKey:PrefsKey]]; NSMutableDictionary *writeDic = [NSMutableDictionary dictionaryWithDictionary:keyValues]; - [writeDic setObject:[NSNumber numberWithUnsignedInt:hackValues] forKey:@"Hacks"]; + [writeDic setObject:@((unsigned int)hackValues) forKey:@"Hacks"]; // write the preferences with Hacks adjustments [defaults setObject:writeDic forKey:PrefsKey]; diff --git a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h index 657ac2ad..5964a0c0 100755 --- a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h +++ b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.h @@ -34,13 +34,11 @@ } - - (void)swapBuffer; // I wonder what this does ;-) - (void)clearBuffer:(BOOL)display; // overrides: - (id) initWithCoder: (NSCoder *) coder; -- (void)dealloc; - (BOOL)isOpaque; - (BOOL)acceptsFirstResponder; - (void)reshape; diff --git a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m index 483a72d3..85aa636e 100755 --- a/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m +++ b/macosx/plugins/PeopsXgl/macsrc/PluginGLView.m @@ -29,6 +29,8 @@ #include "externals.h" // for PSXDisplay.disable -- should move it elsewhere really #undef BOOL +#import "ARCBridge.h" + @implementation PluginGLView - (BOOL)isOpaque { return YES; } @@ -44,7 +46,7 @@ glLock = [[NSLock alloc] init]; if (nil == glLock) { - [self release]; + AUTORELEASEOBJNORETURN(self); return nil; } @@ -76,12 +78,12 @@ if (!pixFmt) { NSLog(@"No OpenGL pixel format found!\n"); - [self release]; + AUTORELEASEOBJNORETURN(self); return nil; } } - [self setPixelFormat:[pixFmt autorelease]]; + [self setPixelFormat:AUTORELEASEOBJ(pixFmt)]; [[self openGLContext] makeCurrentContext]; @@ -95,6 +97,7 @@ return self; } +#if !__has_feature(objc_arc) - (void)dealloc { [[self openGLContext] makeCurrentContext]; // just in case @@ -102,7 +105,7 @@ [glLock release]; [super dealloc]; } - +#endif - (void)reshape // scrolled, moved or resized { diff --git a/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m b/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m index 5fc97637..55c27785 100755 --- a/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m +++ b/macosx/plugins/PeopsXgl/macsrc/PluginWindowController.m @@ -26,6 +26,7 @@ #include "externals.h" #include "draw.h" // for CreateScanLines() #undef BOOL +#import "ARCBridge.h" // not sure why these aren't class or instance variables... NSWindow *gameWindow; @@ -219,13 +220,12 @@ NSRect FitRectInRect(NSRect source, NSRect destination) - (void)dealloc { - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - - [nc removeObserver:self]; - windowFrame = [[self window] frame]; // huh? - + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [super dealloc]; + [nc removeObserver:self]; + windowFrame = [[self window] frame]; // huh? + + SUPERDEALLOC; } // forget keyDownEvents @@ -346,7 +346,7 @@ NSRect FitRectInRect(NSRect source, NSRect destination) - (BOOL)windowShouldClose:(id)sender { [[NSNotificationCenter defaultCenter] postNotificationName:@"emuWindowDidClose" object:self]; - [gameController autorelease]; + AUTORELEASEOBJNORETURN(gameController); gameController = nil; gameWindow = nil; CGReleaseAllDisplays(); diff --git a/macosx/plugins/PeopsXgl/macsrc/drawgl.m b/macosx/plugins/PeopsXgl/macsrc/drawgl.m index 2ad7b985..953dd239 100755 --- a/macosx/plugins/PeopsXgl/macsrc/drawgl.m +++ b/macosx/plugins/PeopsXgl/macsrc/drawgl.m @@ -29,6 +29,7 @@ #include "gpu.h" #include "menu.h" #include "drawgl.h" +#import "ARCBridge.h" //////////////////////////////////////////////////////////////////////////////////// // misc globals @@ -170,7 +171,7 @@ void CloseDisplay(void) { if (gameController) { [gameController close]; - [gameController release]; + RELEASEOBJ(gameController); gameController = nil; gameWindow = nil; } |
