Files
Kaj SchittecatandClaude Opus 5.5 a986c79cfc web: merge web-companion: the companion backend in both front ends
Backend selection moves into the shared boot: a WadaBackendChoice
(web/mesh/BackendSelect.h) that host_main.cpp fills from --serial / --tcp /
--read-only and web_main.cpp from the page (Module.wadaBackend, with its own
data dir), and board.cpp creates the backend from it. The demo position is
only set for the demo. The companion link reports its state through
g_wada_link_hook (web_main.cpp passes it to Module.wadaLink). The browser
transports' JS joins the Emscripten link as --pre-js. WEB_BUILD.md keeps both
phases' sections. build.sh: "$0" relative to the caller's directory no longer
breaks smoke / serve / webtest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:06:51 +02:00

15 lines
731 B
C

#pragma once
// The web board's boot + loop, shared by both front ends:
// host_main.cpp native: an SDL2 window (or --headless) + the scripted tour
// web_main.cpp Emscripten: a <canvas> in a page, driven by the page's JS
// board.cpp owns the board globals and runs src/main.cpp's setup()/loop() order.
#include <stdint.h>
struct WadaBackendChoice; // web/mesh/BackendSelect.h
// setup(): storage, the mesh stand-in on the chosen backend (demo or a node), the UI.
void wadaBoardBegin(const WadaBackendChoice& choice);
// One iteration of src/main.cpp's loop(): UI first, then the mesh.
void wadaBoardStep();
// The deliberate power-off paths: flush what the device flushes (chat history is lazy).
void wadaBoardFlush();