|
@@ -163,25 +163,19 @@ const Engine = (function () {
|
|
|
me.rtenv['initConfig'](config);
|
|
|
|
|
|
// Preload GDExtension libraries.
|
|
|
- const libs = [];
|
|
|
if (me.config.gdextensionLibs.length > 0 && !me.rtenv['loadDynamicLibrary']) {
|
|
|
return Promise.reject(new Error('GDExtension libraries are not supported by this engine version. '
|
|
|
+ 'Enable "Extensions Support" for your export preset and/or build your custom template with "dlink_enabled=yes".'));
|
|
|
}
|
|
|
- me.config.gdextensionLibs.forEach(function (lib) {
|
|
|
- libs.push(me.rtenv['loadDynamicLibrary'](lib, { 'loadAsync': true }));
|
|
|
- });
|
|
|
- return Promise.all(libs).then(function () {
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
- preloader.preloadedFiles.forEach(function (file) {
|
|
|
- me.rtenv['copyToFS'](file.path, file.buffer);
|
|
|
- });
|
|
|
- preloader.preloadedFiles.length = 0; // Clear memory
|
|
|
- me.rtenv['callMain'](me.config.args);
|
|
|
- initPromise = null;
|
|
|
- me.installServiceWorker();
|
|
|
- resolve();
|
|
|
- });
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
+ for (const file of preloader.preloadedFiles) {
|
|
|
+ me.rtenv['copyToFS'](file.path, file.buffer);
|
|
|
+ }
|
|
|
+ preloader.preloadedFiles.length = 0; // Clear memory
|
|
|
+ me.rtenv['callMain'](me.config.args);
|
|
|
+ initPromise = null;
|
|
|
+ me.installServiceWorker();
|
|
|
+ resolve();
|
|
|
});
|
|
|
});
|
|
|
},
|