1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Fix Closure compiler build, python style.

Move copyToFS into utils.js library included with '--pre-js'.
This commit is contained in:
Fabio Alessandrelli
2020-05-08 16:55:01 +02:00
parent 7411e7fd37
commit d2eef39731
11 changed files with 79 additions and 50 deletions

View File

@@ -820,16 +820,16 @@ DisplayServerJavaScript::DisplayServerJavaScript(const String &p_rendering_drive
EM_ASM({
const canvas = Module['canvas'];
var enc = new TextEncoder("utf-8");
buffer = new Uint8Array(enc.encode(canvas.id));
var len = buffer.length*buffer.BYTES_PER_ELEMENT;
var out = Module._malloc(len);
Module.HEAPU8.set(buffer, out);
var buffer = new Uint8Array(enc.encode(canvas.id));
var len = buffer.byteLength;
var out = _malloc(len);
HEAPU8.set(buffer, out);
ccall("_set_canvas_id",
"void",
["number", "number"],
[out, len]
);
Module._free(out);
_free(out);
});
/* clang-format on */