Skip to content

Commit

Permalink
Disable Zink on iOS 16 and later with release builds
Browse files Browse the repository at this point in the history
Don't want users switching to Zink and asking why it's broken. Temporary measure until we can get our copy updated and working
  • Loading branch information
crystall1nedev committed Apr 21, 2023
1 parent 6c10c41 commit b396fef
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
50 changes: 36 additions & 14 deletions Natives/LauncherPreferencesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
typedef void(^CreateView)(UITableViewCell *, NSString *, NSDictionary *);

@interface LauncherPreferencesViewController(){}
@property(nonatomic) NSArray<NSString*>* prefSections;
@property(nonatomic) NSArray<NSString*>* prefSections, *rendererKeys, *rendererList;
@property(nonatomic) NSMutableArray<NSNumber*>* prefSectionsVisibility;
@property(nonatomic) NSArray<NSArray<NSDictionary*>*>* prefContents;
@property(nonatomic) BOOL prefDetailVisible;
Expand Down Expand Up @@ -60,6 +60,37 @@ - (void)viewDidLoad
for (int i = 0; i < self.prefSections.count; i++) {
[self.prefSectionsVisibility addObject:@NO];
}

#if CONFIG_RELEASE
if(@available(iOS 16.0, *)) {
// Disabling Zink on iOS 16.0+ to figure out what's wrong with it
self.rendererKeys = @[
@"auto",
@ RENDERER_NAME_GL4ES,
@ RENDERER_NAME_MTL_ANGLE
];
self.rendererList = @[
localize(@"preference.title.renderer.auto", nil),
localize(@"preference.title.renderer.gl4es", nil),
localize(@"preference.title.renderer.angle", nil)
];
} else {
#endif
self.rendererKeys = @[
@"auto",
@ RENDERER_NAME_GL4ES,
@ RENDERER_NAME_MTL_ANGLE,
@ RENDERER_NAME_VK_ZINK
];
self.rendererList = @[
localize(@"preference.title.renderer.auto", nil),
localize(@"preference.title.renderer.gl4es", nil),
localize(@"preference.title.renderer.angle", nil),
localize(@"preference.title.renderer.zink", nil)
];
#if CONFIG_RELEASE
}
#endif

self.prefContents = @[
@[
Expand Down Expand Up @@ -92,7 +123,7 @@ - (void)viewDidLoad
@"type": self.typeSwitch,
@"action": ^(BOOL enabled){
debugLogEnabled = enabled;
NSLog(@"Debug log enabled: %@", enabled ? @"YES" : @"NO");
NSLog(@"[Debugging] Debug log enabled: %@", enabled ? @"YES" : @"NO");
}
},
@{@"key": @"jitstreamer_server",
Expand Down Expand Up @@ -190,21 +221,12 @@ - (void)viewDidLoad
// Video and renderer settings
@{@"icon": @"video"},
@{@"key": @"renderer",
@"hasDetail": @YES,
@"icon": @"cpu",
@"type": self.typePickField,
@"enableCondition": whenNotInGame,
@"pickKeys": @[
@"auto",
@ RENDERER_NAME_GL4ES,
@ RENDERER_NAME_MTL_ANGLE,
@ RENDERER_NAME_VK_ZINK
],
@"pickList": @[
localize(@"preference.title.renderer.auto", nil),
localize(@"preference.title.renderer.gl4es", nil),
localize(@"preference.title.renderer.angle", nil),
localize(@"preference.title.renderer.zink", nil)
]
@"pickKeys": self.rendererKeys,
@"pickList": self.rendererList
},
@{@"key": @"resolution",
@"hasDetail": @YES,
Expand Down
2 changes: 1 addition & 1 deletion Natives/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"preference.title.renderer.gl4es" = "holy gl4es - exports OpenGL 2.1";
"preference.title.renderer.angle" = "ANGLE (1.17+) - exports OpenGL 3.2 (Core Profile, limited)";
"preference.title.renderer.zink" = "Zink (Mesa 21.0) - exports OpenGL 4.1";
"preference.detail.renderer" = "Change the OpenGL render engine to use";
"preference.detail.renderer" = "Change the OpenGL render engine to use. Zink is temporarily disabled on iOS 16 and later to diagnose issues.";

"preference.title.resolution" = "Resolution (%)";
"preference.detail.resolution" = "Allows you to decrease the game resolution.";
Expand Down
Binary file modified Natives/resources/Assets.car
Binary file not shown.

0 comments on commit b396fef

Please sign in to comment.