IOS buildfix

This commit is contained in:
Henrik Rydgård 2016-01-03 15:19:43 +01:00
parent f7f9f321a0
commit 517c5183ac
2 changed files with 12 additions and 3 deletions

1
b.sh
View File

@ -28,6 +28,7 @@ do
--ios) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=ios/ios.toolchain.cmake -GXcode ${CMAKE_ARGS}"
TARGET_OS=iOS
PACKAGE=1
echo !!!!!!!!!!!!!!! The error below is expected. Go into build-ios and open the XCodeProj.
;;
--android) CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=android/android.toolchain.cmake ${CMAKE_ARGS}"
TARGET_OS=Android

View File

@ -15,6 +15,7 @@
#include "input/input_state.h"
#include "net/resolve.h"
#include "ui/screen.h"
#include "thin3d/thin3d.h"
#include "input/keycodes.h"
#include "Core/Config.h"
@ -32,6 +33,13 @@
#define kCFCoreFoundationVersionNumber_IOS_9_0 1240.10
#endif
class IOSDummyGraphicsContext : public DummyGraphicsContext {
public:
Thin3DContext *CreateThin3DContext() override {
return T3DCreateGLContext();
}
};
float dp_xscale = 1.0f;
float dp_yscale = 1.0f;
@ -104,7 +112,7 @@ static GraphicsContext *graphicsContext;
targetIsJailbroken = true;
// if we're running on iOS arm64, only iOS <9 is supported with JIT.
// if we're running on anything that isn't arm64, then JIT is supported on all iOS versions.
if (![self isArm64] || [self isArm64] && kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_IOS_9_0) {
if (![self isArm64] || ([self isArm64] && kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber_IOS_9_0)) {
iosCanUseJit = true;
}
}
@ -179,9 +187,9 @@ static GraphicsContext *graphicsContext;
pixel_in_dps = (float)pixel_xres / (float)dp_xres;
graphicsContext = new DummyGraphicsContext();
graphicsContext = new IOSDummyGraphicsContext();
NativeInitGraphics();
NativeInitGraphics(graphicsContext);
dp_xscale = (float)dp_xres / (float)pixel_xres;
dp_yscale = (float)dp_yres / (float)pixel_yres;