Browse Source

Merge pull request #1022 from JimMarlowe/JM-REL-STUFF

Basket of Unamables
JoshEngebretson 9 years ago
parent
commit
18397e5169
35 changed files with 361 additions and 56 deletions
  1. BIN
      Data/AtomicEditor/ExampleInfo/Example.png
  2. 267 15
      Data/AtomicEditor/ExampleInfo/Examples.json
  3. BIN
      Resources/EditorData/AtomicEditor/editor/images/earlyaccess_header.png
  4. 0 12
      Resources/EditorData/AtomicEditor/editor/ui/mainframe.tb.txt
  5. 1 1
      Resources/EditorData/AtomicEditor/editor/ui/welcomeframe.tb.txt
  6. BIN
      Resources/PlayerData/DefaultUI/skin/checkbox_mark.png
  7. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  8. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  9. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  10. BIN
      Resources/PlayerData/DefaultUI/skin/checkbox_mark_grey.png
  11. BIN
      Resources/PlayerData/DefaultUI/skin/checkbox_mark_nonuniform.png
  12. BIN
      Resources/PlayerData/DefaultUI/skin/radio_mark.png
  13. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  14. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  15. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  16. BIN
      Resources/PlayerData/DefaultUI/skin/scroll_fg_x.png
  17. BIN
      Resources/PlayerData/DefaultUI/skin/scroll_fg_y.png
  18. BIN
      Resources/PlayerData/DefaultUI/skin/slider_handle.png
  19. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  20. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  21. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  22. BIN
      Resources/PlayerData/DefaultUI/skin/toggle_section_icon_down.png
  23. BIN
      Resources/PlayerData/DefaultUI/skin/toggle_section_icon_middle.png
  24. BIN
      Resources/PlayerData/DefaultUI/skin/toggle_section_icon_up.png
  25. BIN
      Resources/PlayerData/DefaultUI/skin/window_close.png
  26. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  27. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  28. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  29. BIN
      Resources/PlayerData/DefaultUI/skin/window_close_pressed.png
  30. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  31. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  32. BIN
      Resources/PlayerData/DefaultUI/skin/[email protected]
  33. 49 3
      Source/Atomic/Engine/Engine.cpp
  34. 25 0
      Source/Atomic/Engine/Engine.h
  35. 19 25
      Source/AtomicEditor/Utils/FileUtils.cpp

BIN
Data/AtomicEditor/ExampleInfo/Example.png


+ 267 - 15
Data/AtomicEditor/ExampleInfo/Examples.json

