From d6f2862429399844ebdd16b61da3a3c9d14fba36 Mon Sep 17 00:00:00 2001 From: eska Date: Sun, 30 Oct 2016 23:10:17 +0100 Subject: Add option 'wasm' to compile to WebAssembly in web export WebAssembly is still experimental, so disabled by default. The HTML shell file now uses $GODOT_BASE, a placeholder for the base filename, instead of $GODOT_JS, $GODOT_MEM and $GODOT_FS. --- platform/javascript/export/export.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'platform/javascript/export/export.cpp') diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index f934916aa2..721aef3e50 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -180,9 +180,7 @@ void EditorExportPlatformJavaScript::_fix_html(Vector& p_html, const St String current_line = lines[i]; current_line = current_line.replace("$GODOT_TMEM",itos((1<<(max_memory+5))*1024*1024)); - current_line = current_line.replace("$GODOT_FS",p_name+"fs.js"); - current_line = current_line.replace("$GODOT_MEM",p_name+".mem"); - current_line = current_line.replace("$GODOT_JS",p_name+".js"); + current_line = current_line.replace("$GODOT_BASE",p_name); current_line = current_line.replace("$GODOT_CANVAS_WIDTH",Globals::get_singleton()->get("display/width")); current_line = current_line.replace("$GODOT_CANVAS_HEIGHT",Globals::get_singleton()->get("display/height")); current_line = current_line.replace("$GODOT_HEAD_TITLE",!html_title.empty()?html_title:(String) Globals::get_singleton()->get("application/name")); @@ -319,16 +317,19 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool } if (file=="godot.js") { - //_fix_godot(data); file=p_path.get_file().basename()+".js"; } if (file=="godot.mem") { - //_fix_godot(data); file=p_path.get_file().basename()+".mem"; } + if (file=="godot.wasm") { + + file=p_path.get_file().basename()+".wasm"; + } + String dst = p_path.get_base_dir().plus_file(file); FileAccess *f=FileAccess::open(dst,FileAccess::WRITE); if (!f) { -- cgit v1.2.3 From 290d79f26c0c6cd00a35ae64fb6eecacedbb3937 Mon Sep 17 00:00:00 2001 From: eska Date: Wed, 30 Nov 2016 22:47:19 +0100 Subject: Emit asm.js code into a dedicated file for asm.js export This helps prevent browser lockups during start-up at the cost of having to distribute an extra file. --- platform/javascript/export/export.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'platform/javascript/export/export.cpp') diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 721aef3e50..ab64ffbb45 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -320,6 +320,11 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool file=p_path.get_file().basename()+".js"; } + if (file=="godot.asm.js") { + + file=p_path.get_file().basename()+".asm.js"; + } + if (file=="godot.mem") { file=p_path.get_file().basename()+".mem"; -- cgit v1.2.3 From c7bc44d5ad9aae4902280012f7654e2318cd910e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 1 Jan 2017 22:01:57 +0100 Subject: Welcome in 2017, dear changelog reader! That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games! --- platform/javascript/export/export.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/javascript/export/export.cpp') diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index ab64ffbb45..f2b63ff12f 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3