Browse Source

Standalone C# editing

Josh Engebretson 9 years ago
parent
commit
698448afdd

+ 8 - 0
Build/Scripts/BuildWindows.js

@@ -56,6 +56,14 @@ namespace('build', function() {
       fs.copySync(buildDir +  "Source/AtomicPlayer/Application/Release/D3DCompiler_47.dll",
       fs.copySync(buildDir +  "Source/AtomicPlayer/Application/Release/D3DCompiler_47.dll",
         editorAppFolder + "Resources/ToolData/Deployment/Windows/x64/D3DCompiler_47.dll");
         editorAppFolder + "Resources/ToolData/Deployment/Windows/x64/D3DCompiler_47.dll");
 
 
+      // AtomicNET
+
+      fs.copySync(atomicRoot + "Artifacts/AtomicNET/Release",
+        editorAppFolder + "Resources/ToolData/AtomicNET/Release");
+
+      fs.copySync(buildDir +  "Source/AtomicPlayer/Application/Release/D3DCompiler_47.dll",
+        editorAppFolder + "Resources/ToolData/AtomicNET/Release/D3DCompiler_47.dll");
+
       console.log("Atomic Editor build to ", editorAppFolder);
       console.log("Atomic Editor build to ", editorAppFolder);
 
 
       complete();
       complete();

+ 2 - 1
Build/Scripts/Windows/CompileAtomicEditor.bat

@@ -1,3 +1,4 @@
 call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
 call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
 cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
 cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
-msbuild /m Atomic.sln /t:AtomicEditor /t:AtomicPlayer /p:Configuration=Release /p:Platform=x64
+msbuild /m Atomic.sln /t:AtomicEditor;AtomicPlayer;AtomicNETNative /p:Configuration=Release /p:Platform=x64
+msbuild Source/AtomicTool/GenerateAtomicNET.vcxproj /p:Configuration=Release /p:Platform=x64

+ 13 - 3
Source/AtomicApp/Player/IPCPlayerApp.cpp

@@ -75,6 +75,9 @@ namespace Atomic
             ErrorExit("IPCPlayerApp::ProcessArguments FileSystem subsystem does not exist");
             ErrorExit("IPCPlayerApp::ProcessArguments FileSystem subsystem does not exist");
         }
         }
 
 
+        String resourcePrefix;
+        engineParameters_["ResourcePrefixPath"] = "";
+
         for (unsigned i = 0; i < arguments_.Size(); ++i)
         for (unsigned i = 0; i < arguments_.Size(); ++i)
         {
         {
             if (arguments_[i].Length() > 1)
             if (arguments_[i].Length() > 1)
@@ -90,10 +93,13 @@ namespace Atomic
                 {
                 {
                     debugPlayer_ = true;
                     debugPlayer_ = true;
                 }
                 }
+                else if (argument == "--resourceprefix" && value.Length())
+                {
+                    resourcePrefix = value;
+                    engineParameters_["ResourcePrefixPath"] = resourcePrefix;
+                }
                 else if (argument == "--project" && value.Length())
                 else if (argument == "--project" && value.Length())
                 {
                 {
-                    engineParameters_["ResourcePrefixPath"] = "";
-
                     value = AddTrailingSlash(value);
                     value = AddTrailingSlash(value);
 
 
                     AddEngineConfigSearchPath(value + "Settings/");
                     AddEngineConfigSearchPath(value + "Settings/");
@@ -115,7 +121,11 @@ namespace Atomic
 #ifdef __APPLE__
 #ifdef __APPLE__
                     engineParameters_["ResourcePrefixPath"] = "../Resources";
                     engineParameters_["ResourcePrefixPath"] = "../Resources";
 #else
 #else
-                    engineParameters_["ResourcePrefixPath"] = fileSystem->GetProgramDir() + "Resources";
+                    if (!resourcePrefix.Length())
+                    {
+                        engineParameters_["ResourcePrefixPath"] = fileSystem->GetProgramDir() + "Resources";
+                    }
+
 #endif
 #endif
 
 
                     String resourcePaths = ToString("CoreData;PlayerData;%s/;%s/Resources;%s;%sCache",
                     String resourcePaths = ToString("CoreData;PlayerData;%s/;%s/Resources;%s;%sCache",

+ 6 - 0
Source/AtomicEditor/EditorMode/AEEditorMode.cpp

@@ -165,6 +165,12 @@ bool EditorMode::PlayProject(String addArgs, bool debug)
 
 
     vargs = args.Split(' ');
     vargs = args.Split(' ');
 
 
+    if (managed)
+    {            
+        vargs.Insert(0, ToString("\"%s\"", (fileSystem->GetProgramDir() + "Resources/").CString()));        
+        vargs.Insert(0, "--resourcePrefix");
+    }
+
     if (debug)
     if (debug)
         vargs.Insert(0, "--debug");
         vargs.Insert(0, "--debug");
 
 

+ 5 - 0
Source/ToolCore/NETTools/NETProjectGen.cpp

@@ -439,7 +439,12 @@ namespace ToolCore
                     XMLElement propertyGroup = project.CreateChild("PropertyGroup");
                     XMLElement propertyGroup = project.CreateChild("PropertyGroup");
                     propertyGroup.SetAttribute("Condition", ToString("'$(Configuration)|$(Platform)' == '%s|AnyCPU'", cfg.CString()));
                     propertyGroup.SetAttribute("Condition", ToString("'$(Configuration)|$(Platform)' == '%s|AnyCPU'", cfg.CString()));
 
 
+#ifdef ATOMIC_DEV_BUILD
                     String playerBin = tenv->GetAtomicNETRootDir() + cfg + "/AtomicPlayer.exe";
                     String playerBin = tenv->GetAtomicNETRootDir() + cfg + "/AtomicPlayer.exe";
+#else
+                    String playerBin = tenv->GetAtomicNETRootDir() + "Release/AtomicPlayer.exe";
+#endif
+
                     propertyGroup.CreateChild("StartAction").SetValue("Program");                    
                     propertyGroup.CreateChild("StartAction").SetValue("Program");                    
                     propertyGroup.CreateChild("StartProgram").SetValue(playerBin );
                     propertyGroup.CreateChild("StartProgram").SetValue(playerBin );
                     propertyGroup.CreateChild("StartArguments").SetValue(ToString("--project %s", atomicProject->GetProjectPath().CString()));
                     propertyGroup.CreateChild("StartArguments").SetValue(ToString("--project %s", atomicProject->GetProjectPath().CString()));

+ 8 - 0
Source/ToolCore/ToolEnvironment.cpp

@@ -74,6 +74,14 @@ bool ToolEnvironment::InitFromPackage()
 
 
     toolDataDir_ =  resourcesDir + "ToolData/";
     toolDataDir_ =  resourcesDir + "ToolData/";
 
 
+    // AtomicNET
+
+    // atomicNETNuGetBinary_ = ToString("%sBuild/Managed/nuget/nuget.exe", rootSourceDir_.CString());
+
+    atomicNETRootDir_ = resourcesDir + "ToolData/AtomicNET/";
+    atomicNETCoreAssemblyDir_ = atomicNETRootDir_ + "Release/";
+    atomicNETManagedPlayerBinary_ = atomicNETCoreAssemblyDir_ + "AtomicPlayer.exe";
+
     return true;
     return true;
 }
 }