Files
smack-a-brother/tools/web_pre.js
T
shweetandClaude Opus 5.5 2007fb7edc Initial commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:30:33 -05:00

10 lines
443 B
JavaScript

// The browser build: keeps the prefs folder (/libsdl, where SDL puts it on the web) in IndexedDB, loading it before
// the game starts so saved settings are there when it reads them. The game writes it back after every save.
Module.preRun = Module.preRun || [];
Module.preRun.push(() => {
FS.mkdir("/libsdl");
FS.mount(IDBFS, {}, "/libsdl");
addRunDependency("prefs");
FS.syncfs(true, () => removeRunDependency("prefs"));
});