Selaa lähdekoodia

Web Deployment work

Josh Engebretson 10 vuotta sitten
vanhempi
sitoutus
bcd66e7bbe

+ 3 - 3
Data/AtomicEditor/Deployment/Web/AtomicPlayer.html

@@ -6,7 +6,7 @@
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
     <script type="text/javascript" src="AtomicLoader.js"></script>
 
-    <title>Atomic Player</title>
+    <title>Atomic Web Player - Preview</title>
 
     <script>window.addEventListener("keydown", function(e) {
         // Disable stock behavior, which was causing scroll errors
@@ -81,8 +81,8 @@
       var playerCanvas = document.getElementById('atomic_player_canvas');
       var spinner = document.getElementById('atomic_spinner');
 
-      var width = $( window ).width();
-      var height = $( window ).height();
+      var width = $( window ).width() - 64;
+      var height = $( window ).height() - 64;
 
       new AtomicLoader(playerCanvas, spinner, width, height);
 

+ 1 - 1
Script/Packages/ToolCore/ToolCore.json

@@ -7,7 +7,7 @@
 							 "Asset", "AssetDatabase", "AssetImporter", "AudioImporter", "ModelImporter", "MaterialImporter", "AnimationImportInfo",
 							 "PrefabImporter", "JavascriptImporter", "TextureImporter", "SpriterImporter", "PEXImporter", "LicenseSystem",
 						 	 "ProjectUserPrefs", "ProjectBuildSettings",
-						 	 "BuildBase", "BuildSystem", "BuildMac"],
+						 	 "BuildBase", "BuildSystem", "BuildMac", "BuildWeb"],
 	"typescript_decl" : {
 
 		"AssetDatabase" : [

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

@@ -207,8 +207,8 @@ Input::Input(Context* context) :
     mouseMoveWheel_(0),
     windowID_(0),
     toggleFullscreen_(true),
-    mouseVisible_(false),
-    lastMouseVisible_(false),
+    mouseVisible_(true), // ATOMIC: default mouse visible
+    lastMouseVisible_(true),
     mouseGrabbed_(false),
     mouseMode_(MM_ABSOLUTE),
 #ifdef EMSCRIPTEN

+ 4 - 0
Source/Atomic/Scene/PrefabComponent.cpp

@@ -101,6 +101,8 @@ void PrefabComponent::LoadPrefabNode()
     this->SetTemporary(temporary);
     node->AddComponent(this, id, REPLICATED);
 
+#ifdef ATOMIC_3D
+
     // Get all the rigid bodies of the load node
     PODVector<RigidBody*> bodies;
     node_->GetComponents<RigidBody>(bodies, true);
@@ -111,6 +113,8 @@ void PrefabComponent::LoadPrefabNode()
         body->SetTransform(body->GetNode()->GetWorldPosition(), body->GetNode()->GetWorldRotation());
     }
 
+#endif
+
 }
 
 void PrefabComponent::BreakPrefab()

+ 14 - 5
Source/ToolCore/Build/BuildWeb.cpp

@@ -7,6 +7,7 @@
 #include <Atomic/IO/File.h>
 
 #include "../ToolSystem.h"
+#include "../ToolEnvironment.h"
 #include "../Project/Project.h"
 #include "BuildSystem.h"
 #include "BuildWeb.h"
@@ -27,20 +28,27 @@ BuildWeb::~BuildWeb()
 void BuildWeb::Initialize()
 {
     ToolSystem* tsystem = GetSubsystem<ToolSystem>();
+
     Project* project = tsystem->GetProject();
 
-    String dataPath = tsystem->GetDataPath();
+    Vector<String> defaultResourcePaths;
+    GetDefaultResourcePaths(defaultResourcePaths);
     String projectResources = project->GetResourcePath();
-    String coreDataFolder = dataPath + "CoreData/";
 
-    AddResourceDir(coreDataFolder);
+    for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
+    {
+        AddResourceDir(defaultResourcePaths[i]);
+    }
+
+    // TODO: smart filtering of cache
+    AddResourceDir(project->GetProjectPath() + "Cache/");
     AddResourceDir(projectResources);
 
     BuildResourceEntries();
 }
 void BuildWeb::Build(const String& buildPath)
 {
-    ToolSystem* tsystem = GetSubsystem<ToolSystem>();
+    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
 
     buildPath_ = AddTrailingSlash(buildPath) + GetBuildSubfolder();
 
@@ -50,7 +58,7 @@ void BuildWeb::Build(const String& buildPath)
     if (fileSystem->DirExists(buildPath_))
         fileSystem->RemoveDir(buildPath_, true);
 
-    String dataPath = tsystem->GetDataPath();
+    String dataPath = tenv->GetToolDataDir();
 
     String buildSourceDir  = dataPath + "Deployment/Web";
 
@@ -62,6 +70,7 @@ void BuildWeb::Build(const String& buildPath)
     fileSystem->Copy(buildSourceDir + "/AtomicPlayer.html", buildPath_ + "/AtomicPlayer.html");
     fileSystem->Copy(buildSourceDir + "/AtomicPlayer.html.mem", buildPath_ + "/AtomicPlayer.html.mem");
     fileSystem->Copy(buildSourceDir + "/AtomicPlayer.js", buildPath_ + "/AtomicPlayer.js");
+    fileSystem->Copy(buildSourceDir + "/AtomicLoader.js", buildPath_ + "/AtomicLoader.js");
 
     File file(context_, buildSourceDir + "/AtomicResources_js.template", FILE_READ);
     unsigned size = file.GetSize();