2
0
Эх сурвалжийг харах

Merge pull request #357 from 3dDeters/3dDeters-patch-1

3d deters patch 1 - iOS Display
Peter Robinson 9 жил өмнө
parent
commit
62762827af

+ 8 - 1
engine/source/platformiOS/iOSWindow.mm

@@ -121,6 +121,13 @@ void Platform::setWindowTitle(const char *title)
 //------------------------------------------------------------------------------
 void Platform::init()
 {
+    // Create two variables that I use later to make the canvas the right size
+    CGRect screenBounds = [[UIScreen mainScreen] bounds];
+    CGFloat screenScale = [[UIScreen mainScreen] scale];
+    
+    Con::setFloatVariable("$iOSwidth", screenBounds.size.width * screenScale);
+    Con::setFloatVariable("$iOSheight", screenBounds.size.height * screenScale);
+
     Con::setVariable("$platform", "iOS");
     
     if ([[UIScreen mainScreen] scale] == 2)
@@ -456,4 +463,4 @@ ConsoleFunction(setStatusBarHidden, bool, 2, 2, " Hides/unhides the iOS status b
 
 ConsoleFunction(setStatusBarType, void, 2, 2, " Set the status bar type. 0 hidden, 1 Black Opaque, 2 Black Translucent \n"){
     return setStatusBarType(dAtoi(argv[1]));
-}
+}

+ 2 - 2
modules/AppCore/1/scripts/canvas.cs

@@ -44,9 +44,9 @@ function initializeCanvas(%windowName)
 
     $pref::iOS::ScreenDepth = 32;
 
-    if ( $pref::iOS::DeviceType !$= "" )
+    if ($platform $= "iOS")
     {
-        %resolution = iOSResolutionFromSetting($pref::iOS::DeviceType, $pref::iOS::ScreenOrientation);
+        %resolution = $iOSwidth SPC $iOSheight SPC "32";
     }
     else if ($platform $= "Android")
     {