Browse Source

Remove hard coded Editor.html path, fix Xcode build, update WebView cmake script for Xcode paths

Josh Engebretson 10 years ago
parent
commit
d88a1dac07

+ 6 - 2
Build/CMake/Modules/AtomicWebView.cmake

@@ -83,8 +83,12 @@ macro(SET_CEF_TARGET_OUT_DIR)
     set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
   else()
     # ATOMIC: Unix Makefiles not creating Debug/Release?
-    set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
-    #set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
+
+    if(${CMAKE_GENERATOR} STREQUAL "Xcode")
+      set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
+    else()
+      set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+    endif()
   endif()
 endmacro()
 

+ 13 - 1
Source/AtomicEditor/Editors/JSResourceEditor.cpp

@@ -16,6 +16,8 @@
 #include <Atomic/Core/CoreEvents.h>
 #include <AtomicJS/Javascript/JSVM.h>
 
+#include <ToolCore/ToolEnvironment.h>
+
 #include <AtomicWebView/WebViewEvents.h>
 #include <AtomicWebView/UIWebView.h>
 #include <AtomicWebView/WebClient.h>
@@ -25,6 +27,7 @@
 
 
 using namespace tb;
+using namespace ToolCore;
 
 namespace AtomicEditor
 {
@@ -45,7 +48,16 @@ JSResourceEditor ::JSResourceEditor(Context* context, const String &fullpath, UI
 
     layout->AddChild(c);
 
-    String url = "file:///Users/josh/Dev/atomic/AtomicGameEngine/Data/AtomicEditor/CodeEditor/Editor.html";
+    ToolEnvironment* tenv = GetSubsystem<ToolEnvironment>();
+    String codeEditorDir = tenv->GetToolDataDir();
+    codeEditorDir += "CodeEditor/Editor.html";
+
+#ifdef ATOMIC_PLATFORM_OSX
+    String url = "file://" + codeEditorDir;
+#else
+    String url = "file:///" + codeEditorDir;
+#endif
+
     webView_ = new UIWebView(context_, url);
     webClient_ = webView_->GetWebClient();
     messageHandler_ = new WebMessageHandler(context_);

+ 1 - 1
Source/AtomicWebView/Internal/WebAppRenderer.cpp

@@ -172,7 +172,7 @@ bool WebAppRenderer::OnProcessMessageReceived(
         CefProcessId source_process,
         CefRefPtr<CefProcessMessage> message)
 {
-    DCHECK_EQ(source_process, PID_BROWSER);
+    assert(source_process == PID_BROWSER);
 
     bool handled = false;