From 8af30c9312a4b0e3a637bedc9908eb4588496c7b Mon Sep 17 00:00:00 2001 From: Joseph Suarez Date: Sun, 8 Dec 2024 19:19:13 +0000 Subject: [PATCH] Enduro start day --- docs/assets/enduro/game.js | 113 +++++++++++++++++-------------- docs/assets/enduro/game.wasm | Bin 221962 -> 221996 bytes docs/assets/enduro/game.wasm.map | 2 +- 3 files changed, 62 insertions(+), 53 deletions(-) diff --git a/docs/assets/enduro/game.js b/docs/assets/enduro/game.js index 574f71f..39e2cd2 100644 --- a/docs/assets/enduro/game.js +++ b/docs/assets/enduro/game.js @@ -35,7 +35,7 @@ if (ENVIRONMENT_IS_NODE) { // --pre-jses are emitted after the Module integration code, so that they can // refer to Module (if they choose; they can also define Module) -// include: /tmp/tmpy5nwczww.js +// include: /tmp/tmp98izcznz.js Module['expectedDataFileDownloads'] ??= 0; Module['expectedDataFileDownloads']++; @@ -220,21 +220,21 @@ Module['FS_createPath']("/resources", "robocode", true, true); })(); -// end include: /tmp/tmpy5nwczww.js -// include: /tmp/tmpwh_1q8mp.js +// end include: /tmp/tmp98izcznz.js +// include: /tmp/tmpjj0a8kne.js // All the pre-js content up to here must remain later on, we need to run // it. if (Module['$ww'] || (typeof ENVIRONMENT_IS_PTHREAD != 'undefined' && ENVIRONMENT_IS_PTHREAD)) Module['preRun'] = []; var necessaryPreJSTasks = Module['preRun'].slice(); - // end include: /tmp/tmpwh_1q8mp.js -// include: /tmp/tmpkbl26p0_.js + // end include: /tmp/tmpjj0a8kne.js +// include: /tmp/tmpu_wz7bgk.js if (!Module['preRun']) throw 'Module.preRun should exist because file support used it; did a pre-js delete it?'; necessaryPreJSTasks.forEach((task) => { if (Module['preRun'].indexOf(task) < 0) throw 'All preRun tasks that exist before user pre-js code should remain after; did you replace Module or modify Module.preRun?'; }); - // end include: /tmp/tmpkbl26p0_.js + // end include: /tmp/tmpu_wz7bgk.js // Sometimes an existing Module object exists with properties @@ -1304,9 +1304,8 @@ function GetWindowInnerHeight() { return window.innerHeight; } assert(typeof ptr == 'number', `UTF8ToString expects a number (got ${typeof ptr})`); return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ''; }; - var ___assert_fail = (condition, filename, line, func) => { + var ___assert_fail = (condition, filename, line, func) => abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']); - }; @@ -1761,7 +1760,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } var MEMFS = { ops_table:null, mount(mount) { - return MEMFS.createNode(null, '/', 16384 | 511 /* 0777 */, 0); + return MEMFS.createNode(null, '/', 16895, 0); }, createNode(parent, name, mode, dev) { if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { @@ -1962,7 +1961,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } return entries; }, symlink(parent, newname, oldpath) { - var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | 40960, 0); + var node = MEMFS.createNode(parent, newname, 0o777 | 40960, 0); node.link = oldpath; return node; }, @@ -2180,9 +2179,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } - var strError = (errno) => { - return UTF8ToString(_strerror(errno)); - }; + var strError = (errno) => UTF8ToString(_strerror(errno)); var ERRNO_CODES = { 'EPERM': 63, @@ -2852,14 +2849,35 @@ function GetWindowInnerHeight() { return window.innerHeight; } } return parent.node_ops.mknod(parent, name, mode, dev); }, - create(path, mode) { - mode = mode !== undefined ? mode : 438 /* 0666 */; + statfs(path) { + + // NOTE: None of the defaults here are true. We're just returning safe and + // sane values. + var rtn = { + bsize: 4096, + frsize: 4096, + blocks: 1e6, + bfree: 5e5, + bavail: 5e5, + files: FS.nextInode, + ffree: FS.nextInode - 1, + fsid: 42, + flags: 2, + namelen: 255, + }; + + var parent = FS.lookupPath(path, {follow: true}).node; + if (parent?.node_ops.statfs) { + Object.assign(rtn, parent.node_ops.statfs(parent.mount.opts.root)); + } + return rtn; + }, + create(path, mode = 0o666) { mode &= 4095; mode |= 32768; return FS.mknod(path, mode, 0); }, - mkdir(path, mode) { - mode = mode !== undefined ? mode : 511 /* 0777 */; + mkdir(path, mode = 0o777) { mode &= 511 | 512; mode |= 16384; return FS.mknod(path, mode, 0); @@ -2880,7 +2898,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } mkdev(path, mode, dev) { if (typeof dev == 'undefined') { dev = mode; - mode = 438 /* 0666 */; + mode = 0o666; } mode |= 8192; return FS.mknod(path, mode, dev); @@ -2978,7 +2996,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } // do the underlying fs rename try { old_dir.node_ops.rename(old_node, new_dir, new_name); - // update old node (we do this here to avoid each backend + // update old node (we do this here to avoid each backend // needing to) old_node.parent = new_dir; } catch (e) { @@ -3048,7 +3066,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } if (!link.node_ops.readlink) { throw new FS.ErrnoError(28); } - return PATH_FS.resolve(FS.getPath(link.parent), link.node_ops.readlink(link)); + return link.node_ops.readlink(link); }, stat(path, dontFollow) { var lookup = FS.lookupPath(path, { follow: !dontFollow }); @@ -3153,13 +3171,12 @@ function GetWindowInnerHeight() { return window.innerHeight; } timestamp: Math.max(atime, mtime) }); }, - open(path, flags, mode) { + open(path, flags, mode = 0o666) { if (path === "") { throw new FS.ErrnoError(44); } flags = typeof flags == 'string' ? FS_modeStringToFlags(flags) : flags; if ((flags & 64)) { - mode = typeof mode == 'undefined' ? 438 /* 0666 */ : mode; mode = (mode & 4095) | 32768; } else { mode = 0; @@ -3482,7 +3499,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } FS.mkdir('/proc/self/fd'); FS.mount({ mount() { - var node = FS.createNode(proc_self, 'fd', 16384 | 511 /* 0777 */, 73); + var node = FS.createNode(proc_self, 'fd', 16895, 73); node.node_ops = { lookup(parent, name) { var fd = +name; @@ -4180,9 +4197,8 @@ function GetWindowInnerHeight() { return window.innerHeight; } } } - var __abort_js = () => { + var __abort_js = () => abort('native code called abort()'); - }; var nowIsMonotonic = 1; var __emscripten_get_now_is_monotonic = () => nowIsMonotonic; @@ -4327,7 +4343,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } var specialHTMLTargets = [0, typeof document != 'undefined' ? document : 0, typeof window != 'undefined' ? window : 0]; var findEventTarget = (target) => { target = maybeCStringToJsString(target); - var domElement = specialHTMLTargets[target] || (typeof document != 'undefined' ? document.querySelector(target) : undefined); + var domElement = specialHTMLTargets[target] || (typeof document != 'undefined' ? document.querySelector(target) : null); return domElement; }; @@ -4442,22 +4458,18 @@ function GetWindowInnerHeight() { return window.innerHeight; } return !!(ctx.mdibvbi = ctx.getExtension('WEBGL_multi_draw_instanced_base_vertex_base_instance')); }; - var webgl_enable_EXT_polygon_offset_clamp = (ctx) => { - return !!(ctx.extPolygonOffsetClamp = ctx.getExtension('EXT_polygon_offset_clamp')); - }; + var webgl_enable_EXT_polygon_offset_clamp = (ctx) => + !!(ctx.extPolygonOffsetClamp = ctx.getExtension('EXT_polygon_offset_clamp')); - var webgl_enable_EXT_clip_control = (ctx) => { - return !!(ctx.extClipControl = ctx.getExtension('EXT_clip_control')); - }; + var webgl_enable_EXT_clip_control = (ctx) => + !!(ctx.extClipControl = ctx.getExtension('EXT_clip_control')); - var webgl_enable_WEBGL_polygon_mode = (ctx) => { - return !!(ctx.webglPolygonMode = ctx.getExtension('WEBGL_polygon_mode')); - }; + var webgl_enable_WEBGL_polygon_mode = (ctx) => + !!(ctx.webglPolygonMode = ctx.getExtension('WEBGL_polygon_mode')); - var webgl_enable_WEBGL_multi_draw = (ctx) => { + var webgl_enable_WEBGL_multi_draw = (ctx) => // Closure is expected to be allowed to minify the '.multiDrawWebgl' property, so not accessing it quoted. - return !!(ctx.multiDrawWebgl = ctx.getExtension('WEBGL_multi_draw')); - }; + !!(ctx.multiDrawWebgl = ctx.getExtension('WEBGL_multi_draw')); var getEmscriptenSupportedExtensions = (ctx) => { // Restrict the list of advertised extensions to those that we actually @@ -4633,7 +4645,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } // Active Emscripten GL layer context object. GL.currentContext = GL.contexts[contextHandle]; // Active WebGL context object. - Module.ctx = GLctx = GL.currentContext?.GLctx; + Module['ctx'] = GLctx = GL.currentContext?.GLctx; return !(contextHandle && !GLctx); }, getContext:(contextHandle) => { @@ -5520,16 +5532,14 @@ function GetWindowInnerHeight() { return window.innerHeight; } }; /** @suppress {duplicate } */ - var _glGetActiveAttrib = (program, index, bufSize, length, size, type, name) => { + var _glGetActiveAttrib = (program, index, bufSize, length, size, type, name) => __glGetActiveAttribOrUniform('getActiveAttrib', program, index, bufSize, length, size, type, name); - }; var _emscripten_glGetActiveAttrib = _glGetActiveAttrib; /** @suppress {duplicate } */ - var _glGetActiveUniform = (program, index, bufSize, length, size, type, name) => { + var _glGetActiveUniform = (program, index, bufSize, length, size, type, name) => __glGetActiveAttribOrUniform('getActiveUniform', program, index, bufSize, length, size, type, name); - }; var _emscripten_glGetActiveUniform = _glGetActiveUniform; /** @suppress {duplicate } */ @@ -5620,9 +5630,8 @@ function GetWindowInnerHeight() { return window.innerHeight; } /** @suppress {duplicate } */ - var _glGetAttribLocation = (program, name) => { - return GLctx.getAttribLocation(GL.programs[program], UTF8ToString(name)); - }; + var _glGetAttribLocation = (program, name) => + GLctx.getAttribLocation(GL.programs[program], UTF8ToString(name)); var _emscripten_glGetAttribLocation = _glGetAttribLocation; var readI53FromI64 = (ptr) => { @@ -5642,7 +5651,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } }; - var webglGetExtensions = function $webglGetExtensions() { + var webglGetExtensions = () => { var exts = getEmscriptenSupportedExtensions(GLctx); exts = exts.concat(exts.map((e) => "GL_" + e)); return exts; @@ -8266,7 +8275,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } } }, createContext(/** @type {HTMLCanvasElement} */ canvas, useWebGL, setInModule, webGLContextAttributes) { - if (useWebGL && Module.ctx && canvas == Module['canvas']) return Module.ctx; // no need to recreate GL context if it's already been created for this canvas. + if (useWebGL && Module['ctx'] && canvas == Module['canvas']) return Module['ctx']; // no need to recreate GL context if it's already been created for this canvas. var ctx; var contextHandle; @@ -8301,7 +8310,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } if (setInModule) { if (!useWebGL) assert(typeof GLctx == 'undefined', 'cannot set in module if GLctx is used, but we are a non-GL context that would replace it'); - Module.ctx = ctx; + Module['ctx'] = ctx; if (useWebGL) GL.makeContextCurrent(contextHandle); Browser.useWebGL = useWebGL; Browser.moduleContextCreatedCallbacks.forEach((callback) => callback()); @@ -8977,7 +8986,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } MainLoop.tickStartTime = _emscripten_get_now(); } - if (MainLoop.method === 'timeout' && Module.ctx) { + if (MainLoop.method === 'timeout' && Module['ctx']) { warnOnce('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!'); MainLoop.method = ''; // just warn once per call to set main loop } @@ -9921,7 +9930,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } } // If context creation failed, do not return a valid window - if (!Module.ctx && useWebGL) return 0; + if (!Module['ctx'] && useWebGL) return 0; // Initializes the framebuffer size from the canvas const canvas = Module['canvas']; @@ -9954,7 +9963,7 @@ function GetWindowInnerHeight() { return window.innerHeight; } for (var i = 0; i < GLFW.windows.length; i++) if (GLFW.windows[i] !== null) return; - delete Module.ctx; + delete Module['ctx']; }, swapBuffers:(winid) => { }, diff --git a/docs/assets/enduro/game.wasm b/docs/assets/enduro/game.wasm index e4c3f49d89834df5017323bc11f81933bc74e70e..6ade164b6209b91655ee7e75edfb83aa739514ca 100755 GIT binary patch delta 1533 zcmYLJU1%It6rOu#XJ#jJXEOP76DKwI&UST)NgBbVHc6Yk(xhpAi>N4l(EPMXW;UDb zCRSfG3lW4WK3MI=Cq={u5e-xlDGGftgdj+t1c_i@d{7^J5etIx+}VipFyGAO{Cwx0 z@0{y2BQeL4OrCvj(@ACbWLozcDuE_ zFf9*vjFA+6D9d6EzDBbr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