diff --git a/.gitignore b/.gitignore index 370ac8c780..e554394c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ __pycache__ *.kdev4 .kdev4/ *.kate-swp +*~ +*-autosave.kra diff --git a/.gitmodules b/.gitmodules index 7d0228ddba..bc88e8db73 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,6 @@ path = external/gamecontrollerdb url = https://github.com/taisei-project/SDL_GameControllerDB.git branch = master +[submodule "external/koishi"] + path = external/koishi + url = https://github.com/taisei-project/koishi diff --git a/atlas/common/part/stardust.png b/atlas/common/part/stardust.png deleted file mode 100644 index 8d7ffeab87..0000000000 Binary files a/atlas/common/part/stardust.png and /dev/null differ diff --git a/atlas/common/proj/hghost.png b/atlas/common/proj/hghost.png deleted file mode 100644 index 4a5f93d2a8..0000000000 Binary files a/atlas/common/proj/hghost.png and /dev/null differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0000.webp b/atlas/coroutines_temp/part/bullet_clear.frame0000.webp new file mode 100644 index 0000000000..4a8dc5ab34 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0000.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0001.webp b/atlas/coroutines_temp/part/bullet_clear.frame0001.webp new file mode 100644 index 0000000000..59f5982f63 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0001.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0002.webp b/atlas/coroutines_temp/part/bullet_clear.frame0002.webp new file mode 100644 index 0000000000..dc9a6139cf Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0002.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0003.webp b/atlas/coroutines_temp/part/bullet_clear.frame0003.webp new file mode 100644 index 0000000000..4d550efdf8 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0003.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0004.webp b/atlas/coroutines_temp/part/bullet_clear.frame0004.webp new file mode 100644 index 0000000000..b36b9cc3c8 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0004.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0005.webp b/atlas/coroutines_temp/part/bullet_clear.frame0005.webp new file mode 100644 index 0000000000..3798ecaca7 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0005.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0006.webp b/atlas/coroutines_temp/part/bullet_clear.frame0006.webp new file mode 100644 index 0000000000..501935245b Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0006.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0007.webp b/atlas/coroutines_temp/part/bullet_clear.frame0007.webp new file mode 100644 index 0000000000..ccb7bd6383 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0007.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0008.webp b/atlas/coroutines_temp/part/bullet_clear.frame0008.webp new file mode 100644 index 0000000000..f9f95aa5de Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0008.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0009.webp b/atlas/coroutines_temp/part/bullet_clear.frame0009.webp new file mode 100644 index 0000000000..039d445a5a Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0009.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0010.webp b/atlas/coroutines_temp/part/bullet_clear.frame0010.webp new file mode 100644 index 0000000000..a6c0f91ca9 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0010.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0011.webp b/atlas/coroutines_temp/part/bullet_clear.frame0011.webp new file mode 100644 index 0000000000..46463fc82f Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0011.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0012.webp b/atlas/coroutines_temp/part/bullet_clear.frame0012.webp new file mode 100644 index 0000000000..91ff4cc273 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0012.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0013.webp b/atlas/coroutines_temp/part/bullet_clear.frame0013.webp new file mode 100644 index 0000000000..c10d1034d3 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0013.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0014.webp b/atlas/coroutines_temp/part/bullet_clear.frame0014.webp new file mode 100644 index 0000000000..196f4999aa Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0014.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0015.webp b/atlas/coroutines_temp/part/bullet_clear.frame0015.webp new file mode 100644 index 0000000000..a3cecf2de5 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0015.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0016.webp b/atlas/coroutines_temp/part/bullet_clear.frame0016.webp new file mode 100644 index 0000000000..e5378fc3ef Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0016.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0017.webp b/atlas/coroutines_temp/part/bullet_clear.frame0017.webp new file mode 100644 index 0000000000..ea0a425bc3 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0017.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0018.webp b/atlas/coroutines_temp/part/bullet_clear.frame0018.webp new file mode 100644 index 0000000000..e5e8692f98 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0018.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0019.webp b/atlas/coroutines_temp/part/bullet_clear.frame0019.webp new file mode 100644 index 0000000000..5a589b819b Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0019.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0020.webp b/atlas/coroutines_temp/part/bullet_clear.frame0020.webp new file mode 100644 index 0000000000..6ef43d5035 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0020.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0021.webp b/atlas/coroutines_temp/part/bullet_clear.frame0021.webp new file mode 100644 index 0000000000..228412be60 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0021.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0022.webp b/atlas/coroutines_temp/part/bullet_clear.frame0022.webp new file mode 100644 index 0000000000..87c3769507 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0022.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0023.webp b/atlas/coroutines_temp/part/bullet_clear.frame0023.webp new file mode 100644 index 0000000000..fd33ac5ea2 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0023.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0024.webp b/atlas/coroutines_temp/part/bullet_clear.frame0024.webp new file mode 100644 index 0000000000..26ec1f75f1 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0024.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0025.webp b/atlas/coroutines_temp/part/bullet_clear.frame0025.webp new file mode 100644 index 0000000000..b82075e2ee Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0025.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0026.webp b/atlas/coroutines_temp/part/bullet_clear.frame0026.webp new file mode 100644 index 0000000000..3f75b2c308 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0026.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0027.webp b/atlas/coroutines_temp/part/bullet_clear.frame0027.webp new file mode 100644 index 0000000000..5e02d56eba Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0027.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0028.webp b/atlas/coroutines_temp/part/bullet_clear.frame0028.webp new file mode 100644 index 0000000000..20b52be7c1 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0028.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0029.webp b/atlas/coroutines_temp/part/bullet_clear.frame0029.webp new file mode 100644 index 0000000000..64c84e1f68 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0029.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0030.webp b/atlas/coroutines_temp/part/bullet_clear.frame0030.webp new file mode 100644 index 0000000000..981196dcb6 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0030.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0031.webp b/atlas/coroutines_temp/part/bullet_clear.frame0031.webp new file mode 100644 index 0000000000..73e091aa14 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0031.webp differ diff --git a/atlas/coroutines_temp/part/bullet_clear.frame0032.webp b/atlas/coroutines_temp/part/bullet_clear.frame0032.webp new file mode 100644 index 0000000000..73e091aa14 Binary files /dev/null and b/atlas/coroutines_temp/part/bullet_clear.frame0032.webp differ diff --git a/atlas/coroutines_temp/part/stardust.webp b/atlas/coroutines_temp/part/stardust.webp new file mode 100644 index 0000000000..7e2749ba45 Binary files /dev/null and b/atlas/coroutines_temp/part/stardust.webp differ diff --git a/atlas/coroutines_temp/proj/hghost.webp b/atlas/coroutines_temp/proj/hghost.webp new file mode 100644 index 0000000000..3809e2aa48 Binary files /dev/null and b/atlas/coroutines_temp/proj/hghost.webp differ diff --git a/atlas/meson.build b/atlas/meson.build index 216e1f0684..284e26816b 100644 --- a/atlas/meson.build +++ b/atlas/meson.build @@ -44,6 +44,7 @@ atlases = [ ['gray16', [preset_png]], ['huge', []], ['portraits', ['--width=4096', '--height=4096']], + ['coroutines_temp', []], # TODO merge this into `common` when coroutines are merged ] atlas_profiles = [ diff --git a/atlas/overrides/proj/hghost.spr b/atlas/overrides/proj/hghost.spr index aa80c2871e..d869dd38a7 100644 --- a/atlas/overrides/proj/hghost.spr +++ b/atlas/overrides/proj/hghost.spr @@ -1,3 +1,2 @@ - -w = 22 -h = 23 +w = 21 +h = 34 diff --git a/emscripten/preamble.js b/emscripten/preamble.js index 203240bb9d..00a9b98e81 100644 --- a/emscripten/preamble.js +++ b/emscripten/preamble.js @@ -1,22 +1,106 @@ -Module['preRun'].push(function() { - ENV["TAISEI_NOASYNC"] = "1"; - ENV["TAISEI_NOUNLOAD"] = "1"; - ENV["TAISEI_PREFER_SDL_VIDEODRIVERS"] = "emscripten"; - ENV["TAISEI_RENDERER"] = "gles30"; - - FS.mkdir('/persistent'); - FS.mount(IDBFS, {}, '/persistent'); - - // This function has been removed from Emscripten, but SDL still uses it... - Module['Pointer_stringify'] = function(ptr) { - return UTF8ToString(ptr); - } +function E(id) { return document.getElementById(id); } + +var statusElement = E('status'); +var progressElement = E('progress'); +var spinnerElement = E('spinner'); +var canvasElement = E('canvas'); +var canvasContainerElement = E('canvasContainer'); +var logToggleElement = E('logToggle'); +var logToggleContainerElement = E('logToggleContainer'); +var logContainerElement = E('logContainer'); +var logOutputElement = E('output'); +var dlMessage = statusElement.innerText; +logToggleElement.checked = false; - Pointer_stringify = Module['Pointer_stringify'] - window.Pointer_stringify = Module['Pointer_stringify'] +function toggleLog() { + logContainerElement.hidden = !logToggleElement.checked; + logOutputElement.scrollTop = logOutputElement.scrollHeight; +} + +var glContext = canvasElement.getContext('webgl2', { + 'alpha' : false, + 'antialias' : false, + 'depth' : false, + 'powerPreference' : 'high-performance', + 'premultipliedAlpha' : true, + 'preserveDrawingBuffer' : false, + 'stencil' : false, }); +// glContext = WebGLDebugUtils.makeDebugContext(glContext); + +canvasElement.addEventListener("webglcontextlost", function(e) { + alert('WebGL context lost. You will need to reload the page.'); + e.preventDefault(); +}, false); + +logOutputElement.value = ''; // clear browser cache + +Module = { + 'preRun': [function() { + ENV["TAISEI_NOASYNC"] = "1"; + ENV["TAISEI_NOUNLOAD"] = "1"; + ENV["TAISEI_PREFER_SDL_VIDEODRIVERS"] = "emscripten"; + ENV["TAISEI_RENDERER"] = "gles30"; + + FS.mkdir('/persistent'); + FS.mount(IDBFS, {}, '/persistent'); + }], + 'postRun': [], + 'onFirstFrame': function() { + canvasContainerElement.hidden = false; + logToggleContainerElement.style.display = "inline-block"; + Module['setStatus']('', true); + }, + 'print': function(text) { + if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); + console.log(text); + logOutputElement.value += text + "\n"; + logOutputElement.scrollTop = logOutputElement.scrollHeight; // focus on bottom + }, + 'printErr': function(text) { + if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' '); + console.error(text); + }, + 'canvas': canvasElement, + 'preinitializedWebGLContext': glContext, + 'setStatus': function(text, force) { + var ss = Module['setStatus']; + if (!text && !force) return; + if (!ss.last) ss.last = { time: Date.now(), text: '' }; + if (text === ss.last.text) return; + var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); + var now = Date.now(); + if (m && now - ss.last.time < 30) return; // if this is a progress update, skip it if too soon + ss.last.time = now; + ss.last.text = text; + if (m) { + text = m[1]; + progressElement.value = parseInt(m[2])*100; + progressElement.max = parseInt(m[4])*100; + progressElement.hidden = false; + spinnerElement.hidden = false; + } else { + progressElement.value = null; + progressElement.max = null; + progressElement.hidden = true; + if (!text) spinnerElement.hidden = true; + } + statusElement.innerText = text.replace(/^Downloading(?: data)?\.\.\./, dlMessage).replace('...', '…'); + console.log("[STATUS] " + statusElement.innerText); + }, + 'totalDependencies': 0, + 'monitorRunDependencies': function(left) { + Module['totalDependencies'] = Math.max(Module['totalDependencies'], left); + Module['setStatus'](left ? 'Preparing… (' + (Module['totalDependencies']-left) + '/' + Module['totalDependencies'] + ')' : 'All downloads complete.'); + } +}; + +window.onerror = function(error) { + Module['setStatus']('Error: ' + error); +}; + function SyncFS(is_load, ccptr) { FS.syncfs(is_load, function(err) { Module['ccall']( @@ -25,16 +109,6 @@ function SyncFS(is_load, ccptr) { [is_load, err, ccptr] ); }); -}; - -Module['preinitializedWebGLContext'] = document.getElementById('canvas').getContext('webgl2', { - alpha : false, - antialias : false, - depth : false, - powerPreference : 'high-performance', - premultipliedAlpha : true, - preserveDrawingBuffer : false, - stencil : false, -}); +} -// Module['preinitializedWebGLContext'] = WebGLDebugUtils.makeDebugContext(Module['preinitializedWebGLContext']); +var debug_tables; // closure may fail on debug builds without this diff --git a/emscripten/shell.html b/emscripten/shell.html index e25e26e19b..db9210aa69 100644 --- a/emscripten/shell.html +++ b/emscripten/shell.html @@ -210,91 +210,6 @@