@@ -1,9 +1,104 @@
 {
 	"examples" : [
 			{
-				"name": "Physics Platformer 2D",
+				"name": "C# Basic2D",
+				"desc" : "The C# Basic2D example project",
+				"screenshot" : "Basic2D.png",
+				"templates" : [
+					{
+						"language" : "C#",
+						"folder" : "AtomicNET/Basic2D"
+					}
+				],
+				"module" : "2D"
+			},
+			{
+				"name": "C# Basic3D",
+				"desc" : "The C# Basic3D example project",
+				"screenshot" : "Basic3D.png",
+				"templates" : [
+					{
+						"language" : "C#",
+						"folder" : "AtomicNET/Basic3D"
+					}
+				],
+				"module" : "3D"
+			},
+			{
+				"name": "C# Physics2D",
 				"desc" : "Moving platforms, vines, and neat 2D lighting",
 				"screenshot" : "PhysicsPlatformer2D.png",
+				"templates" : [
+					{
+						"language" : "C#",
+						"folder" : "AtomicNET/Physics2D"
+					}
+				],
+				"module" : "2D"
+			},
+			{
+				"name": "C# Butterflies",
+				"desc" : "An example of particles driven by C#",
+				"screenshot" : "Butterflies.png",
+				"templates" : [
+					{
+						"language" : "C#",
+						"folder" : "AtomicNET/Butterflies"
+					}
+				],
+				"module" : "2D"
+			},
+			{
+				"name": "C# Atomic Mutant",
+				"desc" : "A 3D physics example featuring a terrifying mutant",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "C#",
+						"folder" : "AtomicNET/AtomicMutant"
+					}
+				],
+				"module" : "3D"
+			},
+			{
+				"name": "C# Atomic Blaster",
+				"desc" : "An example of a ported XNA C# program",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "C#",
+						"folder" : "AtomicNET/AtomicBlaster"
+					}
+				],
+				"module" : "3D"
+			},
+			{
+				"name": "Javascript Basic 2D",
+				"desc" : "A Javascript example of a 2D sprite in a scene",
+				"screenshot" : "Basic2D.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "Basic2D"
+					}
+				],
+				"module" : "2D"
+			},
+			{
+				"name": "Javascript Basic 3D",
+				"desc" : "A Javascript example of a 3D object in a scene",
+				"screenshot" : "Basic3D.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "Basic3D"
+					}
+				],
+				"module" : "3D"
+			},			{
+				"name": "Physics Platformer 2D",
+				"desc" : "Moving platforms, vines, and neat 2D lighting in Javascript",
+				"screenshot" : "PhysicsPlatformer2D.png",
 				"templates" : [
 					{
 						"language" : "JavaScript",
@@ -14,7 +109,7 @@
 			},
 			{
 				"name": "ToonTown",
-				"desc" : "Town, Terrain, Day/Night Cycles",
+				"desc" : "Town, Terrain, Day/Night Cycles in Javascript",
 				"screenshot" : "ToonTown.png",
 				"templates" : [
 					{
@@ -26,7 +121,7 @@
 			},
 			{
 				"name": "SpaceGame",
-				"desc" : "A 2D Arcade Space Game",
+				"desc" : "A 2D Arcade Space Game in Javascript",
 				"screenshot" : "SpaceGame.png",
 				"templates" : [
 					{
@@ -241,40 +336,197 @@
 				"module" : "2D"
 			},
 			{
-				"name": "Basic 2D",
-				"desc" : "An example of a 2D sprite in a scene",
-				"screenshot" : "Basic2D.png",
+				"name": "Event Loop",
+				"desc" : "An example using the JavaScript event loop",
+				"screenshot" : "EventLoop.png",
 				"templates" : [
 					{
 						"language" : "JavaScript",
-						"folder" : "Basic2D"
+						"folder" : "EventLoop"
 					}
 				],
 				"module" : "2D"
 			},
+            
 			{
-				"name": "Basic 3D",
-				"desc" : "An example of a 3D object in a scene",
-				"screenshot" : "Basic3D.png",
+				"name": "PBR Scene",
+				"desc" : "An example of PBR scene",
+				"screenshot" : "Example.png",
 				"templates" : [
 					{
 						"language" : "JavaScript",
-						"folder" : "Basic3D"
+						"folder" : "PBRSceneExample"
 					}
 				],
 				"module" : "3D"
 			},
 			{
-				"name": "Event Loop",
-				"desc" : "An example using the JavaScript event loop",
-				"screenshot" : "EventLoop.png",
+				"name": "Custom Geometry",
+				"desc" : "An example of custom geometry",
+				"screenshot" : "Example.png",
 				"templates" : [
 					{
 						"language" : "JavaScript",
-						"folder" : "EventLoop"
+						"folder" : "CustomGeometry"
+					}
+				],
+				"module" : "3D"
+			},
+			{
+				"name": "Editor Plugin",
+				"desc" : "An example of an Editor Plugin",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "Typescript",
+						"folder" : "EditorPluginExample"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "File Access",
+				"desc" : "An example of using files in Atomic",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "FileExample"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "Http Request",
+				"desc" : "An example of a HttpRequest",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "HttpRequestExample"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "MultiScript",
+				"desc" : "An example of a MultiScript program",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "MultiScript"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "Native Plugin",
+				"desc" : "An example of a Native Plugin",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "NativePluginExample"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "TypeScript Roboman3D",
+				"desc" : "An example of Roboman3D in TypeScript",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "TypeScript",
+						"folder" : "Roboman3DTypeScript"
+					}
+				],
+				"module" : "3D"
+			},
+			{
+				"name": "Multiplayer SpaceGame",
+				"desc" : "An example of a Multiplayer SpaceGame",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "SpaceGameMultiplayer"
 					}
 				],
 				"module" : "2D"
+			},
+			{
+				"name": "Test Inspector Fields",
+				"desc" : "A Test of Inspector Fields",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "TestInspectorFields"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "WebRequest Headers",
+				"desc" : "An example of WebRequest Headers",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "WebRequestHeadersExample"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "Simple WebRequest",
+				"desc" : "An example of a simple WebRequest",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "WebRequestSimpleExample"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "WebSocket",
+				"desc" : "An example of a WebSocket",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "WebSocketExample"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "Web Texture",
+				"desc" : "An example of a Web Texture",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "WebTexture"
+					}
+				],
+				"module" : "1D"
+			},
+			{
+				"name": "WebView Properties",
+				"desc" : "An example of WebView Properties",
+				"screenshot" : "Example.png",
+				"templates" : [
+					{
+						"language" : "JavaScript",
+						"folder" : "WebViewProperties"
+					}
+				],
+				"module" : "1D"
 			}
 	]
 }

