diff --git a/Makefile.emscripten b/Makefile.emscripten index 246cce4..381d047 100644 --- a/Makefile.emscripten +++ b/Makefile.emscripten @@ -10,7 +10,7 @@ EMFLAGS += -s TOTAL_MEMORY=134217728 EMFLAGS += -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1 LFLAGS := $(EMFLAGS) -LFLAGS += -s EXPORTED_FUNCTIONS="['_main','_musfade_setvolval_all']" +LFLAGS += -s EXPORTED_FUNCTIONS="['_main','_musfade_setvolval_all','_ags_setAntialiasedStringMode']" docs/xsystem35.js: emterpretify_whitelist src/xsystem35 $(CC) xsystem35.bc $(LFLAGS) @emterpretify_whitelist -o $@ diff --git a/docs/xsystem35.html b/docs/xsystem35.html index e0dc8ec..89ca321 100644 --- a/docs/xsystem35.html +++ b/docs/xsystem35.html @@ -37,7 +37,9 @@ - +
diff --git a/web/shell/shell.ts b/web/shell/shell.ts index 97d1f68..ce4f50b 100644 --- a/web/shell/shell.ts +++ b/web/shell/shell.ts @@ -2,6 +2,7 @@ var $: (selector:string)=>HTMLElement = document.querySelector.bind(document); // xsystem35 exported functions declare function _musfade_setvolval_all(vol: number): void; +declare function _ags_setAntialiasedStringMode(on: number): void; declare namespace Module { var noInitialRun: boolean; @@ -33,6 +34,7 @@ class System35Shell { status: HTMLElement = document.getElementById('status'); private zoom:ZoomManager; private volumeControl: VolumeControl; + private antialiasCheckbox: HTMLInputElement; constructor() { this.imageLoader = new ImageLoader(this); @@ -64,6 +66,9 @@ class System35Shell { this.volumeControl.addEventListener(this.updateVolume.bind(this)); xsystem35.cdPlayer = new CDPlayer(this.imageLoader, this.volumeControl); this.zoom = new ZoomManager(); + this.antialiasCheckbox = $('#antialias'); + this.antialiasCheckbox.addEventListener('change', this.antialiasChanged.bind(this)); + this.antialiasCheckbox.checked = localStorage.getItem('antialias') != 'false'; } run() { @@ -72,6 +77,7 @@ class System35Shell { setTimeout(() => { Module.callMain(); this.updateVolume(); + this.antialiasChanged(); }, 0); } @@ -98,6 +104,11 @@ class System35Shell { private updateVolume() { _musfade_setvolval_all(Math.round(this.volumeControl.volume() * 100)); } + + private antialiasChanged() { + localStorage.setItem('antialias', String(this.antialiasCheckbox.checked)); + _ags_setAntialiasedStringMode(this.antialiasCheckbox.checked ? 1 : 0); + } } class CDPlayer {