diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-22 20:05:38 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-08-22 20:05:38 +0000 |
| commit | 9628a367530657e7fefb17be0a125dbe3f5d7614 (patch) | |
| tree | baceff9a417edb789ad675372d364bb33aea82c4 /macosx/plugins/Common/SDL/src/file/cocoa | |
| parent | 105868aa85053f9597d6099e8d25d6ef8e0f992a (diff) | |
| download | pcsxr-9628a367530657e7fefb17be0a125dbe3f5d7614.tar.gz | |
Use SDL2.framework from /Library/Frameworks on OS X instead of miniSDL.
Remove SDL code on OS X's plug-ins subdirectory.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86848 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/Common/SDL/src/file/cocoa')
| -rw-r--r-- | macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.h | 9 | ||||
| -rw-r--r-- | macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m | 44 |
2 files changed, 0 insertions, 53 deletions
diff --git a/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.h b/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.h deleted file mode 100644 index 6929904c..00000000 --- a/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifdef __APPLE__ - -#include <stdio.h> - -#ifndef SDL_rwopsbundlesupport_h -#define SDL_rwopsbundlesupport_h -FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode); -#endif -#endif diff --git a/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m b/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m deleted file mode 100644 index 888c0820..00000000 --- a/macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef __APPLE__ -#import <Foundation/Foundation.h> - -#include "SDL_rwopsbundlesupport.h" - -/* For proper OS X applications, the resources are contained inside the application bundle. - So the strategy is to first check the application bundle for the file, then fallback to the current working directory. - Note: One additional corner-case is if the resource is in a framework's resource bundle instead of the app. - We might want to use bundle identifiers, e.g. org.libsdl.sdl to get the bundle for the framework, - but we would somehow need to know what the bundle identifiers we need to search are. - Also, note the bundle layouts are different for iPhone and Mac. -*/ -FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode) -{ - FILE* fp = NULL; - - // If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only. - if(strcmp("r", mode) && strcmp("rb", mode)) - { - return fopen(file, mode); - } - - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - - NSFileManager* file_manager = [NSFileManager defaultManager]; - NSString* resource_path = [[NSBundle mainBundle] resourcePath]; - - NSString* ns_string_file_component = [file_manager stringWithFileSystemRepresentation:file length:strlen(file)]; - - NSString* full_path_with_file_to_try = [resource_path stringByAppendingPathComponent:ns_string_file_component]; - if([file_manager fileExistsAtPath:full_path_with_file_to_try]) - { - fp = fopen([full_path_with_file_to_try fileSystemRepresentation], mode); - } - else - { - fp = fopen(file, mode); - } - - [pool drain]; - - return fp; -} -#endif |
