feat(bindings): DungeonFile handle for dungeon.dat and the magic map #444

Merged
jqueuniet merged 1 commit from feat/443-dungeon-handle into main 2026-10-31 07:53:26 +01:00
Owner

Part of #443.

Adds DungeonFile, a dungeon.dat parsed once, in Rust, wasm, C and Python:

  • to_json, skproject_json
  • map_layout, level_layout
  • map_png, level_png, map_chips, level_chips, drawn through a GraphicsArchive

Options objects as in GraphicsArchive; unknown keys are errors. Output byte-identical to the free functions, which now share its internals. Named DungeonFile to avoid clashing with dm2_dungeon_* C exports and dm2_dungeon::Dungeon.

Speed gain is small (levels 1.03×, maps 1.1×, layouts 1.5×): rendering dominates. Removal of the free functions follows in a stacked PR.

https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7

Part of #443. Adds `DungeonFile`, a `dungeon.dat` parsed once, in Rust, wasm, C and Python: - `to_json`, `skproject_json` - `map_layout`, `level_layout` - `map_png`, `level_png`, `map_chips`, `level_chips`, drawn through a `GraphicsArchive` Options objects as in `GraphicsArchive`; unknown keys are errors. Output byte-identical to the free functions, which now share its internals. Named `DungeonFile` to avoid clashing with `dm2_dungeon_*` C exports and `dm2_dungeon::Dungeon`. Speed gain is small (levels 1.03×, maps 1.1×, layouts 1.5×): rendering dominates. Removal of the free functions follows in a stacked PR. https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
feat(bindings): DungeonFile handle for dungeon.dat and the magic map
All checks were successful
CI / msrv (1.90) (pull_request) Successful in 33s
CI / audit (pull_request) Successful in 20s
CI / stable (pull_request) Successful in 59s
CI / python bindings (3.11) (pull_request) Successful in 25s
CI / msrv (1.90) (push) Successful in 28s
CI / audit (push) Successful in 20s
CI / stable (push) Successful in 58s
CI / python bindings (3.11) (push) Successful in 27s
b1ce126d31
DungeonFile parses a dungeon.dat once: lossless and skproject JSON, map
and level layouts, and magic-map images and chips drawn through a
GraphicsArchive, with options objects as GraphicsArchive's. In wasm,
FFI and Python. The free functions stay for now, sharing its code.

Part of #443

Claude-Session: https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
jqueuniet deleted branch feat/443-dungeon-handle 2026-10-31 07:53:26 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools!444
No description provided.