mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-02 00:10:22 +02:00
support building against iOS SDK < 13.0
This commit is contained in:
parent
d2ded404bb
commit
b8eef4ce35
9
Global.h
9
Global.h
@ -264,6 +264,15 @@ template<typename T, size_t N> char (&_ArrayCountObj(const T (&)[N]))[N];
|
||||
// should be used for variables that becomes unused in release builds (e.g. only used for assert checks)
|
||||
#define UNUSED(VAR) ((void)VAR)
|
||||
|
||||
// old iOS SDKs compatibility
|
||||
#ifdef VCMI_IOS
|
||||
#include <AvailabilityVersions.h>
|
||||
|
||||
#ifndef __IPHONE_13_0
|
||||
#define __IPHONE_13_0 130000
|
||||
#endif
|
||||
#endif // VCMI_IOS
|
||||
|
||||
// single-process build makes 2 copies of the main lib by wrapping it in a namespace
|
||||
#ifdef VCMI_LIB_NAMESPACE
|
||||
#define VCMI_LIB_NAMESPACE_BEGIN namespace VCMI_LIB_NAMESPACE {
|
||||
|
@ -46,9 +46,11 @@
|
||||
textField.frame = r;
|
||||
self.gameChatHandler.textFieldSDL = textField;
|
||||
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
||||
if(@available(iOS 13.0, *))
|
||||
textField.backgroundColor = UIColor.systemBackgroundColor;
|
||||
else
|
||||
#endif
|
||||
textField.backgroundColor = UIColor.whiteColor;
|
||||
|
||||
auto longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
||||
|
@ -21,8 +21,10 @@ void launchGame(int argc, char * argv[]) {
|
||||
qtNativeWindow.hidden = YES;
|
||||
[qtNativeWindow.rootViewController.view removeFromSuperview];
|
||||
qtNativeWindow.rootViewController = nil;
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
||||
if (@available(iOS 13.0, *))
|
||||
qtNativeWindow.windowScene = nil;
|
||||
#endif
|
||||
}
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:@"StartGame" object:nil];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user