Commit Graph
3 Commits
Author SHA1 Message Date
Dark98 02c3d8fb10 feat(web-audio): implement Class56 MIDI player with FluidSynth and TimGM6mb.sf2
Enables authentic General MIDI music playback in `2006Scape-Web` over both HTTP and HTTPS by implementing the missing `Class56_Sub1_Sub1` web adapter and wiring `js-synthesizer` (`libfluidsynth-2.3.0.js`) with the `TimGM6mb.sf2` SoundFont.

### Java MIDI Pipeline Bridge
- `Class56_Sub1_Sub1.java`:
  - Added `org.scape2006.web` implementation of `Class56` forwarding `method827`, `method828`, `method830`, `method831`, `method832`, and `method833` to `DesktopHooks.playMidiBytes`, `setSignlinkVolume`, and `stopSignlinkMidi`.
- `build.gradle`:
  - Patched `Game.constructMusic()` in `syncSharedSources` to instantiate `new Class56_Sub1_Sub1()` directly instead of `Class.forName("Class56_Sub1_Sub1").newInstance()`, preventing `musicIsntNull()` from returning `false`.

### FluidSynth Web Audio & Caching
- `src/main/webapp/libfluidsynth-2.3.0.js`, `js-synthesizer.min.js`, `TimGM6mb.sf2`:
  - Bundled FluidSynth WASM/JS synthesizer and General MIDI SoundFont (`5.8M`) locally for offline and plain-HTTP LAN compatibility.
- `src/main/webapp/index.html`:
  - Wired `window.scapeWebAudio` (`ensureFluidSynth`, `playMidi`, `setMidiVolume`, `stopMidi`) to load `TimGM6mb.sf2`, loop tracks via `setPlayerLoop(-1)`, and resume pending MIDI on first user gesture.
- `src/main/webapp/sw.js`:
  - Added `libfluidsynth-2.3.0.js`, `js-synthesizer.min.js`, and `TimGM6mb.sf2` to `SHELL_ASSETS` and bumped `CACHE_VERSION` to `2006scape-web-v5`.
2026-12-01 14:53:04 +00:00
Dark98 ededb882a0 refactor(web): rename 117HD WebGL2 renderer and UI references to 317HD
Renames `WebHd117Renderer` and all remaining `117HD` symbols, build exclusions, and UI labels in `2006Scape-Web` to `317HD`.

### WebGL2 Renderer & Build
- `WebHd317Renderer.java`:
  - Renamed from `WebHd117Renderer.java` and updated class/log references to `WebHd317Renderer` / `317HD`.
- `build.gradle`, `WebLauncher.java`, `RSImageProducer.java`, `DesktopHooks.java`, `WebGL2.java`:
  - Updated `DesktopHd117Renderer.java` exclusion to `DesktopHd317Renderer.java` and updated pipeline/renderer call sites to `HD317Pipeline` and `WebHd317Renderer`.
- `src/main/webapp/index.html`:
  - Updated UI label from `117HD (WebGL2)` to `317HD (WebGL2)`.
2026-11-30 21:57:21 +00:00
Dark98 3331ab745b feat(web): add 2006Scape TeaVM WebGL2 client with mobile support and classic 2006 UI
Initializes the TeaVM-based 2006Scape-Web client repository with WebGL2 117HD rendering, WebSocket networking, SpessaSynth MIDI/PCM audio, and mobile-compatible touch/viewport controls. Preserves Revision 377 cache preloading via IndexedDB and localStorage-backed script and config persistence.

### Core Web Runtime & Rendering
- WebLauncher & DesktopHooks:
  - Added TeaVM entry point with URL/localStorage option parsing, async 377 cache preloading, and WebSocket port routing.
  - Implemented DesktopHooks.boxReflectValue using JSWrapper.isJava/maybeUnwrap to box TeaVM reflection primitives, plus localStorage persistence for plugin settings and imported scripts.
- WebHd117Renderer & RSImageProducer:
  - Implemented WebGL2 117HD rendering with 4x4 chunked static scenery VBOs and 0x010203 transparency sentinel so 0x000000 black UI elements stay opaque.
- WebReflectionSupplier:
  - Exposed PluginContext, PluginGraphics, ScriptInterpreter, ID lists, and Math/System/String/collection methods for TeaVM runtime reflection.

### Mobile & Classic 2006 Web UI
- index.html & RSApplet:
  - Styled the page to match the classic 2006 RuneScape webclient with optional classic navbar (auto-hidden below 765px), 1999-2006 Jagex footer, and responsive Fixed/Resizable/Fullscreen scaling.
  - Added Options modal (auto-login, server, world, 117HD, display mode, navbar) with scrollable body in mobile landscape.
  - Implemented Android-parity touch controls (tap, 450ms long-press right-click, 1-finger camera drag, 2-finger pinch zoom clamped to -1..8, and auto-keyboard on input fields).
2026-11-30 20:45:03 +00:00