BIN
Resources/EditorData/AtomicEditor/editor/images/earlyaccess_header.png


+ 0 - 12
Resources/EditorData/AtomicEditor/editor/ui/mainframe.tb.txt

@@ -66,15 +66,3 @@ TBLayout: distribution: gravity, axis: y
                                     lp: height: 28, width:28
                         TBLayout: gravity: left right
                             TBWidget
-                        TBButton
-                            @include definitions>menubutton
-                            text Errors
-                            id menu errors
-                        TBButton
-                            @include definitions>menubutton
-                            text Issues
-                            id menu issues
-                        TBButton
-                            @include definitions>menubutton
-                            text Console
-                            id menu console

+ 1 - 1
Resources/EditorData/AtomicEditor/editor/ui/welcomeframe.tb.txt

@@ -17,7 +17,7 @@ TBLayout: distribution: gravity, size: available, axis: y, id: welcomelayout, po
             TBEditField: multiline: 1, styling: 1, gravity: all, id: welcome_text, readonly: 1, adapt-to-content: 0
                 font: size: 14
                 lp: max-width: 420, min-width: 420
-                text: "Welcome to the Atomic Game Engine Early Access\n\n" \
+                text: "Welcome to the Atomic Game Engine\n\n" \
                 "<color #D4FB79>First Steps</color>\n\n" \
                 "• Try out some of the example projects!\n\n" \
                 "• Create a new project based on a 2D or 3D template.\n\n" \

BIN
Resources/PlayerData/DefaultUI/skin/checkbox_mark.png


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/checkbox_mark_grey.png


BIN
Resources/PlayerData/DefaultUI/skin/checkbox_mark_nonuniform.png


BIN
Resources/PlayerData/DefaultUI/skin/radio_mark.png


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/scroll_fg_x.png


BIN
Resources/PlayerData/DefaultUI/skin/scroll_fg_y.png


BIN
Resources/PlayerData/DefaultUI/skin/slider_handle.png


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/toggle_section_icon_down.png


BIN
Resources/PlayerData/DefaultUI/skin/toggle_section_icon_middle.png


BIN
Resources/PlayerData/DefaultUI/skin/toggle_section_icon_up.png


BIN
Resources/PlayerData/DefaultUI/skin/window_close.png


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/window_close_pressed.png


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


BIN
Resources/PlayerData/DefaultUI/skin/[email protected]


+ 49 - 3
Source/Atomic/Engine/Engine.cpp

@@ -111,7 +111,11 @@ Engine::Engine(Context* context) :
     initialized_(false),
     exiting_(false),
     headless_(false),
