mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
add overriding launch type via environment variable VCMI_LAUNCH_TYPE
This commit is contained in:
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
#import <objc/runtime.h>
|
#import <objc/runtime.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
static void startSDLManually(int argc, char * argv[])
|
static void startSDLManually(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
id<UIApplicationDelegate> appDelegate;
|
id<UIApplicationDelegate> appDelegate;
|
||||||
@@ -33,8 +35,13 @@ int qt_main_wrapper(int argc, char * argv[]);
|
|||||||
int client_main(int argc, char * argv[])
|
int client_main(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
NSInteger launchType;
|
NSInteger launchType;
|
||||||
@autoreleasepool {
|
__auto_type envVar = getenv("VCMI_LAUNCH_TYPE");
|
||||||
launchType = [NSUserDefaults.standardUserDefaults integerForKey:@"LaunchType"];
|
if (envVar)
|
||||||
|
launchType = envVar[0] == '0' ? 0 : 1;
|
||||||
|
else {
|
||||||
|
@autoreleasepool {
|
||||||
|
launchType = [NSUserDefaults.standardUserDefaults integerForKey:@"LaunchType"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (launchType == 1)
|
if (launchType == 1)
|
||||||
return startSDL(argc, argv, NO);
|
return startSDL(argc, argv, NO);
|
||||||
|
Reference in New Issue
Block a user