Browse Source

Improvement to Android deployment

Josh Engebretson 10 years ago
parent
commit
29d00368e7

+ 11 - 1
Source/AtomicEditor/Source/AEApplication.cpp

@@ -9,6 +9,7 @@
 #include <Atomic/IO/Log.h>
 #include <Atomic/Core/Main.h>
 #include <Atomic/Core/ProcessUtils.h>
+#include <Atomic/Graphics/Graphics.h>
 #include <Atomic/Resource/ResourceCache.h>
 #include <Atomic/Resource/ResourceEvents.h>
 #include <Atomic/DebugNew.h>
@@ -94,9 +95,18 @@ void AEApplication::Start()
 
     Input* input = GetSubsystem<Input>();
 
-
     input->SetMouseVisible(true);
 
+ #ifdef ATOMIC_PLATFORM_WINDOWS
+    // on windows maximize, otherwise window does funky thing with "restore down"
+    // todo: better way of handling this?  Windows 8 restore down goes below taskbar :(
+    Graphics* graphics = GetSubsystem<Graphics>();
+    IntVector2 resolution = graphics->GetDesktopResolution();
+    int height = graphics->GetHeight();
+    if ( Abs(height - resolution.y_) < 128)
+        GetSubsystem<Graphics>()->Maximize();
+ #endif
+
     context_->RegisterSubsystem(new EditorStrings(context_));
     context_->RegisterSubsystem(new EditorShortcuts(context_));
     context_->RegisterSubsystem(new ProjectUtils(context_));

+ 17 - 1
Source/AtomicEditor/Source/Build/BuildAndroid.cpp

@@ -376,6 +376,15 @@ void BuildAndroid::Build(const String& buildPath)
     String coreDataFolder = buildSourceDir + "CoreData/";
 
     fileSystem->CopyDir(androidProject, buildPath_);
+
+    if (!fileSystem->DirExists(buildPath_))
+    {
+        BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
+        buildSystem->BuildComplete(AE_PLATFORM_ANDROID, buildPath_, false);
+        editor->PostModalInfo("Build Error", ToString("Build Folder:\n\n %s\n\ncould not be written to, is it in use?", buildPath_.CString()));
+        return;
+    }
+
     fileSystem->CopyDir(projectResources, buildPath_ + "/assets/AtomicResources");    
     fileSystem->CopyDir(coreDataFolder, buildPath_ + "/assets/CoreData");
 
@@ -386,7 +395,14 @@ void BuildAndroid::Build(const String& buildPath)
 
     AndroidProjectGenerator gen(context_);
     gen.SetBuildPath(buildPath_);
-    gen.Generate();
+
+    if (!gen.Generate())
+    {
+        BuildSystem* buildSystem = GetSubsystem<BuildSystem>();
+        buildSystem->BuildComplete(AE_PLATFORM_ANDROID, buildPath_, false);
+        editor->PostModalInfo("Build Error", ToString("Unable to generate Android project, please check build settings and try again"));
+        return;
+    }
 
     // RunAndroidUpdate();
     RunAntDebug();