From 9628a367530657e7fefb17be0a125dbe3f5d7614 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Thu, 22 Aug 2013 20:05:38 +0000 Subject: 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 --- .../SDL/src/file/cocoa/SDL_rwopsbundlesupport.h | 9 ----- .../SDL/src/file/cocoa/SDL_rwopsbundlesupport.m | 44 ---------------------- 2 files changed, 53 deletions(-) delete mode 100644 macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.h delete mode 100644 macosx/plugins/Common/SDL/src/file/cocoa/SDL_rwopsbundlesupport.m (limited to 'macosx/plugins/Common/SDL/src/file/cocoa') 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 - -#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 - -#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 -- cgit v1.2.3