Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Common/Render/Text/draw_text_cocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ void Destroy() {
if (iter != sizeCache_.end()) {
entry = iter->second.get();
} else {
// INFO_LOG(SYSTEM, "Measuring %.*s", (int)str.length(), str.data());

auto iter = fontMap_.find(fontHash_);
NSDictionary *attributes = nil;
if (iter != fontMap_.end()) {
Expand Down
30 changes: 24 additions & 6 deletions ios/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ @interface PPSSPPViewControllerGL () {

@end

@implementation PPSSPPViewControllerGL
@implementation PPSSPPViewControllerGL {
UIScreenEdgePanGestureRecognizer *mBackGestureRecognizer;
}

-(id) init {
self = [super init];
Expand Down Expand Up @@ -219,7 +221,9 @@ - (void)requestExitGLRenderLoop {

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
INFO_LOG(G3D, "viewDidAppear");
[self hideKeyboard];
[self updateGesture];
}

- (void)viewDidLoad {
Expand Down Expand Up @@ -269,10 +273,6 @@ - (void)viewDidLoad {

[self hideKeyboard];

UIScreenEdgePanGestureRecognizer *mBackGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:) ];
[mBackGestureRecognizer setEdges:UIRectEdgeLeft];
[[self view] addGestureRecognizer:mBackGestureRecognizer];

// Initialize the motion manager for accelerometer control.
self.motionManager = [[CMMotionManager alloc] init];
INFO_LOG(G3D, "Done with viewDidLoad.");
Expand Down Expand Up @@ -447,7 +447,7 @@ -(UIRectEdge)preferredScreenEdgesDeferringSystemGestures
} else {
INFO_LOG(SYSTEM, "Allow system gestures on the bottom");
// Allow task switching gestures to take precedence, without causing
// scroll events in the UI.
// scroll events in the UI. Otherwise, we get "ghost" scrolls when switching tasks.
return UIRectEdgeTop | UIRectEdgeLeft | UIRectEdgeRight;
}
}
Expand All @@ -456,6 +456,24 @@ - (void)uiStateChanged
{
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
[self hideKeyboard];
[self updateGesture];
}

- (void)updateGesture {
INFO_LOG(SYSTEM, "Updating swipe gesture.");

if (mBackGestureRecognizer) {
INFO_LOG(SYSTEM, "Removing swipe gesture.");
[[self view] removeGestureRecognizer:mBackGestureRecognizer];
mBackGestureRecognizer = nil;
}

if (GetUIState() != UISTATE_INGAME) {
INFO_LOG(SYSTEM, "Adding swipe gesture.");
mBackGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:) ];
[mBackGestureRecognizer setEdges:UIRectEdgeLeft];
[[self view] addGestureRecognizer:mBackGestureRecognizer];
}
}

- (UIView *)getView {
Expand Down
30 changes: 24 additions & 6 deletions ios/ViewControllerMetal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ @interface PPSSPPViewControllerMetal () {

@end // @interface

@implementation PPSSPPViewControllerMetal
@implementation PPSSPPViewControllerMetal {
UIScreenEdgePanGestureRecognizer *mBackGestureRecognizer;
}

- (id)init {
self = [super init];
Expand Down Expand Up @@ -440,10 +442,6 @@ - (void)viewDidLoad {
locationHelper = [[LocationHelper alloc] init];
[locationHelper setDelegate:self];

UIScreenEdgePanGestureRecognizer *mBackGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:) ];
[mBackGestureRecognizer setEdges:UIRectEdgeLeft];
[[self view] addGestureRecognizer:mBackGestureRecognizer];

// Initialize the motion manager for accelerometer control.
self.motionManager = [[CMMotionManager alloc] init];
}
Expand Down Expand Up @@ -478,7 +476,8 @@ - (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
INFO_LOG(G3D, "viewDidAppear");
[self hideKeyboard];
INFO_LOG(G3D, "viewDidAppearDone");
[self updateGesture];

}

- (BOOL)prefersHomeIndicatorAutoHidden {
Expand Down Expand Up @@ -529,6 +528,25 @@ - (void)uiStateChanged
{
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
[self hideKeyboard];
[self updateGesture];
}


- (void)updateGesture {
INFO_LOG(SYSTEM, "Updating swipe gesture.");

if (mBackGestureRecognizer) {
INFO_LOG(SYSTEM, "Removing swipe gesture.");
[[self view] removeGestureRecognizer:mBackGestureRecognizer];
mBackGestureRecognizer = nil;
}

if (GetUIState() != UISTATE_INGAME) {
INFO_LOG(SYSTEM, "Adding swipe gesture.");
mBackGestureRecognizer = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:) ];
[mBackGestureRecognizer setEdges:UIRectEdgeLeft];
[[self view] addGestureRecognizer:mBackGestureRecognizer];
}
}

- (void)bindDefaultFBO
Expand Down