Merged default into iOS-improvements

This commit is contained in:
Alex Szpakowski
2014-08-20 17:20:22 -03:00
25 changed files with 884 additions and 708 deletions

View File

@@ -41,6 +41,7 @@ SDL_GetBasePath(void)
const char* baseType = [[[bundle infoDictionary] objectForKey:@"SDL_FILESYSTEM_BASE_DIR_TYPE"] UTF8String];
const char *base = NULL;
char *retval = NULL;
if (baseType == NULL) {
baseType = "resource";
}
@@ -52,6 +53,7 @@ SDL_GetBasePath(void)
/* this returns the exedir for non-bundled and the resourceDir for bundled apps */
base = [[bundle resourcePath] fileSystemRepresentation];
}
if (base) {
const size_t len = SDL_strlen(base) + 2;
retval = (char *) SDL_malloc(len);
@@ -69,9 +71,10 @@ char *
SDL_GetPrefPath(const char *org, const char *app)
{ @autoreleasepool
{
NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
char *retval = NULL;
NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
if ([array count] > 0) { /* we only want the first item in the list. */
NSString *str = [array objectAtIndex:0];
const char *base = [str fileSystemRepresentation];