Blood & Magic

Dev Log

Chronological notes from the port. Newest entries first.

2026-11-21 — Website deployment

The static site is generated into site/public and rsynced to /var/www/games.darkvision.dev on this host. nginx serves it from a dedicated server block; certbot issued a Let's Encrypt certificate and set up the HTTP-to-HTTPS redirect.

The data-free Linux/Windows archives and the encrypted full installer were verified over the public HTTPS endpoints. The deployed tree contains no game data, no password file and no metadata JSON; the password hash is the only credential-derived value in the page.

2026-11-21 — Windows port, installer and website

The platform layer was already mostly portable SDL2 code; the POSIX pieces were file I/O, the frame limiter, save enumeration and watcom.h. Those were split into portable implementations plus a small Windows entry point and clock_gettime() shim. The engine gained OS_WINDOWS branches mirroring the existing OS_LINUX ones.

The Windows build is a PE32 GUI executable with static libgcc/libstdc++, so SDL2.dll is the only non-system dependency. The NSIS installer is per-user, installs under %LOCALAPPDATA%, and writes saves to %APPDATA% so an uninstall cannot destroy them.

Two path bugs were fixed along the way: the SaveMgr builds names like ./1.sav, which needed to be normalised before the save-directory redirect, and screenshots are user paths, not DOS game paths, so they now use a direct UTF-8 opener.

Verified with a clean cross-build, a Wine end-to-end install/run/uninstall test, and a Windows save-redirection test that wrote to %APPDATA% and not to the working directory.

The asset-bearing installer is published only as an AES-256 7-Zip archive with encrypted headers. make site-full generates a random password into a git-ignored file (or accepts BAM_FULL_PASSWORD), and the website stores only its SHA-256 so deployments do not need the secret. The archive is verified to decrypt to the exact signed-off installer.

2026-11-21 — Cinematic audio

libsmacker already decodes Smacker audio; the missing part was feeding it to the mixer in step with the video frames. Each movie track gets an SDL_AudioStream that converts 8/16-bit mono/stereo at the source rate into the device format. Volume and pan are applied at mix time, so the engine's scripted fades affect already-queued audio correctly.

The SMK frame-type table is parsed from the header because libsmacker keeps the previous chunk when a frame has no audio. Every movie's last handful of frames are audio-less, so without the table the final chunk would repeat. Each stream is primed with two device buffers of silence to absorb the 70 Hz video pacing jitter.

Tested by capturing the SDL disk-audio driver output and checking for gaps, plus controlled pan/volume tests for stereo and mono sources.

2026-11-21 — Platform modernization

The first refactor replaced the C-style platform files with modern C++: RAII wrappers for SDL objects, std::array/std::optional/std::string, portable std::filesystem path resolution with a cache, and a consistent logging/env-var layer. The video path now writes directly into a locked streaming texture, and the window is resizable with fullscreen support.

This was verified against the original menu and scenario screenshots; the menu output was byte-identical.