feat(bindings)!: SaveGame keeps its GraphicsArchive #457

Merged
jqueuniet merged 1 commit from feat/451-save-game-keeps-graphics into main 2026-10-31 10:24:14 +01:00
Owner

Closes #451. Stacked on #456.

SaveGame holds the GraphicsArchive it was built with, shared through an Arc:

  • toBytes, inventory, container, putInContainer, takeFromContainer, createItem and previewItem drop their graphics argument, so a save is never read or encoded against another archive;
  • fromJson takes the archive too;
  • in C, the save keeps the archive alive past dm2_graphics_archive_free (tested).

Deviation from #451: only the dungeon's map info is kept, not the DungeonFile; nothing else in it is used after construction.

https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7

Closes #451. Stacked on #456. `SaveGame` holds the `GraphicsArchive` it was built with, shared through an `Arc`: - `toBytes`, `inventory`, `container`, `putInContainer`, `takeFromContainer`, `createItem` and `previewItem` drop their `graphics` argument, so a save is never read or encoded against another archive; - `fromJson` takes the archive too; - in C, the save keeps the archive alive past `dm2_graphics_archive_free` (tested). Deviation from #451: only the dungeon's map info is kept, not the `DungeonFile`; nothing else in it is used after construction. https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
feat(bindings)!: SaveGame keeps its GraphicsArchive
Some checks failed
CI / msrv (1.90) (pull_request) Successful in 35s
CI / stable (pull_request) Successful in 1m0s
CI / audit (pull_request) Successful in 13s
CI / python bindings (3.11) (pull_request) Successful in 28s
CI / audit (push) Has been cancelled
CI / python bindings (3.11) (push) Has been cancelled
CI / msrv (1.90) (push) Has been cancelled
CI / stable (push) Has been cancelled
cdd65ab1cf
SaveGame holds the GraphicsArchive it was built with, shared through
an Arc, so to_bytes, inventory, container, the container edits,
create_item and preview_item drop their graphics argument, and a save
is never read or encoded against another archive. from_json takes the
archive too. In C, the save keeps the archive alive past
dm2_graphics_archive_free.

Closes #451

Claude-Session: https://claude.ai/code/session_01SnENBXnZbhNNrojZT5jbJ7
jqueuniet changed target branch from feat/454-dungeon-from-json to main 2026-10-31 10:23:39 +01:00
jqueuniet deleted branch feat/451-save-game-keeps-graphics 2026-10-31 10:24:14 +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!457
No description provided.