Commit Graph
6 Commits
Author SHA1 Message Date
shweetandClaude Opus 5.5 201a7c7cfc Replace tinyxml2 with pugixml
Parsing a 60 MB save drops from about 350 ms to 30 ms (a whole load from about
620 ms to 200). The reader keeps tinyxml2's rules for numbers and booleans
("%d"/"%f" on the leading text; a number or true/false), so every golden is
unchanged, and parse errors now give a line. SVG composing (pack and merge)
builds, clones and prints through pugixml. Tests check escaping by reading a
save back instead of comparing against tinyxml2's printer, and cut
SourceDocument from saves as text. pugixml is a submodule at v1.16; the About
window lists it, and simdjson, instead of tinyxml2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 21:57:39 -04:00
shweetandClaude Opus 5.5 b69b0eaa1b JSON documents; remove the extended format
Documents can be saved as the editor's own JSON (Save as JSON, in Configure's
Serialization row, off by default) and any .anm2 starting with '{' opens as
one. The schema is new, not an XML mirror: content items in arrays (an item's
index is its id), animations keyed by unique name (a repeat saves as "Name 2"),
groups nested, paired values as arrays, a frame on a region storing only the
region, ISO 8601 dates, every default left out, and one line per frame and
content item, with anything else that fits in 100 columns on one line. Unknown
XML isn't kept. Each part is described once (frame_io, track_io, model_io...)
and run by a JsonWriter or a JsonReader; simdjson parses (new submodule). A
JSON file that opens but has unknown keys, wrong types, unknown values or bad
indices lists them by location in a warning toast; libraries toast their load
problems too. With Save as JSON on, saving always shows the Isaac warning.

The extended format is gone: no setting, File menu toggle, ExtendedVersion or
isExtendedFormat. XML saves are always the game's copy with SourceDocument;
old extended files still open. Document saves take Options instead of loose
bools, and model_load reads through model_load_string. docs/json_format.md
replaces docs/extended_format.md; goldens lose ExtendedVersion and the
.extended variants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 21:48:25 -04:00
shweetandClaude Opus 5.5 4c569cb1e5 Stage 10a: delete dead code, merge tiny files, unify duplicated concepts
- Dead code: util/map, util/unordered_map, unused vector/math/string/input
  helpers, Document getters, special-interpolation bake leftovers,
  triggers_sort, SnapshotStack::max_size_get, AudioStream capture API.
- Merges: util/xml, util/string, resource/strings.cpp inlined; constants
  into input.hpp; tooltip into layout; Recorder into render; onionskin,
  tools, welcome and frame properties are panel functions; timeline
  popups.cpp folded into timeline.cpp.
- util/origin.hpp replaced by model Origin (the merge setting stays a
  combo index, so saved preferences keep their meaning).
- Item type names/icons/colors moved from model/common.hpp to the
  timeline header; the model no longer includes icon/strings headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:35:22 -04:00
shweetandClaude Opus 5.5 e50d76c784 Stage 7b: model/xml.cpp reads and writes tinyxml2 directly; Element tree removed
- Reading goes from tinyxml2 straight into the typed model, including legacy
  layouts (flat GroupId groups, *AnimationGroups with Index, FrameRestore
  backups, baked frames, SoundId, Overlay) and load-time id/region repair.
- Writing builds an XmlNode tree from the typed model for a set of flags:
  id renumbering, region sync, group-root and interpolation baking happen on
  typed data; groups are nested or extracted the way the old pipeline did.
- Unknown XML is kept verbatim (XmlNode) instead of being re-emitted through
  the Element writer.
- model_hash is an FNV hash of the editor-format node tree (what a save would
  write); the per-fixture hash goldens are gone.
- Deletes src/anm2 (Element, normalize, groups, hash, xml) and the unused
  util/xml attribute helpers and ElementType/ItemType table columns.
- All goldens, invariants and the local corpus are byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:20:45 -04:00
shweetandClaude Opus 5.5 0b6f67d9bd Stage 7: typed model; Element tree is internal to model/xml.cpp
- src/model: typed Model (Info, Content, nested TrackGroup/AnimationGroup,
  copy-on-write shared animations, Extras/XmlNode passthrough for unknown XML,
  layout vectors so saves stay byte-identical).
- src/edit, Document, Selection, Snapshots, every window, the timeline, wizards
  and popups now read and edit model::Model; no UI code touches Element.
- anm2/ is reduced to the XML reader/writer/normalizer behind model/xml.cpp;
  dead Element operations (merge, regions, item_add, rect, frame helpers,
  element_get/unused, deserialize) are deleted.
- Goldens, invariants, undo walk and the local corpus (1,251 files) match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 16:53:17 -04:00
shweetandClaude Opus 5.5 8953101245 Stage 0: continuity test suite
- anm2ed_core static library (anm2 + non-UI util + log) shared by app and tests
- Logger is inert until session_open, so the core has no SDL dependency
- doctest suite: golden round-trips of 12 synthetic fixtures across every
  serialization preset, format and merge type; save/reload invariants
  (fixed point, hash stability, game view equals re-baked game view);
  operation goldens; env-gated private corpus run (ANM2ED_CORPUS)
- ANM2ED_UPDATE_GOLDEN=1 regenerates goldens; tests/MANUAL.md UI checklist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:34:31 -04:00