Fix internal Emscripten JS API calls
Emscripten 1.37.24 no longer exports these by default
This commit is contained in:
parent
50181da8a1
commit
cf5b074a95
2
misc/dist/html/default.html
vendored
2
misc/dist/html/default.html
vendored
@ -350,7 +350,7 @@ $GODOT_HEAD_INCLUDE
|
|||||||
};
|
};
|
||||||
|
|
||||||
function printError(text) {
|
function printError(text) {
|
||||||
if (!text.startsWith('**ERROR**: ')) {
|
if (!String.prototype.trim.call(text).startsWith('**ERROR**: ')) {
|
||||||
text = '**ERROR**: ' + text;
|
text = '**ERROR**: ' + text;
|
||||||
}
|
}
|
||||||
print(text);
|
print(text);
|
||||||
|
@ -65,7 +65,7 @@ int main(int argc, char *argv[]) {
|
|||||||
FS.mkdir('/userfs');
|
FS.mkdir('/userfs');
|
||||||
FS.mount(IDBFS, {}, '/userfs');
|
FS.mount(IDBFS, {}, '/userfs');
|
||||||
FS.syncfs(true, function(err) {
|
FS.syncfs(true, function(err) {
|
||||||
Module['ccall']('main_after_fs_sync', null, ['string'], [err ? err.message : ""])
|
ccall('main_after_fs_sync', null, ['string'], [err ? err.message : ""])
|
||||||
});
|
});
|
||||||
);
|
);
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
|
@ -566,7 +566,7 @@ void OS_JavaScript::set_css_cursor(const char *p_cursor) {
|
|||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
EM_ASM_({
|
EM_ASM_({
|
||||||
Module.canvas.style.cursor = Module.UTF8ToString($0);
|
Module.canvas.style.cursor = UTF8ToString($0);
|
||||||
}, p_cursor);
|
}, p_cursor);
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
}
|
}
|
||||||
@ -576,7 +576,7 @@ const char *OS_JavaScript::get_css_cursor() const {
|
|||||||
char cursor[16];
|
char cursor[16];
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
EM_ASM_INT({
|
EM_ASM_INT({
|
||||||
Module.stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16);
|
stringToUTF8(Module.canvas.style.cursor ? Module.canvas.style.cursor : 'auto', $0, 16);
|
||||||
}, cursor);
|
}, cursor);
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
return cursor;
|
return cursor;
|
||||||
@ -792,7 +792,7 @@ void OS_JavaScript::main_loop_begin() {
|
|||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
EM_ASM_ARGS({
|
EM_ASM_ARGS({
|
||||||
const send_notification = Module.cwrap('send_notification', null, ['number']);
|
const send_notification = cwrap('send_notification', null, ['number']);
|
||||||
const notifs = arguments;
|
const notifs = arguments;
|
||||||
(['mouseover', 'mouseleave', 'focus', 'blur']).forEach(function(event, i) {
|
(['mouseover', 'mouseleave', 'focus', 'blur']).forEach(function(event, i) {
|
||||||
Module.canvas.addEventListener(event, send_notification.bind(null, notifs[i]));
|
Module.canvas.addEventListener(event, send_notification.bind(null, notifs[i]));
|
||||||
|
Loading…
Reference in New Issue
Block a user