Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Emscripten builds support #3630

Merged
merged 34 commits into from
Feb 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f20ecc7
seqdisp.cpp: Add cancel functionality to on-demand video provider
past-due Jan 29, 2024
4c2e887
[CMake] Add EXCLUDE_FROM_ALL
past-due Feb 6, 2024
0b9850f
game.cpp: Remove unnecessary include
past-due Feb 7, 2024
5728d35
Update .gitignore
past-due Feb 7, 2024
3119b06
Initial Emscripten support
past-due Feb 7, 2024
17abf2e
[GitHub Actions] Initial Emscripten CI
past-due Feb 8, 2024
81ae708
Emscripten: Generate a service worker using workbox-cli
past-due Feb 9, 2024
79f4dc8
[GitHub Actions] Emscripten: Install workbox-cli
past-due Feb 9, 2024
f800fc0
Add Emscripten docs
past-due Feb 10, 2024
88dfc99
[GitHub Actions] Emscripten: Package and upload artifacts
past-due Feb 10, 2024
34e9946
Emscripten: Adjust paths to optional packages
past-due Feb 10, 2024
1297016
Emscripten: Attempt to opt-in to persistent storage on user-initiated…
past-due Feb 10, 2024
8face72
Emscripten: Add storage persistence status to Options modal
past-due Feb 11, 2024
f0872fa
[GitHub Actions] Emscripten: Refactoring, support deployment
past-due Feb 12, 2024
c189ab8
[CMake] Add default packaging config for Emscripten
past-due Feb 12, 2024
94bc609
Emscripten: Adjust config dir suffix
past-due Feb 12, 2024
37cb0d3
[CMake] Silence basis_universal_host_build output
past-due Feb 12, 2024
ac42b7a
[GitHub Actions]: Update release workflow
past-due Feb 12, 2024
40d7bd1
Emscripten: Various tweaks
past-due Feb 12, 2024
59fb48e
[OpenGL] Emscripten: Explicitly enable WebGL extensions
past-due Feb 12, 2024
ee1a2f9
debug.cpp: Adjust defaults for Emscripten
past-due Feb 12, 2024
75da34d
Emscripten: Various shell tweaks
past-due Feb 12, 2024
f03e3d8
Emscripten: Better error-handling for syncfs
past-due Feb 13, 2024
aaaaecc
Emscripten: Add beacon
past-due Feb 13, 2024
b77198e
[GitHub Actions] Update linter, exclude Emscripten JS
past-due Feb 13, 2024
52c19de
Emscripten: Update wz-workbox-config.js
past-due Feb 13, 2024
c90aab1
Emscripten: Improve WebAssembly.Memory allocation strategy
past-due Feb 13, 2024
d7d7111
[CMake] Emscripten: Add bdrops/missionend.png
past-due Feb 14, 2024
0b11aef
Emscripten: Improve WebAssembly.Memory limit defaults, add UI
past-due Feb 14, 2024
5d5471e
display3d.cpp: Trigger abort() in crash handler test on Emscripten
past-due Feb 14, 2024
bf25ed9
Emscripten: Add UI for displaying uncaught runtime errors
past-due Feb 14, 2024
44c5675
Emscripten: Always persist FS changes on saveGame
past-due Feb 14, 2024
306c8e0
warzoneconfig.cpp: Default Emscripten FMVmode to 2x
past-due Feb 14, 2024
1a17497
Emscripten: Disable the Options nav button during loading
past-due Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Emscripten: Adjust config dir suffix
  • Loading branch information
past-due committed Feb 13, 2024
commit 94bc6092e44e7867fd4aa30d2eef9b70841a1bd6
54 changes: 35 additions & 19 deletions platforms/emscripten/shell.html
Original file line number Diff line number Diff line change
@@ -647,21 +647,6 @@ <h1 class="modal-title fs-5" id="refreshForUpdateLabel">Update Required</h1>
var progressElement = document.getElementById('progress');
const originalStartButtonContents = document.getElementById('start-button').innerHTML;