-    audioPaused_(false)
+    audioPaused_(false),
+    // ATOMIC BEGIN    
+    paused_(false),
+    runNextPausedFrame_(false)
+    // ATOMIC END
 {
     // Register self as a subsystem
     context_->RegisterSubsystem(this);
@@ -150,6 +154,10 @@ Engine::Engine(Context* context) :
 #endif
 
     SubscribeToEvent(E_EXITREQUESTED, ATOMIC_HANDLER(Engine, HandleExitRequested));
+    // ATOMIC BEGIN    
+    SubscribeToEvent(E_PAUSERESUMEREQUESTED, ATOMIC_HANDLER(Engine, HandlePauseResumeRequested));
+    SubscribeToEvent(E_PAUSESTEPREQUESTED, ATOMIC_HANDLER(Engine, HandlePauseStepRequested));
+    // ATOMIC END
 }
 
 Engine::~Engine()
@@ -469,8 +477,10 @@ void Engine::RunFrame()
 
     time->BeginFrame(timeStep_);
 
-    // If pause when minimized -mode is in use, stop updates and audio as necessary
-    if (pauseMinimized_ && input->IsMinimized())
+// ATOMIC BEGIN
+    // If paused, or pause when minimized -mode is in use, stop updates and audio as necessary
+    if ((paused_ && !runNextPausedFrame_) ||
+        (pauseMinimized_ && input->IsMinimized()))
     {
         if (audio->IsPlaying())
         {
@@ -486,9 +496,15 @@ void Engine::RunFrame()
             audio->Play();
             audioPaused_ = false;
         }
+        
+        // Only run one frame when stepping
+        runNextPausedFrame_ = false;
 
         Update();
+
     }
+// ATOMIC END
+
 
     Render();
     ApplyFrameLimit();
@@ -982,6 +998,36 @@ void Engine::DoExit()
 
 // ATOMIC BEGIN
 
+void Engine::SetPaused(bool paused)
+{
+    paused_ = paused;
+
+    using namespace UpdatesPaused;
+
+    // Updates paused event
+    VariantMap& eventData = GetEventDataMap();
+    eventData[P_PAUSED] = paused_;
+    SendEvent(E_UPDATESPAUSEDRESUMED, eventData);
+}
+
+void Engine::SetRunNextPausedFrame(bool run)
+{
+    runNextPausedFrame_ = run;
+}
+
+void Engine::HandlePauseResumeRequested(StringHash eventType, VariantMap& eventData)
+{
+    SetPaused(!IsPaused());
+}
+
+void Engine::HandlePauseStepRequested(StringHash eventType, VariantMap& eventData)
+{
+    if (IsPaused())
+    {
+        SetRunNextPausedFrame(true);
+    }
+}
+
 bool Engine::GetDebugBuild() const
 {
 #ifdef ATOMIC_DEBUG

+ 25 - 0
Source/Atomic/Engine/Engine.h

@@ -120,12 +120,29 @@ public:
 
 
     // ATOMIC BEGIN
+    /// Set whether the engine is paused.
+    void SetPaused(bool paused);
+    /// Set whether to run the next frame even if paused (for stepping frame by frame)
+    void SetRunNextPausedFrame(bool run);
+     /// Return whether the engine is paused.
+    bool IsPaused() const { return paused_; }
+    /// Return whether to run the next frame even if paused (for stepping frame by frame)
+    bool GetRunNextPausedFrame() const { return runNextPausedFrame_; }
+   
+    
     bool GetDebugBuild() const;
     // ATOMIC END
 
 private:
     /// Handle exit requested event. Auto-exit if enabled.
     void HandleExitRequested(StringHash eventType, VariantMap& eventData);
+    // ATOMIC BEGIN
+    /// Handle Pause or Resume requested event.
+    void HandlePauseResumeRequested(StringHash eventType, VariantMap& eventData);
+    /// Handle Single Step requested event.
+    void HandlePauseStepRequested(StringHash eventType, VariantMap& eventData);
+    // ATOMIC END
+
     /// Actually perform the exit actions.
     void DoExit();
 
@@ -159,6 +176,14 @@ private:
     bool headless_;
     /// Audio paused flag.
     bool audioPaused_;
+    
+    // ATOMIC BEGIN
+    /// Engine paused flag
+    bool paused_;
+    /// Whether to run the next frame even if paused (for stepping frame by frame)
+    bool runNextPausedFrame_;
+    // ATOMIC END
+   
 };
 
 }

