mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Delegate shouldn't keep the specific ViewController type
This commit is contained in:
parent
b1a435840c
commit
947f0a876e
@ -2,13 +2,13 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class PPSSPPViewControllerGL;
|
||||
@protocol PPSSPPViewController;
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
@property (strong, nonatomic) UIScreen *screen;
|
||||
|
||||
@property (strong, nonatomic) PPSSPPViewControllerGL *viewController;
|
||||
@property (strong, nonatomic) id<PPSSPPViewController> viewController;
|
||||
|
||||
@end
|
||||
|
@ -91,14 +91,15 @@
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
|
||||
PPSSPPViewControllerGL *vc = [[PPSSPPViewControllerGL alloc] init];
|
||||
// Here we can switch viewcontroller depending on backend.
|
||||
self.viewController = [[PPSSPPViewControllerGL alloc] init];
|
||||
self.viewController = vc;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAudioSessionInterruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleMediaServicesWereReset:) name:AVAudioSessionMediaServicesWereResetNotification object:nil];
|
||||
|
||||
self.window.rootViewController = self.viewController;
|
||||
self.window.rootViewController = vc;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
return YES;
|
||||
|
@ -166,7 +166,7 @@
|
||||
g_display.pixel_in_dps_x = (float)g_display.pixel_xres / (float)g_display.dp_xres;
|
||||
g_display.pixel_in_dps_y = (float)g_display.pixel_yres / (float)g_display.dp_yres;
|
||||
|
||||
[[sharedViewController view] setContentScaleFactor:scale];
|
||||
[[sharedViewController getView] setContentScaleFactor:scale];
|
||||
|
||||
// PSP native resize
|
||||
PSP_CoreParameter().pixelWidth = g_display.pixel_xres;
|
||||
|
@ -16,6 +16,7 @@
|
||||
- (void)shareText:(NSString *)text;
|
||||
- (void)shutdown;
|
||||
- (void)bindDefaultFBO;
|
||||
- (UIView *)getView;
|
||||
@end
|
||||
|
||||
@interface PPSSPPViewControllerGL : GLKViewController <
|
||||
|
@ -599,6 +599,10 @@ int ToTouchID(UITouch *uiTouch, bool allowAllocate) {
|
||||
return UIRectEdgeAll;
|
||||
}
|
||||
|
||||
- (UIView *)getView {
|
||||
return [self view];
|
||||
}
|
||||
|
||||
- (void)setupController:(GCController *)controller
|
||||
{
|
||||
self.gameController = controller;
|
||||
|
Loading…
Reference in New Issue
Block a user