var WZ_CONFIG_DIR_SUFFIX = (() => {
// Determine default config dir suffix based on window.location, to ensure that separate branches get separate config directories
// If in root, no suffix. If in "/dev/", should be "-dev"
var pathArray = window.location.pathname.split('/').filter(n => n);
if (!window.location.pathname.endsWith('/') && pathArray.length > 0) {
pathArray.pop();
}
let dirSuffix = pathArray.join('-');
if (dirSuffix.length > 0) {
return "-" + dirSuffix;
}
else {
return "";
}
})();
let WZ_DATA_FILES_URL_SUBDIR = (() => {
return window.location.pathname.replace(/[^/]*$/, '');
})();
@@ -682,17 +667,48 @@ <h1 class="modal-title fs-5" id="refreshForUpdateLabel">Update Required</h1>
let WZ_MUSIC_BASE_URL = WZ_DATA_FILES_URL_HOST + WZ_DATA_FILES_URL_SUBDIR + 'pkg/music/';
let WZ_DATA_TERRAIN_BASE_URL = WZ_DATA_FILES_URL_HOST + WZ_DATA_FILES_URL_SUBDIR + 'pkg/terrain_overrides/';

// Initialize title badge (based on location pathname)
// Initialize config dir suffix and the title badge (based on location pathname)
var WZ_CONFIG_DIR_SUFFIX = "";
(function() {

WZ_CONFIG_DIR_SUFFIX = (() => {
// Determine default config dir suffix based on window.location, to ensure that separate branches get separate config directories
var pathArray = window.location.pathname.split('/').filter(n => n);
if (!window.location.pathname.endsWith('/') && pathArray.length > 0) {
pathArray.pop();
}
let dirSuffix = pathArray.join('-');
if (dirSuffix.length > 0) {
return "-" + dirSuffix;
}
else {
return "";
}
})();

var el = document.getElementById('wz-title-badge');
if (/\/(latest|stable|web)[\/]?$/.test(WZ_DATA_FILES_URL_SUBDIR) || WZ_DATA_FILES_URL_SUBDIR === '/' || WZ_DATA_FILES_URL_SUBDIR.length === 0) {
el.innerText = 'Web Edition';
if (/\/(latest|previous)[\/]?$/.test(WZ_DATA_FILES_URL_SUBDIR) || WZ_DATA_FILES_URL_SUBDIR === '/' || WZ_DATA_FILES_URL_SUBDIR.length === 0) {
WZ_CONFIG_DIR_SUFFIX = "";
el.innerText = 'Web Edition';
}
else if (/^\/release\/([^\/]+)/.test(WZ_DATA_FILES_URL_SUBDIR)) {
// Release build (but possibly an older one, or a pre-release)
WZ_CONFIG_DIR_SUFFIX = "";
let tagname = WZ_DATA_FILES_URL_SUBDIR.match(/^\/release\/([^\/]+)/)[1];
el.innerText = tagname;
if (/[\-\_](beta|rc)[\d]*[\/]?$/.test(WZ_DATA_FILES_URL_SUBDIR)) {
document.body.classList.add('prerelease');
}
}
else if (/([\-\_]beta[\d]?|preview|prerelease|pre-release)[\/]?$/.test(WZ_DATA_FILES_URL_SUBDIR)) {
else if (/(preview|prerelease)[\/]?$/.test(WZ_DATA_FILES_URL_SUBDIR)) {
WZ_CONFIG_DIR_SUFFIX = "";
document.body.classList.add('prerelease');
el.innerText = 'Pre-release';
}
else if (/\/(dev|development|master|main)[\/]?$/.test(WZ_DATA_FILES_URL_SUBDIR)) {
if (/\/(dev|development)[\/]?$/.test(WZ_DATA_FILES_URL_SUBDIR)) {
WZ_CONFIG_DIR_SUFFIX = "-dev";
}
document.body.classList.add('dev-preview');
el.innerText = 'Dev Preview';
}