Unbroken SDL builds.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3674 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
4803800f1f
commit
748b857484
@ -999,6 +999,7 @@ static NSComparisonResult CompareDisplayModes(id arg1, id arg2, void *context)
|
||||
[fmgr createDirectoryAtPath:path attributes:nil];
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -30,11 +30,19 @@ MA 02110-1301, USA.
|
||||
|
||||
#define SAVEDIR "oolite-saves"
|
||||
|
||||
#if OOLITE_SDL
|
||||
#define SNAPSHOTDIR "snapshots"
|
||||
#endif
|
||||
|
||||
@interface NSFileManager (OOExtensions)
|
||||
|
||||
- (NSArray*) commanderContentsOfPath:(NSString*) savePath;
|
||||
- (NSString*) defaultCommanderPath;
|
||||
|
||||
#if OOLITE_SDL
|
||||
- (BOOL) chdirToSnapshotPath;
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -27,10 +27,10 @@ MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#import "NSFileManagerOOExtensions.h"
|
||||
#import "ResourceManager.h"
|
||||
#import "OOPListParsing.h"
|
||||
#import "GameController.h"
|
||||
#import "NSFileManagerOOExtensions.h"
|
||||
|
||||
#define kOOLogUnconvertedNSLog @"unclassified.NSFileManagerOOExtensions"
|
||||
|
||||
@ -116,6 +116,32 @@ MA 02110-1301, USA.
|
||||
return savedir;
|
||||
}
|
||||
|
||||
|
||||
#if OOLITE_SDL
|
||||
- (BOOL) chdirToSnapshotPath
|
||||
{
|
||||
// SDL: the default path for snapshots is oolite.app/oolite-saves/snapshots
|
||||
NSString *savedir = [[NSHomeDirectory() stringByAppendingPathComponent:@SAVEDIR] stringByAppendingPathComponent:@SNAPSHOTDIR];
|
||||
|
||||
if (![self changeCurrentDirectoryPath: savedir])
|
||||
{
|
||||
// it probably doesn't exist.
|
||||
if (![self createDirectoryAtPath: savedir attributes: nil])
|
||||
{
|
||||
OOLog(@"savedSnapshot.defaultPath.create.failed", @"Unable to create directory %@", savedir);
|
||||
return NO;
|
||||
}
|
||||
if (![self changeCurrentDirectoryPath: savedir])
|
||||
{
|
||||
OOLog(@"savedSnapshot.defaultPath.chdir.failed", @"Created %@ but couldn't make it the current directory.", savedir);
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user