diff --git a/TimedPetriNetEditor.js b/TimedPetriNetEditor.js index e1704eb..44f008b 100644 --- a/TimedPetriNetEditor.js +++ b/TimedPetriNetEditor.js @@ -523,13 +523,39 @@ assert(!ENVIRONMENT_IS_SHELL, "shell environment detected but not enabled at bui // An online HTML version (which may be of a different version of Emscripten) // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html -var wasmBinary; +var wasmBinary; if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];legacyModuleProp('wasmBinary', 'wasmBinary'); if (typeof WebAssembly != 'object') { abort('no native wasm support detected'); } +// include: base64Utils.js +// Converts a string of base64 into a byte array (Uint8Array). +function intArrayFromBase64(s) { + if (typeof ENVIRONMENT_IS_NODE != 'undefined' && ENVIRONMENT_IS_NODE) { + var buf = Buffer.from(s, 'base64'); + return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); + } + + var decoded = atob(s); + var bytes = new Uint8Array(decoded.length); + for (var i = 0 ; i < decoded.length ; ++i) { + bytes[i] = decoded.charCodeAt(i); + } + return bytes; +} + +// If filename is a base64 data URI, parses and returns data (Buffer on node, +// Uint8Array otherwise). If filename is not a base64 data URI, returns undefined. +function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); +} +// end include: base64Utils.js // Wasm globals var wasmMemory; @@ -547,6 +573,10 @@ var ABORT = false; // but only when noExitRuntime is false. var EXITSTATUS; +// In STRICT mode, we only define assert() when ASSERTIONS is set. i.e. we +// don't define it at all in release modes. This matches the behaviour of +// MINIMAL_RUNTIME. +// TODO(sbc): Make this the default even without STRICT enabled. /** @type {function(*, string=)} */ function assert(condition, text) { if (!condition) { @@ -1157,8 +1187,8 @@ function dbg(text) { // === Body === var ASM_CONSTS = { - 430680: ($0) => { navigator.clipboard.writeText(UTF8ToString($0)); }, - 430733: ($0) => { document.getElementById("canvas").style.cursor = UTF8ToString($0); } + 430792: ($0) => { navigator.clipboard.writeText(UTF8ToString($0)); }, + 430845: ($0) => { document.getElementById("canvas").style.cursor = UTF8ToString($0); } }; function GetWindowInnerWidth() { return window.innerWidth; } function GetWindowInnerHeight() { return window.innerHeight; } @@ -1309,7 +1339,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } * @return {string} */ var UTF8ToString = (ptr, maxBytesToRead) => { - assert(typeof ptr == 'number'); + assert(typeof ptr == 'number', `UTF8ToString expects a number (got ${typeof ptr})`); return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ''; }; var ___assert_fail = (condition, filename, line, func) => { @@ -1473,9 +1503,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } var paths = Array.prototype.slice.call(arguments); return PATH.normalize(paths.join('/')); }, - join2:(l, r) => { - return PATH.normalize(l + '/' + r); - }, + join2:(l, r) => PATH.normalize(l + '/' + r), }; var initRandomFill = () => { @@ -1593,7 +1621,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } }; var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => { - assert(typeof str === 'string'); + assert(typeof str === 'string', `stringToUTF8Array expects a string (got ${typeof str})`); // Parameter maxBytesToWrite is not optional. Negative values, 0, null, // undefined and false each don't write out any bytes. if (!(maxBytesToWrite > 0)) @@ -2203,7 +2231,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } var FS_createDataFile = (parent, name, fileData, canRead, canWrite, canOwn) => { - return FS.createDataFile(parent, name, fileData, canRead, canWrite, canOwn); + FS.createDataFile(parent, name, fileData, canRead, canWrite, canOwn); }; var preloadPlugins = Module['preloadPlugins'] || []; @@ -2400,7 +2428,128 @@ function GetWindowInnerHeight() { return window.innerHeight; } }; var ERRNO_CODES = { - }; + 'EPERM': 63, + 'ENOENT': 44, + 'ESRCH': 71, + 'EINTR': 27, + 'EIO': 29, + 'ENXIO': 60, + 'E2BIG': 1, + 'ENOEXEC': 45, + 'EBADF': 8, + 'ECHILD': 12, + 'EAGAIN': 6, + 'EWOULDBLOCK': 6, + 'ENOMEM': 48, + 'EACCES': 2, + 'EFAULT': 21, + 'ENOTBLK': 105, + 'EBUSY': 10, + 'EEXIST': 20, + 'EXDEV': 75, + 'ENODEV': 43, + 'ENOTDIR': 54, + 'EISDIR': 31, + 'EINVAL': 28, + 'ENFILE': 41, + 'EMFILE': 33, + 'ENOTTY': 59, + 'ETXTBSY': 74, + 'EFBIG': 22, + 'ENOSPC': 51, + 'ESPIPE': 70, + 'EROFS': 69, + 'EMLINK': 34, + 'EPIPE': 64, + 'EDOM': 18, + 'ERANGE': 68, + 'ENOMSG': 49, + 'EIDRM': 24, + 'ECHRNG': 106, + 'EL2NSYNC': 156, + 'EL3HLT': 107, + 'EL3RST': 108, + 'ELNRNG': 109, + 'EUNATCH': 110, + 'ENOCSI': 111, + 'EL2HLT': 112, + 'EDEADLK': 16, + 'ENOLCK': 46, + 'EBADE': 113, + 'EBADR': 114, + 'EXFULL': 115, + 'ENOANO': 104, + 'EBADRQC': 103, + 'EBADSLT': 102, + 'EDEADLOCK': 16, + 'EBFONT': 101, + 'ENOSTR': 100, + 'ENODATA': 116, + 'ETIME': 117, + 'ENOSR': 118, + 'ENONET': 119, + 'ENOPKG': 120, + 'EREMOTE': 121, + 'ENOLINK': 47, + 'EADV': 122, + 'ESRMNT': 123, + 'ECOMM': 124, + 'EPROTO': 65, + 'EMULTIHOP': 36, + 'EDOTDOT': 125, + 'EBADMSG': 9, + 'ENOTUNIQ': 126, + 'EBADFD': 127, + 'EREMCHG': 128, + 'ELIBACC': 129, + 'ELIBBAD': 130, + 'ELIBSCN': 131, + 'ELIBMAX': 132, + 'ELIBEXEC': 133, + 'ENOSYS': 52, + 'ENOTEMPTY': 55, + 'ENAMETOOLONG': 37, + 'ELOOP': 32, + 'EOPNOTSUPP': 138, + 'EPFNOSUPPORT': 139, + 'ECONNRESET': 15, + 'ENOBUFS': 42, + 'EAFNOSUPPORT': 5, + 'EPROTOTYPE': 67, + 'ENOTSOCK': 57, + 'ENOPROTOOPT': 50, + 'ESHUTDOWN': 140, + 'ECONNREFUSED': 14, + 'EADDRINUSE': 3, + 'ECONNABORTED': 13, + 'ENETUNREACH': 40, + 'ENETDOWN': 38, + 'ETIMEDOUT': 73, + 'EHOSTDOWN': 142, + 'EHOSTUNREACH': 23, + 'EINPROGRESS': 26, + 'EALREADY': 7, + 'EDESTADDRREQ': 17, + 'EMSGSIZE': 35, + 'EPROTONOSUPPORT': 66, + 'ESOCKTNOSUPPORT': 137, + 'EADDRNOTAVAIL': 4, + 'ENETRESET': 39, + 'EISCONN': 30, + 'ENOTCONN': 53, + 'ETOOMANYREFS': 141, + 'EUSERS': 136, + 'EDQUOT': 19, + 'ESTALE': 72, + 'ENOTSUP': 138, + 'ENOMEDIUM': 148, + 'EILSEQ': 25, + 'EOVERFLOW': 61, + 'ECANCELED': 11, + 'ENOTRECOVERABLE': 56, + 'EOWNERDEAD': 62, + 'ESTRPIPE': 135, + }; var demangle = (func) => { warnOnce('warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling'); @@ -3741,7 +3890,6 @@ function GetWindowInnerHeight() { return window.innerHeight; } FS.close(stream); FS.chmod(node, mode); } - return node; }, createDevice(parent, name, input, output) { var path = PATH.join2(typeof parent == 'string' ? parent : FS.getPath(parent), name); @@ -4041,19 +4189,19 @@ function GetWindowInnerHeight() { return window.innerHeight; } HEAP32[(((buf)+(12))>>2)] = stat.uid; HEAP32[(((buf)+(16))>>2)] = stat.gid; HEAP32[(((buf)+(20))>>2)] = stat.rdev; - (tempI64 = [stat.size>>>0,(tempDouble=stat.size,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(24))>>2)] = tempI64[0],HEAP32[(((buf)+(28))>>2)] = tempI64[1]); + (tempI64 = [stat.size>>>0,(tempDouble = stat.size,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(24))>>2)] = tempI64[0],HEAP32[(((buf)+(28))>>2)] = tempI64[1]); HEAP32[(((buf)+(32))>>2)] = 4096; HEAP32[(((buf)+(36))>>2)] = stat.blocks; var atime = stat.atime.getTime(); var mtime = stat.mtime.getTime(); var ctime = stat.ctime.getTime(); - (tempI64 = [Math.floor(atime / 1000)>>>0,(tempDouble=Math.floor(atime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(40))>>2)] = tempI64[0],HEAP32[(((buf)+(44))>>2)] = tempI64[1]); + (tempI64 = [Math.floor(atime / 1000)>>>0,(tempDouble = Math.floor(atime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(40))>>2)] = tempI64[0],HEAP32[(((buf)+(44))>>2)] = tempI64[1]); HEAPU32[(((buf)+(48))>>2)] = (atime % 1000) * 1000; - (tempI64 = [Math.floor(mtime / 1000)>>>0,(tempDouble=Math.floor(mtime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(56))>>2)] = tempI64[0],HEAP32[(((buf)+(60))>>2)] = tempI64[1]); + (tempI64 = [Math.floor(mtime / 1000)>>>0,(tempDouble = Math.floor(mtime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(56))>>2)] = tempI64[0],HEAP32[(((buf)+(60))>>2)] = tempI64[1]); HEAPU32[(((buf)+(64))>>2)] = (mtime % 1000) * 1000; - (tempI64 = [Math.floor(ctime / 1000)>>>0,(tempDouble=Math.floor(ctime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(72))>>2)] = tempI64[0],HEAP32[(((buf)+(76))>>2)] = tempI64[1]); + (tempI64 = [Math.floor(ctime / 1000)>>>0,(tempDouble = Math.floor(ctime / 1000),(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(72))>>2)] = tempI64[0],HEAP32[(((buf)+(76))>>2)] = tempI64[1]); HEAPU32[(((buf)+(80))>>2)] = (ctime % 1000) * 1000; - (tempI64 = [stat.ino>>>0,(tempDouble=stat.ino,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(88))>>2)] = tempI64[0],HEAP32[(((buf)+(92))>>2)] = tempI64[1]); + (tempI64 = [stat.ino>>>0,(tempDouble = stat.ino,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((buf)+(88))>>2)] = tempI64[0],HEAP32[(((buf)+(92))>>2)] = tempI64[1]); return 0; }, doMsync(addr, stream, len, flags, offset) { @@ -4209,8 +4357,8 @@ function GetWindowInnerHeight() { return window.innerHeight; } 8; // DT_REG, regular file. } assert(id); - (tempI64 = [id>>>0,(tempDouble=id,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[((dirp + pos)>>2)] = tempI64[0],HEAP32[(((dirp + pos)+(4))>>2)] = tempI64[1]); - (tempI64 = [(idx + 1) * struct_size>>>0,(tempDouble=(idx + 1) * struct_size,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((dirp + pos)+(8))>>2)] = tempI64[0],HEAP32[(((dirp + pos)+(12))>>2)] = tempI64[1]); + (tempI64 = [id>>>0,(tempDouble = id,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[((dirp + pos)>>2)] = tempI64[0],HEAP32[(((dirp + pos)+(4))>>2)] = tempI64[1]); + (tempI64 = [(idx + 1) * struct_size>>>0,(tempDouble = (idx + 1) * struct_size,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[(((dirp + pos)+(8))>>2)] = tempI64[0],HEAP32[(((dirp + pos)+(12))>>2)] = tempI64[1]); HEAP16[(((dirp + pos)+(16))>>1)] = 280; HEAP8[(((dirp + pos)+(18))>>0)] = type; stringToUTF8(name, dirp + pos + 19, 256); @@ -4398,9 +4546,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } var nowIsMonotonic = true;; var __emscripten_get_now_is_monotonic = () => nowIsMonotonic; - var isLeapYear = (year) => { - return year%4 === 0 && (year%100 !== 0 || year%400 === 0); - }; + var isLeapYear = (year) => year%4 === 0 && (year%100 !== 0 || year%400 === 0); var MONTH_DAYS_LEAP_CUMULATIVE = [0,31,60,91,121,152,182,213,244,274,305,335]; @@ -4933,6 +5079,11 @@ function GetWindowInnerHeight() { return window.innerHeight; } } }); }, + getExtensions() { + var exts = GLctx.getSupportedExtensions() || []; // .getSupportedExtensions() can return null if context is lost, so coerce to empty array. + exts = exts.concat(exts.map((e) => "GL_" + e)); + return exts; + }, }; /** @suppress {duplicate } */ function _glActiveTexture(x0) { GLctx.activeTexture(x0) } @@ -5830,9 +5981,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } if (!ret) { switch (name_) { case 0x1F03 /* GL_EXTENSIONS */: - var exts = GLctx.getSupportedExtensions() || []; // .getSupportedExtensions() can return null if context is lost, so coerce to empty array. - exts = exts.concat(exts.map((e) => "GL_" + e)); - ret = stringToNewUTF8(exts.join(' ')); + ret = stringToNewUTF8(GL.getExtensions().join(' ')); break; case 0x1F00 /* GL_VENDOR */: case 0x1F01 /* GL_RENDERER */: @@ -5842,7 +5991,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } if (!s) { GL.recordError(0x500/*GL_INVALID_ENUM*/); } - ret = s && stringToNewUTF8(s); + ret = s ? stringToNewUTF8(s) : 0; break; case 0x1F02 /* GL_VERSION */: @@ -5902,9 +6051,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } var jstoi_q = (str) => parseInt(str); /** @noinline */ - var webglGetLeftBracePos = (name) => { - return name.slice(-1) == ']' && name.lastIndexOf('['); - }; + var webglGetLeftBracePos = (name) => name.slice(-1) == ']' && name.lastIndexOf('['); var webglPrepareUniformLocationsBeforeFirstUse = (program) => { var uniformLocsById = program.uniformLocsById, // Maps GLuint -> WebGLUniformLocation @@ -6265,9 +6412,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } return HEAPU16; }; - var heapAccessShiftForWebGLHeap = (heap) => { - return 31 - Math.clz32(heap.BYTES_PER_ELEMENT); - }; + var heapAccessShiftForWebGLHeap = (heap) => 31 - Math.clz32(heap.BYTES_PER_ELEMENT); var emscriptenWebGLGetTexPixelData = (type, format, width, height, pixels, internalFormat) => { var heap = heapObjectForWebGLType(type); @@ -7120,31 +7265,35 @@ function GetWindowInnerHeight() { return window.innerHeight; } }; Browser.mainLoop.method = 'rAF'; } else if (mode == 2) { - if (typeof setImmediate == 'undefined') { - // Emulate setImmediate. (note: not a complete polyfill, we don't emulate clearImmediate() to keep code size to minimum, since not needed) - var setImmediates = []; - var emscriptenMainLoopMessageId = 'setimmediate'; - /** @param {Event} event */ - var Browser_setImmediate_messageHandler = (event) => { - // When called in current thread or Worker, the main loop ID is structured slightly different to accommodate for --proxy-to-worker runtime listening to Worker events, - // so check for both cases. - if (event.data === emscriptenMainLoopMessageId || event.data.target === emscriptenMainLoopMessageId) { - event.stopPropagation(); - setImmediates.shift()(); - } - }; - addEventListener("message", Browser_setImmediate_messageHandler, true); - setImmediate = /** @type{function(function(): ?, ...?): number} */(function Browser_emulated_setImmediate(func) { - setImmediates.push(func); - if (ENVIRONMENT_IS_WORKER) { - if (Module['setImmediates'] === undefined) Module['setImmediates'] = []; - Module['setImmediates'].push(func); - postMessage({target: emscriptenMainLoopMessageId}); // In --proxy-to-worker, route the message via proxyClient.js - } else postMessage(emscriptenMainLoopMessageId, "*"); // On the main thread, can just send the message to itself. - }); + if (typeof Browser.setImmediate == 'undefined') { + if (typeof setImmediate == 'undefined') { + // Emulate setImmediate. (note: not a complete polyfill, we don't emulate clearImmediate() to keep code size to minimum, since not needed) + var setImmediates = []; + var emscriptenMainLoopMessageId = 'setimmediate'; + /** @param {Event} event */ + var Browser_setImmediate_messageHandler = (event) => { + // When called in current thread or Worker, the main loop ID is structured slightly different to accommodate for --proxy-to-worker runtime listening to Worker events, + // so check for both cases. + if (event.data === emscriptenMainLoopMessageId || event.data.target === emscriptenMainLoopMessageId) { + event.stopPropagation(); + setImmediates.shift()(); + } + }; + addEventListener("message", Browser_setImmediate_messageHandler, true); + Browser.setImmediate = /** @type{function(function(): ?, ...?): number} */(function Browser_emulated_setImmediate(func) { + setImmediates.push(func); + if (ENVIRONMENT_IS_WORKER) { + if (Module['setImmediates'] === undefined) Module['setImmediates'] = []; + Module['setImmediates'].push(func); + postMessage({target: emscriptenMainLoopMessageId}); // In --proxy-to-worker, route the message via proxyClient.js + } else postMessage(emscriptenMainLoopMessageId, "*"); // On the main thread, can just send the message to itself. + }); + } else { + Browser.setImmediate = setImmediate; + } } Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler_setImmediate() { - setImmediate(Browser.mainLoop.runner); + Browser.setImmediate(Browser.mainLoop.runner); }; Browser.mainLoop.method = 'immediate'; } @@ -8080,7 +8229,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } if (isNaN(offset)) return 61; var stream = SYSCALLS.getStreamFromFD(fd); FS.llseek(stream, offset, whence); - (tempI64 = [stream.position>>>0,(tempDouble=stream.position,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[((newOffset)>>2)] = tempI64[0],HEAP32[(((newOffset)+(4))>>2)] = tempI64[1]); + (tempI64 = [stream.position>>>0,(tempDouble = stream.position,(+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? (+(Math.floor((tempDouble)/4294967296.0)))>>>0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296.0)))))>>>0) : 0)], HEAP32[((newOffset)>>2)] = tempI64[0],HEAP32[(((newOffset)+(4))>>2)] = tempI64[1]); if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; // reset readdir state return 0; } catch (e) { @@ -8202,23 +8351,23 @@ function GetWindowInnerHeight() { return window.innerHeight; } this.domKeys = new Array(); this.shouldClose = 0; this.title = null; - this.windowPosFunc = null; // GLFWwindowposfun - this.windowSizeFunc = null; // GLFWwindowsizefun - this.windowCloseFunc = null; // GLFWwindowclosefun - this.windowRefreshFunc = null; // GLFWwindowrefreshfun - this.windowFocusFunc = null; // GLFWwindowfocusfun - this.windowIconifyFunc = null; // GLFWwindowiconifyfun - this.windowMaximizeFunc = null; // GLFWwindowmaximizefun - this.framebufferSizeFunc = null; // GLFWframebuffersizefun - this.windowContentScaleFunc = null; // GLFWwindowcontentscalefun - this.mouseButtonFunc = null; // GLFWmousebuttonfun - this.cursorPosFunc = null; // GLFWcursorposfun - this.cursorEnterFunc = null; // GLFWcursorenterfun - this.scrollFunc = null; // GLFWscrollfun - this.dropFunc = null; // GLFWdropfun - this.keyFunc = null; // GLFWkeyfun - this.charFunc = null; // GLFWcharfun - this.userptr = null; + this.windowPosFunc = 0; // GLFWwindowposfun + this.windowSizeFunc = 0; // GLFWwindowsizefun + this.windowCloseFunc = 0; // GLFWwindowclosefun + this.windowRefreshFunc = 0; // GLFWwindowrefreshfun + this.windowFocusFunc = 0; // GLFWwindowfocusfun + this.windowIconifyFunc = 0; // GLFWwindowiconifyfun + this.windowMaximizeFunc = 0; // GLFWwindowmaximizefun + this.framebufferSizeFunc = 0; // GLFWframebuffersizefun + this.windowContentScaleFunc = 0; // GLFWwindowcontentscalefun + this.mouseButtonFunc = 0; // GLFWmousebuttonfun + this.cursorPosFunc = 0; // GLFWcursorposfun + this.cursorEnterFunc = 0; // GLFWcursorenterfun + this.scrollFunc = 0; // GLFWscrollfun + this.dropFunc = 0; // GLFWdropfun + this.keyFunc = 0; // GLFWkeyfun + this.charFunc = 0; // GLFWcharfun + this.userptr = 0; } @@ -8229,9 +8378,9 @@ function GetWindowInnerHeight() { return window.innerHeight; } if (id <= 0 || !GLFW.windows) return null; return GLFW.windows[id - 1]; }, - joystickFunc:null, - errorFunc:null, - monitorFunc:null, + joystickFunc:0, + errorFunc:0, + monitorFunc:0, active:null, scale:null, windows:null, @@ -8618,9 +8767,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } ((a1, a2, a3) => dynCall_viff.apply(null, [GLFW.active.windowContentScaleFunc, a1, a2, a3]))(GLFW.active.id, GLFW.scale, GLFW.scale); } }, - getTime:() => { - return _emscripten_get_now() / 1000; - }, + getTime:() => _emscripten_get_now() / 1000, setWindowTitle:(winid, title) => { var win = GLFW.WindowFromId(winid); if (!win) return; @@ -8631,8 +8778,10 @@ function GetWindowInnerHeight() { return window.innerHeight; } } }, setJoystickCallback:(cbfun) => { + var prevcbfun = GLFW.joystickFunc; GLFW.joystickFunc = cbfun; GLFW.refreshJoysticks(); + return prevcbfun; }, joys:{ }, @@ -9863,129 +10012,6 @@ function GetWindowInnerHeight() { return window.innerHeight; } FS.FSNode = FSNode; FS.createPreloadedFile = FS_createPreloadedFile; FS.staticInit();Module["FS_createPath"] = FS.createPath;Module["FS_createDataFile"] = FS.createDataFile;Module["FS_createPreloadedFile"] = FS.createPreloadedFile;Module["FS_unlink"] = FS.unlink;Module["FS_createLazyFile"] = FS.createLazyFile;Module["FS_createDevice"] = FS.createDevice;; -ERRNO_CODES = { - 'EPERM': 63, - 'ENOENT': 44, - 'ESRCH': 71, - 'EINTR': 27, - 'EIO': 29, - 'ENXIO': 60, - 'E2BIG': 1, - 'ENOEXEC': 45, - 'EBADF': 8, - 'ECHILD': 12, - 'EAGAIN': 6, - 'EWOULDBLOCK': 6, - 'ENOMEM': 48, - 'EACCES': 2, - 'EFAULT': 21, - 'ENOTBLK': 105, - 'EBUSY': 10, - 'EEXIST': 20, - 'EXDEV': 75, - 'ENODEV': 43, - 'ENOTDIR': 54, - 'EISDIR': 31, - 'EINVAL': 28, - 'ENFILE': 41, - 'EMFILE': 33, - 'ENOTTY': 59, - 'ETXTBSY': 74, - 'EFBIG': 22, - 'ENOSPC': 51, - 'ESPIPE': 70, - 'EROFS': 69, - 'EMLINK': 34, - 'EPIPE': 64, - 'EDOM': 18, - 'ERANGE': 68, - 'ENOMSG': 49, - 'EIDRM': 24, - 'ECHRNG': 106, - 'EL2NSYNC': 156, - 'EL3HLT': 107, - 'EL3RST': 108, - 'ELNRNG': 109, - 'EUNATCH': 110, - 'ENOCSI': 111, - 'EL2HLT': 112, - 'EDEADLK': 16, - 'ENOLCK': 46, - 'EBADE': 113, - 'EBADR': 114, - 'EXFULL': 115, - 'ENOANO': 104, - 'EBADRQC': 103, - 'EBADSLT': 102, - 'EDEADLOCK': 16, - 'EBFONT': 101, - 'ENOSTR': 100, - 'ENODATA': 116, - 'ETIME': 117, - 'ENOSR': 118, - 'ENONET': 119, - 'ENOPKG': 120, - 'EREMOTE': 121, - 'ENOLINK': 47, - 'EADV': 122, - 'ESRMNT': 123, - 'ECOMM': 124, - 'EPROTO': 65, - 'EMULTIHOP': 36, - 'EDOTDOT': 125, - 'EBADMSG': 9, - 'ENOTUNIQ': 126, - 'EBADFD': 127, - 'EREMCHG': 128, - 'ELIBACC': 129, - 'ELIBBAD': 130, - 'ELIBSCN': 131, - 'ELIBMAX': 132, - 'ELIBEXEC': 133, - 'ENOSYS': 52, - 'ENOTEMPTY': 55, - 'ENAMETOOLONG': 37, - 'ELOOP': 32, - 'EOPNOTSUPP': 138, - 'EPFNOSUPPORT': 139, - 'ECONNRESET': 15, - 'ENOBUFS': 42, - 'EAFNOSUPPORT': 5, - 'EPROTOTYPE': 67, - 'ENOTSOCK': 57, - 'ENOPROTOOPT': 50, - 'ESHUTDOWN': 140, - 'ECONNREFUSED': 14, - 'EADDRINUSE': 3, - 'ECONNABORTED': 13, - 'ENETUNREACH': 40, - 'ENETDOWN': 38, - 'ETIMEDOUT': 73, - 'EHOSTDOWN': 142, - 'EHOSTUNREACH': 23, - 'EINPROGRESS': 26, - 'EALREADY': 7, - 'EDESTADDRREQ': 17, - 'EMSGSIZE': 35, - 'EPROTONOSUPPORT': 66, - 'ESOCKTNOSUPPORT': 137, - 'EADDRNOTAVAIL': 4, - 'ENETRESET': 39, - 'EISCONN': 30, - 'ENOTCONN': 53, - 'ETOOMANYREFS': 141, - 'EUSERS': 136, - 'EDQUOT': 19, - 'ESTALE': 72, - 'ENOTSUP': 138, - 'ENOMEDIUM': 148, - 'EILSEQ': 25, - 'EOVERFLOW': 61, - 'ECANCELED': 11, - 'ENOTRECOVERABLE': 56, - 'EOWNERDEAD': 62, - 'ESTRPIPE': 135, - };; var GLctx;; for (var i = 0; i < 32; ++i) tempFixedLengthArray.push(new Array(i));; var miniTempWebGLFloatBuffersStorage = new Float32Array(288); @@ -10648,38 +10674,12 @@ var _asyncify_start_unwind = createExportWrapper('asyncify_start_unwind'); var _asyncify_stop_unwind = createExportWrapper('asyncify_stop_unwind'); var _asyncify_start_rewind = createExportWrapper('asyncify_start_rewind'); var _asyncify_stop_rewind = createExportWrapper('asyncify_stop_rewind'); -var ___start_em_js = Module['___start_em_js'] = 430802; -var ___stop_em_js = Module['___stop_em_js'] = 430875; +var ___start_em_js = Module['___start_em_js'] = 430914; +var ___stop_em_js = Module['___stop_em_js'] = 430987; // include: postamble.js // === Auto-generated postamble setup entry stuff === -// include: base64Utils.js -// Converts a string of base64 into a byte array (Uint8Array). -function intArrayFromBase64(s) { - if (typeof ENVIRONMENT_IS_NODE != 'undefined' && ENVIRONMENT_IS_NODE) { - var buf = Buffer.from(s, 'base64'); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.length); - } - - var decoded = atob(s); - var bytes = new Uint8Array(decoded.length); - for (var i = 0 ; i < decoded.length ; ++i) { - bytes[i] = decoded.charCodeAt(i); - } - return bytes; -} - -// If filename is a base64 data URI, parses and returns data (Buffer on node, -// Uint8Array otherwise). If filename is not a base64 data URI, returns undefined. -function tryParseAsDataURI(filename) { - if (!isDataURI(filename)) { - return; - } - - return intArrayFromBase64(filename.slice(dataURIPrefix.length)); -} -// end include: base64Utils.js Module['addRunDependency'] = addRunDependency; Module['removeRunDependency'] = removeRunDependency; Module['FS_createPath'] = FS.createPath; diff --git a/TimedPetriNetEditor.wasm b/TimedPetriNetEditor.wasm index 59593bb..601f6c1 100755 Binary files a/TimedPetriNetEditor.wasm and b/TimedPetriNetEditor.wasm differ