From 9d185ccc30ad5fe7eb716390ca2e7f5c06574ce0 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 6 Aug 2015 02:37:40 -0300 Subject: -Merged the file server with the live editing and remote debug -It is now really easy to deploy an android build with debug, and debug it --- platform/javascript/export/export.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'platform/javascript/export/export.cpp') diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 55b1ccbcaa..b262684a59 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -77,11 +77,11 @@ public: virtual int get_device_count() const { return show_run?1:0; }; virtual String get_device_name(int p_device) const { return "Run in Browser"; } virtual String get_device_info(int p_device) const { return "Run exported HTML in the system's default browser."; } - virtual Error run(int p_device,bool p_dumb=false); + virtual Error run(int p_device,bool p_dumb=false,bool p_remote_debug=false); virtual bool requieres_password(bool p_debug) const { return false; } virtual String get_binary_extension() const { return "html"; } - virtual Error export_project(const String& p_path,bool p_debug,bool p_dumb=false); + virtual Error export_project(const String& p_path,bool p_debug,bool p_dumb=false,bool p_remote_debug=false); virtual bool can_export(String *r_error=NULL) const; @@ -194,7 +194,7 @@ struct JSExportData { -Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool p_debug, bool p_dumb) { +Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool p_debug, bool p_dumb, bool p_remote_debug) { String src_template; @@ -299,7 +299,7 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool } -Error EditorExportPlatformJavaScript::run(int p_device, bool p_dumb) { +Error EditorExportPlatformJavaScript::run(int p_device, bool p_dumb, bool p_remote_debug) { String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp_export.html"; Error err = export_project(path,true,""); -- cgit v1.2.3 From 0fb7b5aa0c023d60880d259e70f7641152460aa6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Thu, 10 Sep 2015 00:10:54 -0300 Subject: HTML5 exporter Improvements -Better template handling -Voice support -Stream support --- platform/javascript/export/export.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'platform/javascript/export/export.cpp') diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index b262684a59..c38035e64a 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -144,12 +144,16 @@ static void _fix_html(Vector& html,const String& name,int max_memory) { str.parse_utf8((const char*)html.ptr(),html.size()); Vector lines=str.split("\n"); for(int i=0;i\n"; - strnew+="\n"; - } else if (lines[i].find("var Module")!=-1) { - strnew+=lines[i]; - strnew+="TOTAL_MEMORY:"+itos(max_memory*1024*1024)+","; + + if (lines[i].find("$GODOTTMEM")!=-1) { + + strnew+=lines[i].replace("$GODOTTMEM",itos(max_memory*1024*1024))+"\n"; + } else if (lines[i].find("$GODOTFS")!=-1) { + strnew+=lines[i].replace("$GODOTFS",name+"fs.js")+"\n"; + } else if (lines[i].find("$GODOTMEM")!=-1) { + strnew+=lines[i].replace("$GODOTMEM",name+".mem")+"\n"; + } else if (lines[i].find("$GODOTJS")!=-1) { + strnew+=lines[i].replace("$GODOTJS",name+".js")+"\n"; } else { strnew+=lines[i]+"\n"; } @@ -267,10 +271,10 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool _fix_html(data,p_path.get_file().basename(),1<<(max_memory+5)); file=p_path.get_file(); } - if (file=="filesystem.js") { + if (file=="godotfs.js") { _fix_files(data,len); - file=p_path.get_file().basename()+"_filesystem.js"; + file=p_path.get_file().basename()+"fs.js"; } if (file=="godot.js") { @@ -278,6 +282,12 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool file=p_path.get_file().basename()+".js"; } + if (file=="godot.mem") { + + //_fix_godot(data); + file=p_path.get_file().basename()+".mem"; + } + String dst = p_path.get_base_dir().plus_file(file); FileAccess *f=FileAccess::open(dst,FileAccess::WRITE); if (!f) { -- cgit v1.2.3