Skip to main content

roxlap_formats/
lib.rs

1//! Voxlap on-disk formats and data manipulation.
2//!
3//! Parsers for `.vxl` (heightmap + slab voxel columns), `.kv6` / `.kvx`
4//! (sprite voxel data), and `.kfa` (kv6 transform / animation). Lands
5//! across the R2.* sub-substages of `PORTING-RUST.md`:
6//!
7//! - R2.1: `.kvx`
8//! - R2.2: `.kv6`
9//! - R2.3: `.vxl`
10//! - R2.4: `.kfa`
11//!
12//! [`edit`] hosts voxel-edit primitives (delslab/insslab/expandrle/
13//! compilerle/`ScumCtx`) and high-level wrappers (`set_spans`,
14//! `set_cube`, `set_sphere`, `set_rect`). They live with the data
15//! they manipulate; rendering stays in `roxlap-core`.
16
17mod bytes;
18
19/// Rigged-character container (`.rkc`) — meshes + skeleton + clips, the
20/// on-disk form of a complete animated voxel character. Built on
21/// [`kfa`] / [`kv6`] / [`sprite`].
22pub mod character;
23pub mod edit;
24/// Voxlap's `univec[256]` surface-normal direction table + the
25/// `normal → dir` quantiser ([`equivec::nearest_dir`]). Lives here (not
26/// roxlap-core) so [`kv6`] model builders can fill per-voxel `dir`
27/// without a circular dependency; roxlap-core re-exports it.
28pub mod equivec;
29/// Animated-GIF → [`voxel_clip::VoxelClip`] importer for Doom-style
30/// billboard sprites (stage BB). Feature-gated behind `gif`; see
31/// [`gif_import`] + `PORTING-BILLBOARD.md`.
32#[cfg(feature = "gif")]
33pub mod gif_import;
34pub mod kfa;
35pub mod kv6;
36pub mod kvx;
37/// Voxel materials — per-voxel opacity + blend mode (alpha / additive) for
38/// transparent voxels (smoke, glass, water, spell glows). See [`material`]
39/// + `PORTING-TRANSPARENCY.md`.
40pub mod material;
41pub mod palette;
42/// PNG-sequence / APNG → [`voxel_clip::VoxelClip`] importer for billboard
43/// sprites (stage BB). Feature-gated behind `png`; see [`png_import`].
44#[cfg(feature = "png")]
45pub mod png_import;
46/// Shared image → flat-voxel-slab voxelization for the billboard importers
47/// (BB). Internal; the `gif`/`png` decoders feed composited RGBA frames in.
48#[cfg(any(feature = "gif", feature = "png"))]
49mod slab;
50pub mod sprite;
51/// Animated voxel-sprite clips (`.rvc`) — keyframe + diff "GIF/MP4 for
52/// voxel models" for effects (flame, spells). Frames use the GPU sprite
53/// model's dense-column layout; see [`voxel_clip`] + `PORTING-VOXEL-CLIP.md`.
54pub mod voxel_clip;
55pub mod vxl;
56pub mod xform;
57
58pub use material::{material_for_color, BlendMode, Material, MaterialTable};
59pub use palette::Rgb6;