Repository navigation
Frontend Crate
The executable: window, input, audio, HUD, menus, cutscenes, configuration and the developer tools. API docs (private items included): https://dagrigorev.github.io/OpenBlood/openblood/
Dependencies: ob-engine, ob-game, winit (window and input), softbuffer (present a
CPU framebuffer), cpal (audio output), png (screenshots), rayon.
| Module | Purpose | Key items |
|---|---|---|
main |
Argument parsing, data directory search, level list, startup |
level_list, find_data_dir
|
app |
winit ApplicationHandler: input → Game::update → render → scale → HUD → present; level changes, saves, cutscene queue, frame cap, profiler |
App, App::frame, App::pace_frame
|
config |
openblood.ini read/write, option lists |
Config, Upscale, RESOLUTIONS, MAX_FPS, ANTIALIAS
|
scale |
Frame → window: area averaging (supersampling AA), nearest / bilinear / sharp-bilinear upscaling, letterboxing |
resample, resample_cols, fit
|
hud |
Status bar, weapon QAV overlay, messages, fonts from the original tiles |
draw, draw_qav, draw_text, font_base
|
menu |
Front-end menus (episodes, difficulty, options, save/load, help, credits) |
Menu, Screen, MenuAction, SKILLS
|
audio |
SFX/RAW mixing with 3D panning, preloading, music streaming, cutscene audio channel |
Audio, Sound, parse_sfx, MOVIE_OWNER
|
cdaudio |
CUE/BIN parsing, Red Book track ripping, ISO 9660 reading of the data track, WAV streaming |
parse_cue, extract, extract_dir, stream_wav
|
fm |
Clean-room two-operator FM voices (OPL2/OPL3 style): envelopes, waveforms, feedback, key scaling, tremolo, vibrato |
Voice, Timbre
|
midi |
Standard MIDI files with EMIDI track/loop controllers, AdLib timbre bank, sequencer and streaming thread |
Song, Player, parse_bank, stream
|
movie |
Cutscene playback (Smacker video + separate WAV soundtrack) |
Movie, intro, find
|
tools |
Command-line developer tools (openblood <tool> ...) |
run_tool, shot, save_png
|
-
Rendererdraws the 3D view column-major at output × render scale × AA. -
scale::resample_colsreads the column-major buffer directly (no transpose) and writes the window-sized image. An exact 2:1 shrink (4x AA at native size) takes a packed 2×2 averaging fast path. - HUD and menus are drawn at window resolution, then softbuffer presents.
- With a frame cap,
pace_framesleeps until ~1.5 ms before the slot and spins the rest, giving even frame spacing (60 fps cap measured at 16.67 ± 0.27 ms).
All sound effects are decoded once at startup (Audio::preload_all, 8-bit samples, ~10 ms).
CD music is streamed from music/TRACKnn.WAV in half-second chunks over a bounded channel, so
level changes never load a whole track. When the level's track was not ripped, midi::stream
renders its Song= from BLOOD.INI (NAME.MID in SOUNDS.RFF) with the FM voices and the
GMTIMBRE.TMB instrument bank into the same kind of chunks, on a background thread (about 30x
faster than real time). Cutscenes take over a dedicated owner channel and mute
music while playing.
-
OB_PROFILE=1: frames slower than 12 ms are written (buffered) toopenblood-profile.logwith time per stage. -
OB_AUTOSWITCH=n: advance to the next level every n seconds (stress-tests level loading). -
openblood perf DATA MAP [W H]: offline simulation and per-phase render timings.
More in Developer Tools.
OpenBlood is MIT licensed and contains no Blood game content. Blood is © 1997 Monolith Productions. This wiki is generated from the wiki/ folder; edit it there.