ios: When in Rome.
This commit is contained in:
parent
a4dd4e4463
commit
566f8ace45
|
@ -10,11 +10,8 @@
|
|||
962979EF16C3EA3E00E6DCE0 /* ioseagl_ctx.c in Sources */ = {isa = PBXBuildFile; fileRef = 962979EE16C3EA3E00E6DCE0 /* ioseagl_ctx.c */; };
|
||||
962979F616C43B9500E6DCE0 /* ic_dir.png in Resources */ = {isa = PBXBuildFile; fileRef = 962979F416C43B9500E6DCE0 /* ic_dir.png */; };
|
||||
962979F716C43B9500E6DCE0 /* ic_file.png in Resources */ = {isa = PBXBuildFile; fileRef = 962979F516C43B9500E6DCE0 /* ic_file.png */; };
|
||||
96297A0916C59EC000E6DCE0 /* module_list.m in Sources */ = {isa = PBXBuildFile; fileRef = 96297A0816C59EC000E6DCE0 /* module_list.m */; };
|
||||
96297A0C16C5AD8D00E6DCE0 /* RetroArch_iOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 96297A0B16C5AD8D00E6DCE0 /* RetroArch_iOS.m */; };
|
||||
96297A0F16C5AEA100E6DCE0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 96297A0E16C5AEA100E6DCE0 /* main.m */; };
|
||||
96297A1116C5AEDE00E6DCE0 /* game_view.m in Sources */ = {isa = PBXBuildFile; fileRef = 96297A1016C5AEDE00E6DCE0 /* game_view.m */; };
|
||||
96297A1316C5AEFD00E6DCE0 /* directory_list.m in Sources */ = {isa = PBXBuildFile; fileRef = 96297A1216C5AEFD00E6DCE0 /* directory_list.m */; };
|
||||
96297A2416C818FF00E6DCE0 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 96297A2216C818FF00E6DCE0 /* Icon-72.png */; };
|
||||
96297A2516C818FF00E6DCE0 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 96297A2316C818FF00E6DCE0 /* Icon.png */; };
|
||||
96297A2716C82FF100E6DCE0 /* overlays in Resources */ = {isa = PBXBuildFile; fileRef = 96297A2616C82FF100E6DCE0 /* overlays */; };
|
||||
|
@ -23,10 +20,13 @@
|
|||
96366C5316C9A7C100D64A22 /* coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 96AFAEE816C1DC73009DE44C /* coreaudio.c */; };
|
||||
96366C5516C9AC3300D64A22 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96366C5416C9AC3300D64A22 /* CoreAudio.framework */; };
|
||||
96366C5916C9ACF500D64A22 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96366C5816C9ACF500D64A22 /* AudioToolbox.framework */; };
|
||||
96366C7416CAF62200D64A22 /* button_getter.m in Sources */ = {isa = PBXBuildFile; fileRef = 96366C7016CAF62200D64A22 /* button_getter.m */; };
|
||||
96366C7516CAF62200D64A22 /* enumeration_list.m in Sources */ = {isa = PBXBuildFile; fileRef = 96366C7116CAF62200D64A22 /* enumeration_list.m */; };
|
||||
96366C7616CAF62200D64A22 /* settings_list.m in Sources */ = {isa = PBXBuildFile; fileRef = 96366C7316CAF62200D64A22 /* settings_list.m */; };
|
||||
963F5AB216CC14C4009BBD19 /* settings_sublist.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5AB116CC14C4009BBD19 /* settings_sublist.m */; };
|
||||
963F5AC016CC522F009BBD19 /* RAButtonGetter.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5ABC16CC522F009BBD19 /* RAButtonGetter.m */; };
|
||||
963F5AC116CC522F009BBD19 /* RASettingEnumerationList.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5ABD16CC522F009BBD19 /* RASettingEnumerationList.m */; };
|
||||
963F5AC216CC522F009BBD19 /* RASettingsSubList.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5ABE16CC522F009BBD19 /* RASettingsSubList.m */; };
|
||||
963F5AC316CC522F009BBD19 /* RASettingsList.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5ABF16CC522F009BBD19 /* RASettingsList.m */; };
|
||||
963F5AC716CC523B009BBD19 /* RADirectoryList.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5AC416CC523B009BBD19 /* RADirectoryList.m */; };
|
||||
963F5AC816CC523B009BBD19 /* RAGameView.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5AC516CC523B009BBD19 /* RAGameView.m */; };
|
||||
963F5AC916CC523B009BBD19 /* RAModuleList.m in Sources */ = {isa = PBXBuildFile; fileRef = 963F5AC616CC523B009BBD19 /* RAModuleList.m */; };
|
||||
96AFAE2A16C1D4EA009DE44C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96AFAE2916C1D4EA009DE44C /* UIKit.framework */; };
|
||||
96AFAE2C16C1D4EA009DE44C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96AFAE2B16C1D4EA009DE44C /* Foundation.framework */; };
|
||||
96AFAE2E16C1D4EA009DE44C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96AFAE2D16C1D4EA009DE44C /* CoreGraphics.framework */; };
|
||||
|
@ -92,24 +92,24 @@
|
|||
962979EE16C3EA3E00E6DCE0 /* ioseagl_ctx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioseagl_ctx.c; sourceTree = "<group>"; };
|
||||
962979F416C43B9500E6DCE0 /* ic_dir.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_dir.png; path = "../android/phoenix/res/drawable-xhdpi/ic_dir.png"; sourceTree = "<group>"; };
|
||||
962979F516C43B9500E6DCE0 /* ic_file.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_file.png; path = "../android/phoenix/res/drawable-xhdpi/ic_file.png"; sourceTree = "<group>"; };
|
||||
96297A0816C59EC000E6DCE0 /* module_list.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = module_list.m; sourceTree = "<group>"; };
|
||||
96297A0A16C5AD8D00E6DCE0 /* RetroArch_iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RetroArch_iOS.h; sourceTree = "<group>"; };
|
||||
96297A0B16C5AD8D00E6DCE0 /* RetroArch_iOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RetroArch_iOS.m; sourceTree = "<group>"; };
|
||||
96297A0D16C5ADDA00E6DCE0 /* views.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = views.h; sourceTree = "<group>"; };
|
||||
96297A0E16C5AEA100E6DCE0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
96297A1016C5AEDE00E6DCE0 /* game_view.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = game_view.m; sourceTree = "<group>"; };
|
||||
96297A1216C5AEFD00E6DCE0 /* directory_list.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = directory_list.m; sourceTree = "<group>"; };
|
||||
96297A2216C818FF00E6DCE0 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "RetroArch/Icon-72.png"; sourceTree = "<group>"; };
|
||||
96297A2316C818FF00E6DCE0 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = RetroArch/Icon.png; sourceTree = "<group>"; };
|
||||
96297A2616C82FF100E6DCE0 /* overlays */ = {isa = PBXFileReference; lastKnownFileType = folder; name = overlays; path = ../media/overlays; sourceTree = "<group>"; };
|
||||
96366C4F16C9A4E100D64A22 /* resampler.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = resampler.c; sourceTree = "<group>"; };
|
||||
96366C5416C9AC3300D64A22 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
|
||||
96366C5816C9ACF500D64A22 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
|
||||
96366C7016CAF62200D64A22 /* button_getter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = button_getter.m; sourceTree = "<group>"; };
|
||||
96366C7116CAF62200D64A22 /* enumeration_list.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = enumeration_list.m; sourceTree = "<group>"; };
|
||||
96366C7216CAF62200D64A22 /* settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = settings.h; sourceTree = "<group>"; };
|
||||
96366C7316CAF62200D64A22 /* settings_list.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = settings_list.m; sourceTree = "<group>"; };
|
||||
963F5AB116CC14C4009BBD19 /* settings_sublist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = settings_sublist.m; sourceTree = "<group>"; };
|
||||
963F5ABC16CC522F009BBD19 /* RAButtonGetter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAButtonGetter.m; sourceTree = "<group>"; };
|
||||
963F5ABD16CC522F009BBD19 /* RASettingEnumerationList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RASettingEnumerationList.m; sourceTree = "<group>"; };
|
||||
963F5ABE16CC522F009BBD19 /* RASettingsSubList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RASettingsSubList.m; sourceTree = "<group>"; };
|
||||
963F5ABF16CC522F009BBD19 /* RASettingsList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RASettingsList.m; sourceTree = "<group>"; };
|
||||
963F5AC416CC523B009BBD19 /* RADirectoryList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RADirectoryList.m; sourceTree = "<group>"; };
|
||||
963F5AC516CC523B009BBD19 /* RAGameView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAGameView.m; sourceTree = "<group>"; };
|
||||
963F5AC616CC523B009BBD19 /* RAModuleList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAModuleList.m; sourceTree = "<group>"; };
|
||||
96AFAE2516C1D4EA009DE44C /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
96AFAE2916C1D4EA009DE44C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
96AFAE2B16C1D4EA009DE44C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
|
@ -315,11 +315,11 @@
|
|||
96366C6F16CAF62200D64A22 /* settings */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
96366C7016CAF62200D64A22 /* button_getter.m */,
|
||||
96366C7116CAF62200D64A22 /* enumeration_list.m */,
|
||||
963F5ABC16CC522F009BBD19 /* RAButtonGetter.m */,
|
||||
963F5ABD16CC522F009BBD19 /* RASettingEnumerationList.m */,
|
||||
963F5ABE16CC522F009BBD19 /* RASettingsSubList.m */,
|
||||
963F5ABF16CC522F009BBD19 /* RASettingsList.m */,
|
||||
96366C7216CAF62200D64A22 /* settings.h */,
|
||||
96366C7316CAF62200D64A22 /* settings_list.m */,
|
||||
963F5AB116CC14C4009BBD19 /* settings_sublist.m */,
|
||||
);
|
||||
path = settings;
|
||||
sourceTree = "<group>";
|
||||
|
@ -365,9 +365,10 @@
|
|||
96AFAE3316C1D4EA009DE44C /* RetroArch */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
963F5AC416CC523B009BBD19 /* RADirectoryList.m */,
|
||||
963F5AC516CC523B009BBD19 /* RAGameView.m */,
|
||||
963F5AC616CC523B009BBD19 /* RAModuleList.m */,
|
||||
96366C6F16CAF62200D64A22 /* settings */,
|
||||
96297A1216C5AEFD00E6DCE0 /* directory_list.m */,
|
||||
96297A1016C5AEDE00E6DCE0 /* game_view.m */,
|
||||
96297A0D16C5ADDA00E6DCE0 /* views.h */,
|
||||
96297A0A16C5AD8D00E6DCE0 /* RetroArch_iOS.h */,
|
||||
96297A0B16C5AD8D00E6DCE0 /* RetroArch_iOS.m */,
|
||||
|
@ -375,7 +376,6 @@
|
|||
96AFAE4F16C1D4EA009DE44C /* ViewController_iPad.xib */,
|
||||
96AFAE3416C1D4EA009DE44C /* Supporting Files */,
|
||||
96CF015B16C2F72900ABF9C9 /* ios_input.c */,
|
||||
96297A0816C59EC000E6DCE0 /* module_list.m */,
|
||||
);
|
||||
path = RetroArch;
|
||||
sourceTree = "<group>";
|
||||
|
@ -821,18 +821,18 @@
|
|||
96CF015016C2C0B700ABF9C9 /* overlay.c in Sources */,
|
||||
96CF015C16C2F72900ABF9C9 /* ios_input.c in Sources */,
|
||||
962979EF16C3EA3E00E6DCE0 /* ioseagl_ctx.c in Sources */,
|
||||
96297A0916C59EC000E6DCE0 /* module_list.m in Sources */,
|
||||
96297A0C16C5AD8D00E6DCE0 /* RetroArch_iOS.m in Sources */,
|
||||
96297A0F16C5AEA100E6DCE0 /* main.m in Sources */,
|
||||
96297A1116C5AEDE00E6DCE0 /* game_view.m in Sources */,
|
||||
96297A1316C5AEFD00E6DCE0 /* directory_list.m in Sources */,
|
||||
96366C5016C9A4E100D64A22 /* resampler.c in Sources */,
|
||||
96366C5216C9A4E600D64A22 /* hermite.c in Sources */,
|
||||
96366C5316C9A7C100D64A22 /* coreaudio.c in Sources */,
|
||||
96366C7416CAF62200D64A22 /* button_getter.m in Sources */,
|
||||
96366C7516CAF62200D64A22 /* enumeration_list.m in Sources */,
|
||||
96366C7616CAF62200D64A22 /* settings_list.m in Sources */,
|
||||
963F5AB216CC14C4009BBD19 /* settings_sublist.m in Sources */,
|
||||
963F5AC016CC522F009BBD19 /* RAButtonGetter.m in Sources */,
|
||||
963F5AC116CC522F009BBD19 /* RASettingEnumerationList.m in Sources */,
|
||||
963F5AC216CC522F009BBD19 /* RASettingsSubList.m in Sources */,
|
||||
963F5AC316CC522F009BBD19 /* RASettingsList.m in Sources */,
|
||||
963F5AC716CC523B009BBD19 /* RADirectoryList.m in Sources */,
|
||||
963F5AC816CC523B009BBD19 /* RAGameView.m in Sources */,
|
||||
963F5AC916CC523B009BBD19 /* RAModuleList.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -13,11 +13,11 @@ static BOOL is_directory(NSString* path)
|
|||
return result;
|
||||
}
|
||||
|
||||
@implementation directory_list
|
||||
@implementation RADirectoryList
|
||||
{
|
||||
NSString* directory;
|
||||
NSArray* list;
|
||||
};
|
||||
NSString* _path;
|
||||
NSArray* _list;
|
||||
}
|
||||
|
||||
- (id)initWithPath:(NSString*)path
|
||||
{
|
||||
|
@ -30,12 +30,12 @@ static BOOL is_directory(NSString* path)
|
|||
else path = @"/";
|
||||
}
|
||||
|
||||
directory = path;
|
||||
_path = path;
|
||||
|
||||
list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:directory error:nil];
|
||||
list = [directory stringsByAppendingPaths:list];
|
||||
_list = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:_path error:nil];
|
||||
_list = [_path stringsByAppendingPaths:_list];
|
||||
|
||||
list = [list sortedArrayUsingComparator:^(id left, id right)
|
||||
_list = [_list sortedArrayUsingComparator:^(id left, id right)
|
||||
{
|
||||
const BOOL left_is_dir = is_directory((NSString*)left);
|
||||
const BOOL right_is_dir = is_directory((NSString*)right);
|
||||
|
@ -46,18 +46,18 @@ static BOOL is_directory(NSString* path)
|
|||
}];
|
||||
|
||||
self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button;
|
||||
[self setTitle: [directory lastPathComponent]];
|
||||
[self setTitle: [_path lastPathComponent]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSString* path = [list objectAtIndex: indexPath.row];
|
||||
NSString* path = [_list objectAtIndex: indexPath.row];
|
||||
|
||||
if(is_directory(path))
|
||||
{
|
||||
[[RetroArch_iOS get] pushViewController:[[directory_list alloc] initWithPath:path]];
|
||||
[[RetroArch_iOS get] pushViewController:[[RADirectoryList alloc] initWithPath:path]];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -67,12 +67,12 @@ static BOOL is_directory(NSString* path)
|
|||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return [list count];
|
||||
return [_list count];
|
||||
}
|
||||
|
||||
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSString* path = [list objectAtIndex: indexPath.row];
|
||||
NSString* path = [_list objectAtIndex: indexPath.row];
|
||||
BOOL isdir = is_directory(path);
|
||||
|
||||
UITableViewCell* cell = [self.tableView dequeueReusableCellWithIdentifier:@"path"];
|
|
@ -33,7 +33,7 @@ static bool idle_iterate()
|
|||
return true;
|
||||
}
|
||||
|
||||
@implementation game_view
|
||||
@implementation RAGameView
|
||||
{
|
||||
EAGLContext *gl_context;
|
||||
NSString* game;
|
||||
|
@ -86,7 +86,7 @@ static bool idle_iterate()
|
|||
|
||||
- (void)runGame
|
||||
{
|
||||
[SettingsList refreshConfigFile];
|
||||
[RASettingsList refreshConfigFile];
|
||||
|
||||
const char* const sd = [[RetroArch_iOS get].system_directory UTF8String];
|
||||
const char* const cf =[[RetroArch_iOS get].config_file_path UTF8String];
|
|
@ -16,29 +16,27 @@ static void display_error_alert(NSString* message)
|
|||
[alert show];
|
||||
}
|
||||
|
||||
@implementation module_list
|
||||
@implementation RAModuleList
|
||||
{
|
||||
NSArray* modules;
|
||||
};
|
||||
NSArray* _modules;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super initWithStyle:UITableViewStylePlain];
|
||||
|
||||
// Get the contents of the modules directory of the bundle.
|
||||
NSString* module_dir = [NSString stringWithFormat:@"%@/%@",
|
||||
[[NSBundle mainBundle] bundlePath],
|
||||
@"modules"];
|
||||
NSString* module_dir = [NSString stringWithFormat:@"%@/modules", [[NSBundle mainBundle] bundlePath]];
|
||||
|
||||
modules = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:module_dir error:nil];
|
||||
_modules = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:module_dir error:nil];
|
||||
|
||||
if (modules != nil)
|
||||
if (_modules != nil)
|
||||
{
|
||||
modules = [module_dir stringsByAppendingPaths:modules];
|
||||
modules = [modules pathsMatchingExtensions:[NSArray arrayWithObject:@"dylib"]];
|
||||
_modules = [module_dir stringsByAppendingPaths:_modules];
|
||||
_modules = [_modules pathsMatchingExtensions:[NSArray arrayWithObject:@"dylib"]];
|
||||
}
|
||||
|
||||
if (modules == nil || [modules count] == 0)
|
||||
if (_modules == nil || [_modules count] == 0)
|
||||
{
|
||||
display_error_alert(@"No libretro cores were found.");
|
||||
}
|
||||
|
@ -51,13 +49,13 @@ static void display_error_alert(NSString* message)
|
|||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
[RetroArch_iOS get].module_path = [modules objectAtIndex:indexPath.row];
|
||||
[[RetroArch_iOS get] pushViewController:[[directory_list alloc] initWithPath:nil]];
|
||||
[RetroArch_iOS get].module_path = [_modules objectAtIndex:indexPath.row];
|
||||
[[RetroArch_iOS get] pushViewController:[[RADirectoryList alloc] initWithPath:nil]];
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return modules ? [modules count] : 0;
|
||||
return _modules ? [_modules count] : 0;
|
||||
}
|
||||
|
||||
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
|
@ -65,7 +63,7 @@ static void display_error_alert(NSString* message)
|
|||
UITableViewCell* cell = [self.tableView dequeueReusableCellWithIdentifier:@"module"];
|
||||
cell = (cell != nil) ? cell : [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"module"];
|
||||
|
||||
cell.textLabel.text = [[[modules objectAtIndex:indexPath.row] lastPathComponent] stringByDeletingPathExtension];
|
||||
cell.textLabel.text = [[[_modules objectAtIndex:indexPath.row] lastPathComponent] stringByDeletingPathExtension];
|
||||
|
||||
return cell;
|
||||
}
|
|
@ -22,10 +22,10 @@ extern uint32_t ios_current_touch_count;
|
|||
|
||||
@implementation RetroArch_iOS
|
||||
{
|
||||
game_view* game;
|
||||
RAGameView* _game;
|
||||
|
||||
UIWindow* window;
|
||||
UINavigationController* navigator;
|
||||
UIWindow* _window;
|
||||
UINavigationController* _navigator;
|
||||
}
|
||||
|
||||
+ (RetroArch_iOS*)get
|
||||
|
@ -35,34 +35,34 @@ extern uint32_t ios_current_touch_count;
|
|||
|
||||
- (void)runGame:(NSString*)path
|
||||
{
|
||||
game = [[game_view alloc] initWithGame:path];
|
||||
window.rootViewController = game;
|
||||
navigator = nil;
|
||||
_game = [[RAGameView alloc] initWithGame:path];
|
||||
_window.rootViewController = _game;
|
||||
_navigator = nil;
|
||||
}
|
||||
|
||||
- (void)gameHasExited
|
||||
{
|
||||
game = nil;
|
||||
_game = nil;
|
||||
|
||||
navigator = [[UINavigationController alloc] init];
|
||||
[navigator pushViewController: [[module_list alloc] init] animated:YES];
|
||||
_navigator = [[UINavigationController alloc] init];
|
||||
[_navigator pushViewController: [[RAModuleList alloc] init] animated:YES];
|
||||
|
||||
window.rootViewController = navigator;
|
||||
_window.rootViewController = _navigator;
|
||||
}
|
||||
|
||||
- (void)pushViewController:(UIViewController*)theView
|
||||
{
|
||||
if (navigator != nil)
|
||||
if (_navigator != nil)
|
||||
{
|
||||
[navigator pushViewController:theView animated:YES];
|
||||
[_navigator pushViewController:theView animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)popViewController
|
||||
{
|
||||
if (navigator != nil)
|
||||
if (_navigator != nil)
|
||||
{
|
||||
[navigator popViewControllerAnimated:YES];
|
||||
[_navigator popViewControllerAnimated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,12 +87,12 @@ extern uint32_t ios_current_touch_count;
|
|||
self.settings_button.action = @selector(show_settings);
|
||||
|
||||
// Setup window
|
||||
navigator = [[UINavigationController alloc] init];
|
||||
[navigator pushViewController: [[module_list alloc] init] animated:YES];
|
||||
_navigator = [[UINavigationController alloc] init];
|
||||
[_navigator pushViewController: [[RAModuleList alloc] init] animated:YES];
|
||||
|
||||
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
window.rootViewController = navigator;
|
||||
[window makeKeyAndVisible];
|
||||
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
_window.rootViewController = _navigator;
|
||||
[_window makeKeyAndVisible];
|
||||
|
||||
// Setup keyboard hack
|
||||
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(keyPressed:) name: GSEventKeyDownNotification object: nil];
|
||||
|
@ -101,18 +101,14 @@ extern uint32_t ios_current_touch_count;
|
|||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application
|
||||
{
|
||||
if (game)
|
||||
{
|
||||
[game resume];
|
||||
}
|
||||
if (_game)
|
||||
[_game resume];
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application
|
||||
{
|
||||
if (game)
|
||||
{
|
||||
[game pause];
|
||||
}
|
||||
if (_game)
|
||||
[_game pause];
|
||||
}
|
||||
|
||||
-(void) keyPressed: (NSNotification*) notification
|
||||
|
@ -129,30 +125,30 @@ extern uint32_t ios_current_touch_count;
|
|||
|
||||
- (void)show_settings
|
||||
{
|
||||
[self pushViewController:[SettingsList new]];
|
||||
[self pushViewController:[RASettingsList new]];
|
||||
}
|
||||
|
||||
- (void)processTouches:(NSArray*)touches
|
||||
{
|
||||
if (game)
|
||||
if (_game)
|
||||
{
|
||||
ios_current_touch_count = [touches count];
|
||||
|
||||
for(int i = 0; i != [touches count]; i ++)
|
||||
{
|
||||
UITouch *touch = [touches objectAtIndex:i];
|
||||
CGPoint coord = [touch locationInView:game.view];
|
||||
CGPoint coord = [touch locationInView:_game.view];
|
||||
float scale = [[UIScreen mainScreen] scale];
|
||||
|
||||
// Exit hack!
|
||||
if (touch.tapCount == 3)
|
||||
{
|
||||
if (coord.y < game.view.bounds.size.height / 10.0f)
|
||||
if (coord.y < _game.view.bounds.size.height / 10.0f)
|
||||
{
|
||||
float tenpct = game.view.bounds.size.width / 10.0f;
|
||||
float tenpct = _game.view.bounds.size.width / 10.0f;
|
||||
if (coord.x >= tenpct * 4 && coord.x <= tenpct * 6)
|
||||
{
|
||||
[game exit];
|
||||
[_game exit];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,15 +78,15 @@ static NSString* get_key_config_name(uint32_t hid_id)
|
|||
return @"nul";
|
||||
}
|
||||
|
||||
@implementation ButtonGetter
|
||||
@implementation RAButtonGetter
|
||||
{
|
||||
ButtonGetter* me;
|
||||
SettingData* value;
|
||||
RAButtonGetter* me;
|
||||
RASettingData* value;
|
||||
UIAlertView* alert;
|
||||
UITableView* view;
|
||||
}
|
||||
|
||||
- (id)initWithSetting:(SettingData*)setting fromTable:(UITableView*)table
|
||||
- (id)initWithSetting:(RASettingData*)setting fromTable:(UITableView*)table
|
||||
{
|
||||
self = [super init];
|
||||
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
#import "settings.h"
|
||||
|
||||
@implementation SettingEnumerationList
|
||||
@implementation RASettingEnumerationList
|
||||
{
|
||||
SettingData* value;
|
||||
RASettingData* value;
|
||||
UITableView* view;
|
||||
};
|
||||
|
||||
- (id)initWithSetting:(SettingData*)setting fromTable:(UITableView*)table
|
||||
- (id)initWithSetting:(RASettingData*)setting fromTable:(UITableView*)table
|
||||
{
|
||||
self = [super initWithStyle:UITableViewStyleGrouped];
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#import "settings.h"
|
||||
#include "config_file.h"
|
||||
|
||||
@implementation SettingData
|
||||
@implementation RASettingData
|
||||
@end
|
||||
|
||||
|
||||
|
@ -32,9 +32,9 @@ static NSString* get_value_from_config(config_file_t* config, NSString* name, NS
|
|||
return value;
|
||||
}
|
||||
|
||||
static SettingData* boolean_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue)
|
||||
static RASettingData* boolean_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue)
|
||||
{
|
||||
SettingData* result = [[SettingData alloc] init];
|
||||
RASettingData* result = [[RASettingData alloc] init];
|
||||
result.type = BooleanSetting;
|
||||
result.label = label;
|
||||
result.name = name;
|
||||
|
@ -42,9 +42,9 @@ static SettingData* boolean_setting(config_file_t* config, NSString* name, NSStr
|
|||
return result;
|
||||
}
|
||||
|
||||
static SettingData* button_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue)
|
||||
static RASettingData* button_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue)
|
||||
{
|
||||
SettingData* result = [[SettingData alloc] init];
|
||||
RASettingData* result = [[RASettingData alloc] init];
|
||||
result.type = ButtonSetting;
|
||||
result.label = label;
|
||||
result.name = name;
|
||||
|
@ -52,18 +52,18 @@ static SettingData* button_setting(config_file_t* config, NSString* name, NSStri
|
|||
return result;
|
||||
}
|
||||
|
||||
static SettingData* group_setting(NSString* label, NSArray* settings)
|
||||
static RASettingData* group_setting(NSString* label, NSArray* settings)
|
||||
{
|
||||
SettingData* result = [[SettingData alloc] init];
|
||||
RASettingData* result = [[RASettingData alloc] init];
|
||||
result.type = GroupSetting;
|
||||
result.label = label;
|
||||
result.subValues = settings;
|
||||
return result;
|
||||
}
|
||||
|
||||
static SettingData* enumeration_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue, NSArray* values)
|
||||
static RASettingData* enumeration_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue, NSArray* values)
|
||||
{
|
||||
SettingData* result = [[SettingData alloc] init];
|
||||
RASettingData* result = [[RASettingData alloc] init];
|
||||
result.type = EnumerationSetting;
|
||||
result.label = label;
|
||||
result.name = name;
|
||||
|
@ -72,7 +72,7 @@ static SettingData* enumeration_setting(config_file_t* config, NSString* name, N
|
|||
return result;
|
||||
}
|
||||
|
||||
static SettingData* subpath_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue, NSString* path, NSString* extension)
|
||||
static RASettingData* subpath_setting(config_file_t* config, NSString* name, NSString* label, NSString* defaultValue, NSString* path, NSString* extension)
|
||||
{
|
||||
NSString* value = get_value_from_config(config, name, defaultValue);
|
||||
value = [value stringByReplacingOccurrencesOfString:path withString:@""];
|
||||
|
@ -80,7 +80,7 @@ static SettingData* subpath_setting(config_file_t* config, NSString* name, NSStr
|
|||
NSArray* values = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:path error:nil];
|
||||
values = [values pathsMatchingExtensions:[NSArray arrayWithObject:extension]];
|
||||
|
||||
SettingData* result = [[SettingData alloc] init];
|
||||
RASettingData* result = [[RASettingData alloc] init];
|
||||
result.type = FileListSetting;
|
||||
result.label = label;
|
||||
result.name = name;
|
||||
|
@ -90,7 +90,7 @@ static SettingData* subpath_setting(config_file_t* config, NSString* name, NSStr
|
|||
return result;
|
||||
}
|
||||
|
||||
@implementation SettingsList
|
||||
@implementation RASettingsList
|
||||
- (id)init
|
||||
{
|
||||
config_file_t* config = config_file_new([[RetroArch_iOS get].config_file_path UTF8String]);
|
||||
|
@ -176,7 +176,7 @@ static SettingData* subpath_setting(config_file_t* config, NSString* name, NSStr
|
|||
|
||||
+ (void)refreshConfigFile
|
||||
{
|
||||
[[[SettingsList alloc] init] writeToDisk];
|
||||
[[[RASettingsList alloc] init] writeToDisk];
|
||||
}
|
||||
|
||||
- (void)writeToDisk
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
static const char* const SETTINGID = "SETTING";
|
||||
|
||||
@implementation SettingsSubList
|
||||
@implementation RASettingsSubList
|
||||
{
|
||||
NSArray* settings;
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ static const char* const SETTINGID = "SETTING";
|
|||
|
||||
for (int j = 1; j < [group count]; j ++)
|
||||
{
|
||||
SettingData* setting = [group objectAtIndex:j];
|
||||
RASettingData* setting = [group objectAtIndex:j];
|
||||
|
||||
switch (setting.type)
|
||||
{
|
||||
|
@ -60,21 +60,21 @@ static const char* const SETTINGID = "SETTING";
|
|||
|
||||
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
SettingData* setting = [[settings objectAtIndex:indexPath.section] objectAtIndex:indexPath.row + 1];
|
||||
RASettingData* setting = [[settings objectAtIndex:indexPath.section] objectAtIndex:indexPath.row + 1];
|
||||
|
||||
switch (setting.type)
|
||||
{
|
||||
case EnumerationSetting:
|
||||
case FileListSetting:
|
||||
[[RetroArch_iOS get] pushViewController:[[SettingEnumerationList alloc] initWithSetting:setting fromTable:(UITableView*)self.view]];
|
||||
[[RetroArch_iOS get] pushViewController:[[RASettingEnumerationList alloc] initWithSetting:setting fromTable:(UITableView*)self.view]];
|
||||
break;
|
||||
|
||||
case ButtonSetting:
|
||||
(void)[[ButtonGetter alloc] initWithSetting:setting fromTable:(UITableView*)self.view];
|
||||
(void)[[RAButtonGetter alloc] initWithSetting:setting fromTable:(UITableView*)self.view];
|
||||
break;
|
||||
|
||||
case GroupSetting:
|
||||
[[RetroArch_iOS get] pushViewController:[[SettingsSubList alloc] initWithSettings:setting.subValues title:setting.label]];
|
||||
[[RetroArch_iOS get] pushViewController:[[RASettingsSubList alloc] initWithSettings:setting.subValues title:setting.label]];
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -84,13 +84,13 @@ static const char* const SETTINGID = "SETTING";
|
|||
|
||||
- (void)handle_boolean_switch:(UISwitch*)swt
|
||||
{
|
||||
SettingData* setting = objc_getAssociatedObject(swt, SETTINGID);
|
||||
RASettingData* setting = objc_getAssociatedObject(swt, SETTINGID);
|
||||
setting.value = (swt.on ? @"true" : @"false");
|
||||
}
|
||||
|
||||
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
SettingData* setting = [[settings objectAtIndex:indexPath.section] objectAtIndex:indexPath.row + 1];
|
||||
RASettingData* setting = [[settings objectAtIndex:indexPath.section] objectAtIndex:indexPath.row + 1];
|
||||
|
||||
UITableViewCell* cell = nil;
|
||||
|
|
@ -13,7 +13,7 @@ enum SettingTypes
|
|||
BooleanSetting, ButtonSetting, EnumerationSetting, FileListSetting, GroupSetting
|
||||
};
|
||||
|
||||
@interface SettingData : NSObject
|
||||
@interface RASettingData : NSObject
|
||||
@property enum SettingTypes type;
|
||||
|
||||
@property (strong) NSString* label;
|
||||
|
@ -24,10 +24,10 @@ enum SettingTypes
|
|||
@property (strong) NSArray* subValues;
|
||||
@end
|
||||
|
||||
@interface ButtonGetter : NSObject<UIAlertViewDelegate>
|
||||
- (id)initWithSetting:(SettingData*)setting fromTable:(UITableView*)table;
|
||||
@interface RAButtonGetter : NSObject<UIAlertViewDelegate>
|
||||
- (id)initWithSetting:(RASettingData*)setting fromTable:(UITableView*)table;
|
||||
@end
|
||||
|
||||
@interface SettingEnumerationList : UITableViewController
|
||||
- (id)initWithSetting:(SettingData*)setting fromTable:(UITableView*)table;
|
||||
@interface RASettingEnumerationList : UITableViewController
|
||||
- (id)initWithSetting:(RASettingData*)setting fromTable:(UITableView*)table;
|
||||
@end
|
||||
|
|
|
@ -3,27 +3,27 @@
|
|||
|
||||
#include "conf/config_file.h"
|
||||
|
||||
@interface game_view : UIViewController
|
||||
@interface RAGameView : UIViewController
|
||||
- (id)initWithGame:(NSString*)path;\
|
||||
- (void)pause;
|
||||
- (void)resume;
|
||||
- (void)exit;
|
||||
@end
|
||||
|
||||
@interface module_list : UITableViewController
|
||||
@interface RAModuleList : UITableViewController
|
||||
|
||||
@end
|
||||
|
||||
@interface directory_list : UITableViewController
|
||||
@interface RADirectoryList : UITableViewController
|
||||
- (id)initWithPath:(NSString*)path;
|
||||
@end
|
||||
|
||||
|
||||
@interface SettingsSubList : UITableViewController
|
||||
@interface RASettingsSubList : UITableViewController
|
||||
- (id)initWithSettings:(NSArray*)values title:(NSString*)title;
|
||||
- (void)writeSettings:(NSArray*)settingList toConfig:(config_file_t*)config;
|
||||
@end
|
||||
|
||||
@interface SettingsList : SettingsSubList
|
||||
@interface RASettingsList : RASettingsSubList
|
||||
+ (void)refreshConfigFile;
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue