Bladeren bron

iOS Update

Josh Engebretson 10 jaren geleden
bovenliggende
commit
3dbefa96ec

+ 1 - 1
Source/Atomic/Input/Input.cpp

@@ -673,7 +673,7 @@ static void PopulateMouseButtonBindingMap(HashMap<String, int>& mouseButtonBindi
     }
 }
 
-SDL_JoystickID Input::AddScreenJoystick(XMLFile* layoutFile, XMLFile* styleFile)
+int Input::AddScreenJoystick(XMLFile* layoutFile, XMLFile* styleFile)
 {
     static HashMap<String, int> keyBindingMap;
     static HashMap<String, int> mouseButtonBindingMap;

+ 1 - 1
Source/Atomic/Input/Input.h

@@ -171,7 +171,7 @@ public:
      *
      *  This method should only be called in main thread.
      */
-    SDL_JoystickID AddScreenJoystick(XMLFile* layoutFile = 0, XMLFile* styleFile = 0);
+    int AddScreenJoystick(XMLFile* layoutFile = 0, XMLFile* styleFile = 0);
     /// Remove screen joystick by instance ID.
     /** Return true if successful.
      *

+ 7 - 9
Source/Atomic/Javascript/JSAtomic.cpp

@@ -3,6 +3,7 @@
 // https://github.com/AtomicGameEngine/AtomicGameEngine
 
 #include "Precompiled.h"
+#include "../Core/ProcessUtils.h"
 #include "../IO/FileSystem.h"
 #include "../IO/Log.h"
 #include "../Resource/ResourceCache.h"
@@ -235,16 +236,13 @@ void jsapi_init_atomic(JSVM* vm)
     // Atomic
     duk_get_global_string(ctx, "Atomic");
 
-#ifdef ATOMIC_PLATFORM_OSX
-    duk_push_string(ctx, "Mac");
-    duk_put_prop_string(ctx, -2, "platform");
-#elif ATOMIC_PLATFORM_WINDOWS
-    duk_push_string(ctx, "Windows");
-    duk_put_prop_string(ctx, -2, "platform");
-#elif ATOMIC_PLATFORM_ANDROID
-    duk_push_string(ctx, "Android");
+
+    String platform = GetPlatform();
+    if (platform == "Mac OS X")
+        platform = "MacOSX";
+
+    duk_push_string(ctx, platform.CString());
     duk_put_prop_string(ctx, -2, "platform");
-#endif
 
     // Node registry
     duk_push_global_stash(ctx);

+ 4 - 0
Source/AtomicEditor/Source/Player/AEPlayer.cpp

@@ -6,6 +6,7 @@
 
 #include <Atomic/Core/Context.h>
 #include <Atomic/IO/FileSystem.h>
+#include <Atomic/Input/Input.h>
 #include <Atomic/Resource/ResourceCache.h>
 #include <Atomic/Javascript/Javascript.h>
 #include <Atomic/Javascript/JSVM.h>
@@ -55,6 +56,9 @@ AEPlayer::~AEPlayer()
     if (javascript)
         javascript->ShutdownVM("AEPlayerVM");
     vm_ = NULL;
+
+    GetSubsystem<Input>()->SetTouchEmulation(false);
+
 }
 
 void AEPlayer::Invalidate()

+ 1 - 1
Source/AtomicPlayer/AtomicPlayer.cpp

@@ -67,7 +67,7 @@ void AtomicPlayer::Setup()
     engineParameters_["WindowWidth"] = 1280;
     engineParameters_["WindowHeight"] = 720;
 #elif ATOMIC_PLATFORM_IOS
-    engineParameters_["FullScreen"] = true;
+    engineParameters_["FullScreen"] = false;
     engineParameters_["ResourcePaths"] = "AtomicResources";
 #else
     engineParameters_["ResourcePaths"] = "AtomicResources";