+ 19 - 25
Source/AtomicEditor/Utils/FileUtils.cpp

@@ -45,11 +45,15 @@ FileUtils::~FileUtils()
 String FileUtils::OpenProjectFileDialog()
 {
     nfdchar_t *outPath = NULL;
-    
-    String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
+
+    String upath;
+
+#ifdef ATOMIC_PLATFORM_LINUX
+    upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
+#endif
 
     nfdresult_t result = NFD_OpenDialog( "atomic",
-                                GetNativePath(upath).CString(),
+                                upath.Length() ? GetNativePath(upath).CString() : "",
                                 &outPath);
 
     String fullpath;
@@ -86,10 +90,14 @@ String FileUtils::NewProjectFileDialog()
 
     nfdchar_t *outPath = NULL;
 
-    String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
+    String upath;
+    
+#ifdef ATOMIC_PLATFORM_LINUX
+    upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
+#endif
 
     nfdresult_t result = NFD_ChooseDirectory( "Please choose the root folder for your project",
-                                GetNativePath(upath).CString(),
+                                upath.Length() ? GetNativePath(upath).CString() : "",
                                 &outPath);
 
 
@@ -113,11 +121,8 @@ String FileUtils::GetBuildPath(const String& defaultPath)
 
     nfdchar_t *outPath = NULL;
     
-    String ppath = GetSubsystem<FileSystem>()->GetProgramDir();
-    if ( defaultPath.Length() > 0) ppath = defaultPath;
-
     nfdresult_t result = NFD_ChooseDirectory( "Please choose the build folder",
-                                GetNativePath(ppath).CString(),
+                                defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
                                 &outPath);
 
     if (outPath && result == NFD_OKAY)
@@ -146,11 +151,8 @@ String FileUtils::GetAntPath(const String& defaultPath)
     String msg = "Please select the folder which contains the ant executable";
 #endif
 
-    String ppath = GetSubsystem<FileSystem>()->GetProgramDir();
-    if ( defaultPath.Length() > 0) ppath = defaultPath;
-
     nfdresult_t result = NFD_ChooseDirectory(msg.CString(),
-                        GetNativePath(ppath).CString(),
+                        defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
                         &outPath);
 
     if (outPath && result == NFD_OKAY)
@@ -170,10 +172,8 @@ String FileUtils::GetMobileProvisionPath()
 {
     nfdchar_t *outPath = NULL;
 
-    String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
-
     nfdresult_t result = NFD_OpenDialog( "mobileprovision",
-                                GetNativePath(upath).CString(),
+                                "",
                                 &outPath);
 
     String fullpath;
@@ -208,12 +208,9 @@ String FileUtils::FindPath(const String& title, const String& defaultPath)
     String resultPath;
     nfdchar_t *outPath = NULL;
 
-    String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
-    if ( defaultPath.Length() > 0) upath = defaultPath;
-
     nfdresult_t result = NFD_ChooseDirectory(title.CString(),
-                        GetNativePath(upath).CString(),
-                        &outPath);
+                       defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
+                       &outPath);
 
     if (outPath && result == NFD_OKAY)
     {
@@ -233,11 +230,8 @@ String FileUtils::FindFile (const String& filterlist, const String& defaultPath)
     String fullpath;
     nfdchar_t *outPath = NULL;
 
-    String upath = GetSubsystem<FileSystem>()->GetUserDocumentsDir();
-    if ( defaultPath.Length() > 0) upath = defaultPath;
-
     nfdresult_t result = NFD_OpenDialog( filterlist.CString(),
-        GetNativePath(upath).CString(),
+        defaultPath.Length() ? GetNativePath(defaultPath).CString() : "",
         &outPath);
 
     if (outPath && result == NFD_OKAY)