Added automated test to Xcode project plus needed changes to SDL_RWFromFile to be OS X bundle aware.
The Mac OS X project has a new target called testsdl which builds the automated test. I looked at using Xcode's native unit test support, but the impedance mismatch between the existing automated test structure and Apple's was more than I could handle.
As such, the testsdl application is a full blown proper OS X application, which means it is a self-contained .app bundle. This immediately revealed some problems from the automated test. The largest problem was the assumption about the current working directory and where to find resources. (I suspect Windows may have a similar problem depending on circumstance.) To open resources, the test was looking in directories relative to the SDL source directory, but this will not work well with self-contained .app bundles and Xcode which can place its built applications almost anywhere. And for real-world situations, this is pretty useless anyway.
So I modified SDL_RWFromFile to do special things on OS X. First, it will look for a file in the .app bundle. If not found, it will fallback and just call fopen as it used to do.
I also had to modify the automated test itself because it had a contrieved test which called fopen directly to do read from an existing FILE pointer. In addition, there was a write test. Since a .app bundle is likely going to be read-only, I added a special case for OS X to write to NSTemporaryDirectory.
I expect these changes should work for both Mac and iPhone OS (which includes iPad).
I will update the iPhone Xcode project next.
Finally, FYI, the X11 automated test seems to be failing. Below is my output.
Pending breakpoint 4 - "-[NSException raise]" resolved
Platform : All tests successful (2)
SDL_RWops : All tests successful (5)
Rect : All tests successful (1)
SDL_Surface : All tests successful (6)
Rendering with cocoa driver : All tests successful (3)
Assert Failed!
Blit output not the same.
Test Case 'Renderer x11'
Test Suite 'Rendering with x11 driver'
Last SDL error ''
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetWindowBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSGetSurfaceBounds
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Sat May 8 00:30:34 iMacAL.local testsdl[71586] <Error>: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0xa150
Rendering with x11 driver : Failed 1 out of 4 testcases!
Rendering with dummy driver : All tests successful (3)
SDL_Audio : All tests successful (1)
Tests run with SDL 1.3.0 revision 1095906
System is running Mac OS X and is little endian
1.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj Sun May 02 05:08:12 2010 -0400
1.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj Sat May 08 00:54:22 2010 -0700
1.3 @@ -104,6 +104,21 @@
1.4 002F32E509CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */; };
1.5 002F32E709CA0BF600EBEB88 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */; };
1.6 002F32E809CA0BF600EBEB88 /* SDL_dummyaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */; };
1.7 + 006E94A3119511A1001DE610 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E949C119511A1001DE610 /* icon.bmp */; };
1.8 + 006E94A4119511A1001DE610 /* moose.dat in Resources */ = {isa = PBXBuildFile; fileRef = 006E949D119511A1001DE610 /* moose.dat */; };
1.9 + 006E94A5119511A1001DE610 /* picture.xbm in Resources */ = {isa = PBXBuildFile; fileRef = 006E949E119511A1001DE610 /* picture.xbm */; };
1.10 + 006E94A6119511A1001DE610 /* sail.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E949F119511A1001DE610 /* sail.bmp */; };
1.11 + 006E94A7119511A1001DE610 /* sample.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E94A0119511A1001DE610 /* sample.bmp */; };
1.12 + 006E94A8119511A1001DE610 /* sample.wav in Resources */ = {isa = PBXBuildFile; fileRef = 006E94A1119511A1001DE610 /* sample.wav */; };
1.13 + 006E94A9119511A1001DE610 /* utf8.txt in Resources */ = {isa = PBXBuildFile; fileRef = 006E94A2119511A1001DE610 /* utf8.txt */; };
1.14 + 006E94BC11951217001DE610 /* read in Copy rwops */ = {isa = PBXBuildFile; fileRef = 00D8DA121195093100638393 /* read */; };
1.15 + 006E94EF11951255001DE610 /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BECDF66C0761BA81005FE872 /* SDL.framework */; };
1.16 + 006E94F01195125B001DE610 /* SDL.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = BECDF66C0761BA81005FE872 /* SDL.framework */; };
1.17 + 006E95B011952992001DE610 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 006E95AE11952992001DE610 /* SDL_rwopsbundlesupport.h */; };
1.18 + 006E95B111952992001DE610 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 006E95AF11952992001DE610 /* SDL_rwopsbundlesupport.m */; };
1.19 + 006E95B211952992001DE610 /* SDL_rwopsbundlesupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 006E95AE11952992001DE610 /* SDL_rwopsbundlesupport.h */; };
1.20 + 006E95B311952992001DE610 /* SDL_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 006E95AF11952992001DE610 /* SDL_rwopsbundlesupport.m */; };
1.21 + 006E95F711952D6E001DE610 /* Test_rwopsbundlesupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 006E95F611952D6E001DE610 /* Test_rwopsbundlesupport.m */; };
1.22 007317A20858DECD00B2BC32 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */; };
1.23 007317A30858DECD00B2BC32 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179C0858DECD00B2BC32 /* AudioUnit.framework */; };
1.24 007317A40858DECD00B2BC32 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0073179D0858DECD00B2BC32 /* Cocoa.framework */; };
1.25 @@ -414,6 +429,15 @@
1.26 00CFA89D106B4BA100758660 /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00CFA89C106B4BA100758660 /* ForceFeedback.framework */; };
1.27 00D0D08410675DD9004B05EF /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D0D08310675DD9004B05EF /* CoreFoundation.framework */; };
1.28 00D0D0D810675E46004B05EF /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 007317C10858E15000B2BC32 /* Carbon.framework */; };
1.29 + 00D8DA1B1195093100638393 /* audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8D9FC1195093100638393 /* audio.c */; };
1.30 + 00D8DA1C1195093100638393 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8D9FF1195093100638393 /* common.c */; };
1.31 + 00D8DA221195093100638393 /* platform.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA081195093100638393 /* platform.c */; };
1.32 + 00D8DA241195093100638393 /* rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA0C1195093100638393 /* rect.c */; };
1.33 + 00D8DA251195093100638393 /* render.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA0F1195093100638393 /* render.c */; };
1.34 + 00D8DA271195093100638393 /* rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA131195093100638393 /* rwops.c */; };
1.35 + 00D8DA281195093100638393 /* SDL_at.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA151195093100638393 /* SDL_at.c */; };
1.36 + 00D8DA291195093100638393 /* surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA181195093100638393 /* surface.c */; };
1.37 + 00D8DA2A1195093100638393 /* testsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA1A1195093100638393 /* testsdl.c */; };
1.38 046B91EC0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; };
1.39 046B91ED0A11B53500FB151C /* SDL_sysloadso.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B91E90A11B53500FB151C /* SDL_sysloadso.c */; };
1.40 046B92130A11B8AD00FB151C /* SDL_dlcompat.c in Sources */ = {isa = PBXBuildFile; fileRef = 046B92100A11B8AD00FB151C /* SDL_dlcompat.c */; };
1.41 @@ -491,6 +515,13 @@
1.42 remoteGlobalIDString = 0083103F1072EA5700A531F1;
1.43 remoteInfo = "Generate Doxygen DocSet";
1.44 };
1.45 + 00D8DA2E1195094500638393 /* PBXContainerItemProxy */ = {
1.46 + isa = PBXContainerItemProxy;
1.47 + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
1.48 + proxyType = 1;
1.49 + remoteGlobalIDString = BECDF5FE0761BA81005FE872;
1.50 + remoteInfo = Framework;
1.51 + };
1.52 BECDF6C50761BA81005FE872 /* PBXContainerItemProxy */ = {
1.53 isa = PBXContainerItemProxy;
1.54 containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
1.55 @@ -500,6 +531,31 @@
1.56 };
1.57 /* End PBXContainerItemProxy section */
1.58
1.59 +/* Begin PBXCopyFilesBuildPhase section */
1.60 + 006E9491119510E1001DE610 /* Copy Frameworks */ = {
1.61 + isa = PBXCopyFilesBuildPhase;
1.62 + buildActionMask = 2147483647;
1.63 + dstPath = "";
1.64 + dstSubfolderSpec = 10;
1.65 + files = (
1.66 + 006E94F01195125B001DE610 /* SDL.framework in Copy Frameworks */,
1.67 + );
1.68 + name = "Copy Frameworks";
1.69 + runOnlyForDeploymentPostprocessing = 0;
1.70 + };
1.71 + 006E94B3119511CE001DE610 /* Copy rwops */ = {
1.72 + isa = PBXCopyFilesBuildPhase;
1.73 + buildActionMask = 2147483647;
1.74 + dstPath = rwops;
1.75 + dstSubfolderSpec = 7;
1.76 + files = (
1.77 + 006E94BC11951217001DE610 /* read in Copy rwops */,
1.78 + );
1.79 + name = "Copy rwops";
1.80 + runOnlyForDeploymentPostprocessing = 0;
1.81 + };
1.82 +/* End PBXCopyFilesBuildPhase section */
1.83 +
1.84 /* Begin PBXFileReference section */
1.85 00162D3409BD1FA90037C8D0 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config_macosx.h; path = ../../include/SDL_config_macosx.h; sourceTree = SOURCE_ROOT; };
1.86 00162D3709BD1FA90037C8D0 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_config.h; path = ../../include/SDL_config.h; sourceTree = SOURCE_ROOT; };
1.87 @@ -524,6 +580,17 @@
1.88 002F32D509CA0BE700EBEB88 /* SDL_diskaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_diskaudio.h; sourceTree = "<group>"; };
1.89 002F32E209CA0BF600EBEB88 /* SDL_dummyaudio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_dummyaudio.c; sourceTree = "<group>"; };
1.90 002F32E309CA0BF600EBEB88 /* SDL_dummyaudio.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_dummyaudio.h; sourceTree = "<group>"; };
1.91 + 006E949C119511A1001DE610 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; };
1.92 + 006E949D119511A1001DE610 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; };
1.93 + 006E949E119511A1001DE610 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; };
1.94 + 006E949F119511A1001DE610 /* sail.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sail.bmp; path = ../../test/sail.bmp; sourceTree = SOURCE_ROOT; };
1.95 + 006E94A0119511A1001DE610 /* sample.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = sample.bmp; path = ../../test/sample.bmp; sourceTree = SOURCE_ROOT; };
1.96 + 006E94A1119511A1001DE610 /* sample.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = sample.wav; path = ../../test/sample.wav; sourceTree = SOURCE_ROOT; };
1.97 + 006E94A2119511A1001DE610 /* utf8.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = utf8.txt; path = ../../test/utf8.txt; sourceTree = SOURCE_ROOT; };
1.98 + 006E95AE11952992001DE610 /* SDL_rwopsbundlesupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_rwopsbundlesupport.h; sourceTree = "<group>"; };
1.99 + 006E95AF11952992001DE610 /* SDL_rwopsbundlesupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_rwopsbundlesupport.m; sourceTree = "<group>"; };
1.100 + 006E95F511952D6E001DE610 /* Test_rwopsbundlesupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test_rwopsbundlesupport.h; sourceTree = "<group>"; };
1.101 + 006E95F611952D6E001DE610 /* Test_rwopsbundlesupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Test_rwopsbundlesupport.m; sourceTree = "<group>"; };
1.102 0073179B0858DECD00B2BC32 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
1.103 0073179C0858DECD00B2BC32 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
1.104 0073179D0858DECD00B2BC32 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1.105 @@ -685,6 +752,34 @@
1.106 00CFA817106B49B600758660 /* SDL_yuv_sw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_yuv_sw.c; sourceTree = "<group>"; };
1.107 00CFA89C106B4BA100758660 /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; };
1.108 00D0D08310675DD9004B05EF /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
1.109 + 00D8D92E1194EC8500638393 /* UnitTestBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UnitTestBundle-Info.plist"; sourceTree = "<group>"; };
1.110 + 00D8D9EF1195090700638393 /* testsdl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsdl.app; sourceTree = BUILT_PRODUCTS_DIR; };
1.111 + 00D8D9F11195090700638393 /* testsdl-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testsdl-Info.plist"; sourceTree = "<group>"; };
1.112 + 00D8D9FC1195093100638393 /* audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = audio.c; sourceTree = "<group>"; };
1.113 + 00D8D9FD1195093100638393 /* audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audio.h; sourceTree = "<group>"; };
1.114 + 00D8D9FF1195093100638393 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = "<group>"; };
1.115 + 00D8DA001195093100638393 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
1.116 + 00D8DA011195093100638393 /* images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = images.h; sourceTree = "<group>"; };
1.117 + 00D8DA021195093100638393 /* img_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blit.c; sourceTree = "<group>"; };
1.118 + 00D8DA031195093100638393 /* img_blitblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blitblend.c; sourceTree = "<group>"; };
1.119 + 00D8DA041195093100638393 /* img_face.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_face.c; sourceTree = "<group>"; };
1.120 + 00D8DA051195093100638393 /* img_primitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitives.c; sourceTree = "<group>"; };
1.121 + 00D8DA061195093100638393 /* img_primitivesblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitivesblend.c; sourceTree = "<group>"; };
1.122 + 00D8DA081195093100638393 /* platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = platform.c; sourceTree = "<group>"; };
1.123 + 00D8DA091195093100638393 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = "<group>"; };
1.124 + 00D8DA0A1195093100638393 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README; path = ../../test/automated/README; sourceTree = SOURCE_ROOT; };
1.125 + 00D8DA0C1195093100638393 /* rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rect.c; sourceTree = "<group>"; };
1.126 + 00D8DA0D1195093100638393 /* rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rect.h; sourceTree = "<group>"; };
1.127 + 00D8DA0F1195093100638393 /* render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = render.c; sourceTree = "<group>"; };
1.128 + 00D8DA101195093100638393 /* render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render.h; sourceTree = "<group>"; };
1.129 + 00D8DA121195093100638393 /* read */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = read; sourceTree = "<group>"; };
1.130 + 00D8DA131195093100638393 /* rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rwops.c; sourceTree = "<group>"; };
1.131 + 00D8DA141195093100638393 /* rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rwops.h; sourceTree = "<group>"; };
1.132 + 00D8DA151195093100638393 /* SDL_at.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_at.c; path = ../../test/automated/SDL_at.c; sourceTree = SOURCE_ROOT; };
1.133 + 00D8DA161195093100638393 /* SDL_at.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_at.h; path = ../../test/automated/SDL_at.h; sourceTree = SOURCE_ROOT; };
1.134 + 00D8DA181195093100638393 /* surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = surface.c; sourceTree = "<group>"; };
1.135 + 00D8DA191195093100638393 /* surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surface.h; sourceTree = "<group>"; };
1.136 + 00D8DA1A1195093100638393 /* testsdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsdl.c; path = ../../test/automated/testsdl.c; sourceTree = SOURCE_ROOT; };
1.137 00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = UniversalBinaryNotes.rtf; sourceTree = "<group>"; };
1.138 01538330006D78D67F000001 /* SDL_audio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audio.c; sourceTree = "<group>"; };
1.139 01538331006D78D67F000001 /* SDL_audiocvt.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_audiocvt.c; sourceTree = "<group>"; };
1.140 @@ -755,6 +850,14 @@
1.141 /* End PBXFileReference section */
1.142
1.143 /* Begin PBXFrameworksBuildPhase section */
1.144 + 00D8D9ED1195090700638393 /* Frameworks */ = {
1.145 + isa = PBXFrameworksBuildPhase;
1.146 + buildActionMask = 2147483647;
1.147 + files = (
1.148 + 006E94EF11951255001DE610 /* SDL.framework in Frameworks */,
1.149 + );
1.150 + runOnlyForDeploymentPostprocessing = 0;
1.151 + };
1.152 BECDF6680761BA81005FE872 /* Frameworks */ = {
1.153 isa = PBXFrameworksBuildPhase;
1.154 buildActionMask = 2147483647;
1.155 @@ -869,6 +972,29 @@
1.156 path = dummy;
1.157 sourceTree = "<group>";
1.158 };
1.159 + 006E949B11951160001DE610 /* TestResources */ = {
1.160 + isa = PBXGroup;
1.161 + children = (
1.162 + 006E949C119511A1001DE610 /* icon.bmp */,
1.163 + 006E949D119511A1001DE610 /* moose.dat */,
1.164 + 006E949E119511A1001DE610 /* picture.xbm */,
1.165 + 006E949F119511A1001DE610 /* sail.bmp */,
1.166 + 006E94A0119511A1001DE610 /* sample.bmp */,
1.167 + 006E94A1119511A1001DE610 /* sample.wav */,
1.168 + 006E94A2119511A1001DE610 /* utf8.txt */,
1.169 + );
1.170 + name = TestResources;
1.171 + sourceTree = "<group>";
1.172 + };
1.173 + 006E95AD11952992001DE610 /* cocoa */ = {
1.174 + isa = PBXGroup;
1.175 + children = (
1.176 + 006E95AE11952992001DE610 /* SDL_rwopsbundlesupport.h */,
1.177 + 006E95AF11952992001DE610 /* SDL_rwopsbundlesupport.m */,
1.178 + );
1.179 + path = cocoa;
1.180 + sourceTree = "<group>";
1.181 + };
1.182 00CFA69B106B467B00758660 /* atomic */ = {
1.183 isa = PBXGroup;
1.184 children = (
1.185 @@ -1063,6 +1189,103 @@
1.186 path = macosx;
1.187 sourceTree = "<group>";
1.188 };
1.189 + 00D8D9FA1195091500638393 /* AutomatedTests */ = {
1.190 + isa = PBXGroup;
1.191 + children = (
1.192 + 00D8D9FB1195093100638393 /* audio */,
1.193 + 00D8D9FE1195093100638393 /* common */,
1.194 + 00D8DA071195093100638393 /* platform */,
1.195 + 00D8DA0A1195093100638393 /* README */,
1.196 + 00D8DA0B1195093100638393 /* rect */,
1.197 + 00D8DA0E1195093100638393 /* render */,
1.198 + 00D8DA111195093100638393 /* rwops */,
1.199 + 00D8DA151195093100638393 /* SDL_at.c */,
1.200 + 00D8DA161195093100638393 /* SDL_at.h */,
1.201 + 00D8DA171195093100638393 /* surface */,
1.202 + 00D8DA1A1195093100638393 /* testsdl.c */,
1.203 + );
1.204 + name = AutomatedTests;
1.205 + sourceTree = "<group>";
1.206 + };
1.207 + 00D8D9FB1195093100638393 /* audio */ = {
1.208 + isa = PBXGroup;
1.209 + children = (
1.210 + 00D8D9FC1195093100638393 /* audio.c */,
1.211 + 00D8D9FD1195093100638393 /* audio.h */,
1.212 + );
1.213 + name = audio;
1.214 + path = ../../test/automated/audio;
1.215 + sourceTree = SOURCE_ROOT;
1.216 + };
1.217 + 00D8D9FE1195093100638393 /* common */ = {
1.218 + isa = PBXGroup;
1.219 + children = (
1.220 + 00D8D9FF1195093100638393 /* common.c */,
1.221 + 00D8DA001195093100638393 /* common.h */,
1.222 + 00D8DA011195093100638393 /* images.h */,
1.223 + 00D8DA021195093100638393 /* img_blit.c */,
1.224 + 00D8DA031195093100638393 /* img_blitblend.c */,
1.225 + 00D8DA041195093100638393 /* img_face.c */,
1.226 + 00D8DA051195093100638393 /* img_primitives.c */,
1.227 + 00D8DA061195093100638393 /* img_primitivesblend.c */,
1.228 + );
1.229 + name = common;
1.230 + path = ../../test/automated/common;
1.231 + sourceTree = SOURCE_ROOT;
1.232 + };
1.233 + 00D8DA071195093100638393 /* platform */ = {
1.234 + isa = PBXGroup;
1.235 + children = (
1.236 + 00D8DA081195093100638393 /* platform.c */,
1.237 + 00D8DA091195093100638393 /* platform.h */,
1.238 + );
1.239 + name = platform;
1.240 + path = ../../test/automated/platform;
1.241 + sourceTree = SOURCE_ROOT;
1.242 + };
1.243 + 00D8DA0B1195093100638393 /* rect */ = {
1.244 + isa = PBXGroup;
1.245 + children = (
1.246 + 00D8DA0C1195093100638393 /* rect.c */,
1.247 + 00D8DA0D1195093100638393 /* rect.h */,
1.248 + );
1.249 + name = rect;
1.250 + path = ../../test/automated/rect;
1.251 + sourceTree = SOURCE_ROOT;
1.252 + };
1.253 + 00D8DA0E1195093100638393 /* render */ = {
1.254 + isa = PBXGroup;
1.255 + children = (
1.256 + 00D8DA0F1195093100638393 /* render.c */,
1.257 + 00D8DA101195093100638393 /* render.h */,
1.258 + );
1.259 + name = render;
1.260 + path = ../../test/automated/render;
1.261 + sourceTree = SOURCE_ROOT;
1.262 + };
1.263 + 00D8DA111195093100638393 /* rwops */ = {
1.264 + isa = PBXGroup;
1.265 + children = (
1.266 + 006E95F511952D6E001DE610 /* Test_rwopsbundlesupport.h */,
1.267 + 006E95F611952D6E001DE610 /* Test_rwopsbundlesupport.m */,
1.268 + 00D8DA121195093100638393 /* read */,
1.269 + 00D8DA131195093100638393 /* rwops.c */,
1.270 + 00D8DA141195093100638393 /* rwops.h */,
1.271 + );
1.272 + name = rwops;
1.273 + path = ../../test/automated/rwops;
1.274 + sourceTree = SOURCE_ROOT;
1.275 + };
1.276 + 00D8DA171195093100638393 /* surface */ = {
1.277 + isa = PBXGroup;
1.278 + children = (
1.279 + 00D8DA181195093100638393 /* surface.c */,
1.280 + 00D8DA191195093100638393 /* surface.h */,
1.281 + );
1.282 + name = surface;
1.283 + path = ../../test/automated/surface;
1.284 + sourceTree = SOURCE_ROOT;
1.285 + };
1.286 0153832C006D78D67F000001 /* audio */ = {
1.287 isa = PBXGroup;
1.288 children = (
1.289 @@ -1108,6 +1331,7 @@
1.290 01538376006D79307F000001 /* file */ = {
1.291 isa = PBXGroup;
1.292 children = (
1.293 + 006E95AD11952992001DE610 /* cocoa */,
1.294 01538377006D79307F000001 /* SDL_rwops.c */,
1.295 );
1.296 name = file;
1.297 @@ -1249,6 +1473,7 @@
1.298 BECDF6B30761BA81005FE872 /* libSDL.a */,
1.299 BECDF6BE0761BA81005FE872 /* Standard DMG */,
1.300 BECDF6C30761BA81005FE872 /* Developer Extras Package */,
1.301 + 00D8D9EF1195090700638393 /* testsdl.app */,
1.302 );
1.303 name = Products;
1.304 sourceTree = "<group>";
1.305 @@ -1279,9 +1504,13 @@
1.306 F59C70FC00D5CB5801000001 /* pkg-support */,
1.307 0153844A006D81B07F000001 /* Public Headers */,
1.308 08FB77ACFE841707C02AAC07 /* Library Source */,
1.309 + 00D8D9FA1195091500638393 /* AutomatedTests */,
1.310 + 006E949B11951160001DE610 /* TestResources */,
1.311 034768DDFF38A45A11DB9C8B /* Products */,
1.312 BECDF66B0761BA81005FE872 /* Info-Framework.plist */,
1.313 BEC562FE0761C0E800A33029 /* Linked Frameworks */,
1.314 + 00D8D92E1194EC8500638393 /* UnitTestBundle-Info.plist */,
1.315 + 00D8D9F11195090700638393 /* testsdl-Info.plist */,
1.316 );
1.317 comments = "To build Universal Binaries, we have experimented with a variety of different options.\nThe complication is that we must retain compatibility with at least 10.2. \nThe Universal Binary defaults only work for > 10.3.9\n\nSo far, we have found:\ngcc 4.0.0 with Xcode 2.1 always links against libgcc_s. gcc 4.0.1 from Xcode 2.2 fixes this problem.\n\nBut gcc 4.0 will not work with < 10.3.9 because we continue to get an undefined symbol to _fprintf$LDBL128.\nSo we must use gcc 3.3 on PPC to accomplish 10.2 support. (But 4.0 is required for i386.)\n\nSetting the deployment target to 10.4 will disable prebinding, so for PPC, we set it less than 10.4 to preserve prebinding for legacy support.\n\nSetting the PPC SDKROOT to /Developers/SDKs/MacOSX10.2.8.sdk will link to 63.0.0 libSystem.B.dylib. Leaving it at current or 10.4u links to 88.1.2. However, as long as we are using gcc 3.3, it doesn't seem to matter as testing has demonstrated both will run. We have decided not to invoke the 10.2.8 SDK because it is not a default installed component with Xcode which will probably cause most people problems. However, rather than deleting the SDKROOT_ppc entry entirely, we have mapped it to 10.4u in case we decide we need to change this setting.\n\nTo use Altivec or SSE, we needed architecture specific flags:\nOTHER_CFLAGS_ppc\nOTHER_CFLAGS_i386\nOTHER_CFLAGS=$(OTHER_CFLAGS_($CURRENT_ARCH))\n\nThe general OTHER_CFLAGS needed to be manually mapped to architecture specific options because Xcode didn't do this automatically for us.\n\n\n";
1.318 name = SDLFramework;
1.319 @@ -1515,6 +1744,7 @@
1.320 00CFA844106B49B600758660 /* SDL_yuv_sw_c.h in Headers */,
1.321 00A6EBDA1078D569001EEA06 /* SDL_revision.h in Headers */,
1.322 04F2AF691104AC4500D6DDF7 /* SDL_assert.h in Headers */,
1.323 + 006E95B011952992001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
1.324 );
1.325 runOnlyForDeploymentPostprocessing = 0;
1.326 };
1.327 @@ -1614,12 +1844,33 @@
1.328 00CFA872106B49B600758660 /* SDL_yuv_sw_c.h in Headers */,
1.329 00A6EBDB1078D569001EEA06 /* SDL_revision.h in Headers */,
1.330 04F2AF6A1104AC4500D6DDF7 /* SDL_assert.h in Headers */,
1.331 + 006E95B211952992001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
1.332 );
1.333 runOnlyForDeploymentPostprocessing = 0;
1.334 };
1.335 /* End PBXHeadersBuildPhase section */
1.336
1.337 /* Begin PBXNativeTarget section */
1.338 + 00D8D9EE1195090700638393 /* testsdl */ = {
1.339 + isa = PBXNativeTarget;
1.340 + buildConfigurationList = 00D8D9F71195090900638393 /* Build configuration list for PBXNativeTarget "testsdl" */;
1.341 + buildPhases = (
1.342 + 00D8D9EB1195090700638393 /* Resources */,
1.343 + 00D8D9EC1195090700638393 /* Sources */,
1.344 + 00D8D9ED1195090700638393 /* Frameworks */,
1.345 + 006E9491119510E1001DE610 /* Copy Frameworks */,
1.346 + 006E94B3119511CE001DE610 /* Copy rwops */,
1.347 + );
1.348 + buildRules = (
1.349 + );
1.350 + dependencies = (
1.351 + 00D8DA2F1195094500638393 /* PBXTargetDependency */,
1.352 + );
1.353 + name = testsdl;
1.354 + productName = testsdl;
1.355 + productReference = 00D8D9EF1195090700638393 /* testsdl.app */;
1.356 + productType = "com.apple.product-type.application";
1.357 + };
1.358 BECDF5FE0761BA81005FE872 /* Framework */ = {
1.359 isa = PBXNativeTarget;
1.360 buildConfigurationList = 0073177A0858DB0500B2BC32 /* Build configuration list for PBXNativeTarget "Framework" */;
1.361 @@ -1715,11 +1966,26 @@
1.362 BECDF6C00761BA81005FE872 /* Developer Extras Package */,
1.363 002D2A9E106C18E700BF972E /* Generate Header Files */,
1.364 0083103F1072EA5700A531F1 /* Generate Doxygen DocSet */,
1.365 + 00D8D9EE1195090700638393 /* testsdl */,
1.366 );
1.367 };
1.368 /* End PBXProject section */
1.369
1.370 /* Begin PBXResourcesBuildPhase section */
1.371 + 00D8D9EB1195090700638393 /* Resources */ = {
1.372 + isa = PBXResourcesBuildPhase;
1.373 + buildActionMask = 2147483647;
1.374 + files = (
1.375 + 006E94A3119511A1001DE610 /* icon.bmp in Resources */,
1.376 + 006E94A4119511A1001DE610 /* moose.dat in Resources */,
1.377 + 006E94A5119511A1001DE610 /* picture.xbm in Resources */,
1.378 + 006E94A6119511A1001DE610 /* sail.bmp in Resources */,
1.379 + 006E94A7119511A1001DE610 /* sample.bmp in Resources */,
1.380 + 006E94A8119511A1001DE610 /* sample.wav in Resources */,
1.381 + 006E94A9119511A1001DE610 /* utf8.txt in Resources */,
1.382 + );
1.383 + runOnlyForDeploymentPostprocessing = 0;
1.384 + };
1.385 BECDF62A0761BA81005FE872 /* Resources */ = {
1.386 isa = PBXResourcesBuildPhase;
1.387 buildActionMask = 2147483647;
1.388 @@ -1771,7 +2037,7 @@
1.389 );
1.390 runOnlyForDeploymentPostprocessing = 0;
1.391 shellPath = /bin/sh;
1.392 - shellScript = "sh ../../build-scripts/updaterev.sh";
1.393 + shellScript = "# The underlying scripts require calling hg to get revision info.\n# Since hg may not be in the standard Xcode path, I am sourcing .bashrc\n# But I don't know what to do if people are using other shells.\nsource ~/.bashrc\nsh ../../build-scripts/updaterev.sh\n";
1.394 };
1.395 0083103E1072EA5700A531F1 /* ShellScript */ = {
1.396 isa = PBXShellScriptBuildPhase;
1.397 @@ -1808,6 +2074,23 @@
1.398 /* End PBXShellScriptBuildPhase section */
1.399
1.400 /* Begin PBXSourcesBuildPhase section */
1.401 + 00D8D9EC1195090700638393 /* Sources */ = {
1.402 + isa = PBXSourcesBuildPhase;
1.403 + buildActionMask = 2147483647;
1.404 + files = (
1.405 + 00D8DA1B1195093100638393 /* audio.c in Sources */,
1.406 + 00D8DA1C1195093100638393 /* common.c in Sources */,
1.407 + 00D8DA221195093100638393 /* platform.c in Sources */,
1.408 + 00D8DA241195093100638393 /* rect.c in Sources */,
1.409 + 00D8DA251195093100638393 /* render.c in Sources */,
1.410 + 00D8DA271195093100638393 /* rwops.c in Sources */,
1.411 + 00D8DA281195093100638393 /* SDL_at.c in Sources */,
1.412 + 00D8DA291195093100638393 /* surface.c in Sources */,
1.413 + 00D8DA2A1195093100638393 /* testsdl.c in Sources */,
1.414 + 006E95F711952D6E001DE610 /* Test_rwopsbundlesupport.m in Sources */,
1.415 + );
1.416 + runOnlyForDeploymentPostprocessing = 0;
1.417 + };
1.418 BECDF62C0761BA81005FE872 /* Sources */ = {
1.419 isa = PBXSourcesBuildPhase;
1.420 buildActionMask = 2147483647;
1.421 @@ -1920,6 +2203,7 @@
1.422 04DB838C10FD8C81000519B5 /* SDL_blendfillrect.c in Sources */,
1.423 04DB838D10FD8C81000519B5 /* SDL_drawrect.c in Sources */,
1.424 04F2AF661104AC0800D6DDF7 /* SDL_assert.c in Sources */,
1.425 + 006E95B111952992001DE610 /* SDL_rwopsbundlesupport.m in Sources */,
1.426 );
1.427 runOnlyForDeploymentPostprocessing = 0;
1.428 };
1.429 @@ -2035,6 +2319,7 @@
1.430 04DB838E10FD8C81000519B5 /* SDL_blendfillrect.c in Sources */,
1.431 04DB838F10FD8C81000519B5 /* SDL_drawrect.c in Sources */,
1.432 04F2AF671104AC0800D6DDF7 /* SDL_assert.c in Sources */,
1.433 + 006E95B311952992001DE610 /* SDL_rwopsbundlesupport.m in Sources */,
1.434 );
1.435 runOnlyForDeploymentPostprocessing = 0;
1.436 };
1.437 @@ -2056,6 +2341,11 @@
1.438 target = 0083103F1072EA5700A531F1 /* Generate Doxygen DocSet */;
1.439 targetProxy = 008310451072EA9000A531F1 /* PBXContainerItemProxy */;
1.440 };
1.441 + 00D8DA2F1195094500638393 /* PBXTargetDependency */ = {
1.442 + isa = PBXTargetDependency;
1.443 + target = BECDF5FE0761BA81005FE872 /* Framework */;
1.444 + targetProxy = 00D8DA2E1195094500638393 /* PBXContainerItemProxy */;
1.445 + };
1.446 BECDF6C60761BA81005FE872 /* PBXTargetDependency */ = {
1.447 isa = PBXTargetDependency;
1.448 target = BECDF5FE0761BA81005FE872 /* Framework */;
1.449 @@ -2594,6 +2884,106 @@
1.450 };
1.451 name = Development_native_only;
1.452 };
1.453 + 00D8D9F21195090800638393 /* Deployment_for_official_releases_using_10.4SDK_and_10.6SDK */ = {
1.454 + isa = XCBuildConfiguration;
1.455 + buildSettings = {
1.456 + ALWAYS_SEARCH_USER_PATHS = NO;
1.457 + GCC_ENABLE_FIX_AND_CONTINUE = YES;
1.458 + GCC_MODEL_TUNING = G5;
1.459 + GCC_PRECOMPILE_PREFIX_HEADER = NO;
1.460 + INFOPLIST_FILE = "testsdl-Info.plist";
1.461 + INSTALL_PATH = "$(HOME)/Applications";
1.462 + OTHER_LDFLAGS = (
1.463 + "-framework",
1.464 + Foundation,
1.465 + "-framework",
1.466 + AppKit,
1.467 + );
1.468 + PREBINDING = NO;
1.469 + PRODUCT_NAME = testsdl;
1.470 + };
1.471 + name = Deployment_for_official_releases_using_10.4SDK_and_10.6SDK;
1.472 + };
1.473 + 00D8D9F31195090800638393 /* Development_using_10.4SDK_and_10.6SDK */ = {
1.474 + isa = XCBuildConfiguration;
1.475 + buildSettings = {
1.476 + ALWAYS_SEARCH_USER_PATHS = NO;
1.477 + GCC_ENABLE_FIX_AND_CONTINUE = YES;
1.478 + GCC_MODEL_TUNING = G5;
1.479 + GCC_PRECOMPILE_PREFIX_HEADER = NO;
1.480 + INFOPLIST_FILE = "testsdl-Info.plist";
1.481 + INSTALL_PATH = "$(HOME)/Applications";
1.482 + OTHER_LDFLAGS = (
1.483 + "-framework",
1.484 + Foundation,
1.485 + "-framework",
1.486 + AppKit,
1.487 + );
1.488 + PREBINDING = NO;
1.489 + PRODUCT_NAME = testsdl;
1.490 + };
1.491 + name = Development_using_10.4SDK_and_10.6SDK;
1.492 + };
1.493 + 00D8D9F41195090800638393 /* Development_native_only */ = {
1.494 + isa = XCBuildConfiguration;
1.495 + buildSettings = {
1.496 + ALWAYS_SEARCH_USER_PATHS = NO;
1.497 + GCC_ENABLE_FIX_AND_CONTINUE = YES;
1.498 + GCC_MODEL_TUNING = G5;
1.499 + GCC_PRECOMPILE_PREFIX_HEADER = NO;
1.500 + INFOPLIST_FILE = "testsdl-Info.plist";
1.501 + INSTALL_PATH = "$(HOME)/Applications";
1.502 + OTHER_LDFLAGS = (
1.503 + "-framework",
1.504 + Foundation,
1.505 + "-framework",
1.506 + AppKit,
1.507 + );
1.508 + PREBINDING = NO;
1.509 + PRODUCT_NAME = testsdl;
1.510 + };
1.511 + name = Development_native_only;
1.512 + };
1.513 + 00D8D9F51195090800638393 /* Deployment_native_only */ = {
1.514 + isa = XCBuildConfiguration;
1.515 + buildSettings = {
1.516 + ALWAYS_SEARCH_USER_PATHS = NO;
1.517 + GCC_ENABLE_FIX_AND_CONTINUE = YES;
1.518 + GCC_MODEL_TUNING = G5;
1.519 + GCC_PRECOMPILE_PREFIX_HEADER = NO;
1.520 + INFOPLIST_FILE = "testsdl-Info.plist";
1.521 + INSTALL_PATH = "$(HOME)/Applications";
1.522 + OTHER_LDFLAGS = (
1.523 + "-framework",
1.524 + Foundation,
1.525 + "-framework",
1.526 + AppKit,
1.527 + );
1.528 + PREBINDING = NO;
1.529 + PRODUCT_NAME = testsdl;
1.530 + };
1.531 + name = Deployment_native_only;
1.532 + };
1.533 + 00D8D9F61195090800638393 /* Default */ = {
1.534 + isa = XCBuildConfiguration;
1.535 + buildSettings = {
1.536 + ALWAYS_SEARCH_USER_PATHS = NO;
1.537 + GCC_ENABLE_FIX_AND_CONTINUE = YES;
1.538 + GCC_MODEL_TUNING = G5;
1.539 + GCC_PRECOMPILE_PREFIX_HEADER = NO;
1.540 + INFOPLIST_FILE = "testsdl-Info.plist";
1.541 + INSTALL_PATH = "$(HOME)/Applications";
1.542 + OTHER_LDFLAGS = (
1.543 + "-framework",
1.544 + Foundation,
1.545 + "-framework",
1.546 + AppKit,
1.547 + );
1.548 + PREBINDING = NO;
1.549 + PRODUCT_NAME = testsdl;
1.550 + };
1.551 + name = Default;
1.552 + };
1.553 /* End XCBuildConfiguration section */
1.554
1.555 /* Begin XCConfigurationList section */
1.556 @@ -2681,6 +3071,18 @@
1.557 defaultConfigurationIsVisible = 0;
1.558 defaultConfigurationName = Default;
1.559 };
1.560 + 00D8D9F71195090900638393 /* Build configuration list for PBXNativeTarget "testsdl" */ = {
1.561 + isa = XCConfigurationList;
1.562 + buildConfigurations = (
1.563 + 00D8D9F21195090800638393 /* Deployment_for_official_releases_using_10.4SDK_and_10.6SDK */,
1.564 + 00D8D9F31195090800638393 /* Development_using_10.4SDK_and_10.6SDK */,
1.565 + 00D8D9F41195090800638393 /* Development_native_only */,
1.566 + 00D8D9F51195090800638393 /* Deployment_native_only */,
1.567 + 00D8D9F61195090800638393 /* Default */,
1.568 + );
1.569 + defaultConfigurationIsVisible = 0;
1.570 + defaultConfigurationName = Default;
1.571 + };
1.572 /* End XCConfigurationList section */
1.573 };
1.574 rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
2.1 --- a/src/file/SDL_rwops.c Sun May 02 05:08:12 2010 -0400
2.2 +++ b/src/file/SDL_rwops.c Sat May 08 00:54:22 2010 -0700
2.3 @@ -28,6 +28,10 @@
2.4 #include "SDL_endian.h"
2.5 #include "SDL_rwops.h"
2.6
2.7 +#ifdef __APPLE__
2.8 +#include "SDL_rwopsbundlesupport.h"
2.9 +#endif /* __APPLE__ */
2.10 +
2.11 #ifdef __NDS__
2.12 /* include libfat headers for fatInitDefault(). */
2.13 #include <fat.h>
2.14 @@ -459,9 +463,12 @@
2.15 rwops->close = win32_file_close;
2.16
2.17 #elif HAVE_STDIO_H
2.18 -
2.19 - fp = fopen(file, mode);
2.20 - if (fp == NULL) {
2.21 + #ifdef __APPLE__
2.22 + fp = SDL_OpenFPFromBundleOrFallback(file, mode);
2.23 + #else
2.24 + fp = fopen(file, mode);
2.25 + #endif
2.26 + if (fp == NULL) {
2.27 SDL_SetError("Couldn't open %s", file);
2.28 } else {
2.29 rwops = SDL_RWFromFP(fp, 1);
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/src/file/cocoa/SDL_rwopsbundlesupport.h Sat May 08 00:54:22 2010 -0700
3.3 @@ -0,0 +1,9 @@
3.4 +#ifdef __APPLE__
3.5 +
3.6 +#include <stdio.h>
3.7 +
3.8 +#ifndef SDL_rwopsbundlesupport_h
3.9 +#define SDL_rwopsbundlesupport_h
3.10 +FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode);
3.11 +#endif
3.12 +#endif
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/src/file/cocoa/SDL_rwopsbundlesupport.m Sat May 08 00:54:22 2010 -0700
4.3 @@ -0,0 +1,37 @@
4.4 +#ifdef __APPLE__
4.5 +#import <Foundation/Foundation.h>
4.6 +
4.7 +/* For proper OS X applications, the resources are contained inside the application bundle.
4.8 + So the strategy is to first check the application bundle for the file, then fallback to the current working directory.
4.9 + Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app.
4.10 + We might want to use bundle identifiers, e.g. org.libsdl.sdl to get the bundle for the framework,
4.11 + but we would somehow need to know what the bundle identifiers we need to search are.
4.12 + Also, note the bundle layouts are different for iPhone and Mac.
4.13 +*/
4.14 +FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode)
4.15 +{
4.16 + FILE* fp = NULL;
4.17 +
4.18 + NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init];
4.19 +
4.20 +
4.21 + NSFileManager* file_manager = [NSFileManager defaultManager];
4.22 + NSString* resource_path = [[NSBundle mainBundle] resourcePath];
4.23 +
4.24 + NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)];
4.25 +
4.26 + NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component];
4.27 + if([file_manager fileExistsAtPath:full_path_with_file_to_try])
4.28 + {
4.29 + fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode);
4.30 + }
4.31 + else
4.32 + {
4.33 + fp = fopen(file, mode);
4.34 + }
4.35 +
4.36 + [autorelease_pool drain];
4.37 +
4.38 + return fp;
4.39 +}
4.40 +#endif
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/test/automated/rwops/Test_rwopsbundlesupport.h Sat May 08 00:54:22 2010 -0700
5.3 @@ -0,0 +1,11 @@
5.4 +#ifdef __APPLE__
5.5 +
5.6 +#include <stdio.h>
5.7 +
5.8 +#ifndef SDL_rwopsbundlesupport_h
5.9 +#define SDL_rwopsbundlesupport_h
5.10 +FILE* Test_OpenFPFromBundleOrFallback(const char *file, const char *mode);
5.11 +FILE* Test_OpenFPFromTemporaryDir(const char *file, const char *mode);
5.12 +
5.13 +#endif
5.14 +#endif
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/test/automated/rwops/Test_rwopsbundlesupport.m Sat May 08 00:54:22 2010 -0700
6.3 @@ -0,0 +1,56 @@
6.4 +#ifdef __APPLE__
6.5 +#import <Foundation/Foundation.h>
6.6 +
6.7 +/* For proper OS X applications, the resources are contained inside the application bundle.
6.8 + So the strategy is to first check the application bundle for the file, then fallback to the current working directory.
6.9 + Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app.
6.10 + We might want to use bundle identifiers, e.g. org.libsdl.sdl to get the bundle for the framework,
6.11 + but we would somehow need to know what the bundle identifiers we need to search are.
6.12 + Also, note the bundle layouts are different for iPhone and Mac.
6.13 +*/
6.14 +FILE* Test_OpenFPFromBundleOrFallback(const char *file, const char *mode)
6.15 +{
6.16 + FILE* fp = NULL;
6.17 +
6.18 + NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init];
6.19 +
6.20 +
6.21 + NSFileManager* file_manager = [NSFileManager defaultManager];
6.22 + NSString* resource_path = [[NSBundle mainBundle] resourcePath];
6.23 +
6.24 + NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)];
6.25 +
6.26 + NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component];
6.27 + if([file_manager fileExistsAtPath:full_path_with_file_to_try])
6.28 + {
6.29 + fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode);
6.30 + }
6.31 + else
6.32 + {
6.33 + fp = fopen(file, mode);
6.34 + }
6.35 +
6.36 + [autorelease_pool drain];
6.37 +
6.38 + return fp;
6.39 +}
6.40 +
6.41 +FILE* Test_OpenFPFromTemporaryDir(const char *file, const char *mode)
6.42 +{
6.43 + FILE* fp = NULL;
6.44 +
6.45 + NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init];
6.46 +
6.47 +
6.48 + NSFileManager* file_manager = [NSFileManager defaultManager];
6.49 +
6.50 + NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)];
6.51 +
6.52 + NSString* full_path_with_file_to_try = [NSTemporaryDirectory() stringByAppendingPathComponent:ns_string_file_component];
6.53 + fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode);
6.54 +
6.55 + [autorelease_pool drain];
6.56 +
6.57 + return fp;
6.58 +}
6.59 +#endif
7.1 --- a/test/automated/rwops/rwops.c Sun May 02 05:08:12 2010 -0400
7.2 +++ b/test/automated/rwops/rwops.c Sat May 08 00:54:22 2010 -0700
7.3 @@ -9,10 +9,17 @@
7.4
7.5 #include "SDL.h"
7.6 #include "../SDL_at.h"
7.7 -
7.8 +#if __APPLE__
7.9 +#include "Test_rwopsbundlesupport.h"
7.10 +#endif
7.11
7.12 #define RWOPS_READ "rwops/read"
7.13 +
7.14 +#if __APPLE__
7.15 +#define RWOPS_WRITE "write"
7.16 +#else
7.17 #define RWOPS_WRITE "rwops/write"
7.18 +#endif
7.19
7.20 static const char hello_world[] = "Hello World!";
7.21
7.22 @@ -219,7 +226,12 @@
7.23 SDL_ATbegin( "SDL_RWFromFP" );
7.24
7.25 /* Run read tests. */
7.26 +#if __APPLE__
7.27 + /* Cheating: Using private API in SDL */
7.28 + fp = Test_OpenFPFromBundleOrFallback( RWOPS_READ, "r" );
7.29 +#else
7.30 fp = fopen( RWOPS_READ, "r" );
7.31 +#endif
7.32 if (SDL_ATassert( "Failed to open file '"RWOPS_READ"'", fp != NULL))
7.33 return;
7.34 rw = SDL_RWFromFP( fp, 1 );
7.35 @@ -230,7 +242,12 @@
7.36 SDL_FreeRW( rw );
7.37
7.38 /* Run write tests. */
7.39 +#if __APPLE__
7.40 + /* Cheating: Using private API in SDL */
7.41 + fp = Test_OpenFPFromTemporaryDir( RWOPS_WRITE, "w+" );
7.42 +#else
7.43 fp = fopen( RWOPS_WRITE, "w+" );
7.44 +#endif
7.45 if (SDL_ATassert( "Failed to open file '"RWOPS_WRITE"'", fp != NULL))
7.46 return;
7.47 rw = SDL_RWFromFP( fp, 1 );
8.1 --- a/test/automated/surface/surface.c Sun May 02 05:08:12 2010 -0400
8.2 +++ b/test/automated/surface/surface.c Sat May 08 00:54:22 2010 -0700
8.3 @@ -50,7 +50,12 @@
8.4 return;
8.5
8.6 /* Create the blit surface. */
8.7 - face = SDL_LoadBMP("../icon.bmp");
8.8 +#ifdef __APPLE__
8.9 + face = SDL_LoadBMP("icon.bmp");
8.10 +#else
8.11 + face = SDL_LoadBMP("../icon.bmp");
8.12 +#endif
8.13 +
8.14 if (SDL_ATassert( "SDL_CreateLoadBmp", face != NULL))
8.15 return;
8.16