Commit Graph
464 Commits
Author SHA1 Message Date
shweetandClaude Opus 5.5 6f7a457f8f Stage 8b: inline single-use timeline selection wrappers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:48:38 -04:00
shweetandClaude Opus 5.5 d08f59d7ba Stage 8a: panels as plain functions; content selection on the uid Selection
- New panel kit (imgui/window/panel.*): list/card drawing with multi-select,
  rename, arrow keys, drag hooks and tooltips; a list panel helper for the
  context menu, shortcuts and footer; panels build their Actions inline.
- Layers, nulls, events, sounds, spritesheets, regions, shaders and
  animations are plain functions over a small persistent state struct.
- Content items are selected by uid in the shared Selection (one kind per
  content type, plus a focus per kind); regions are those of the focused
  spritesheet. Selection survives undo, paste and removal like the timeline's.
- Combo labels are computed when drawn (Document::choices_get).
- Deletes the Window callback framework, WINDOW_FLAGS, Storage and the
  per-window selection snapshot fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:47:21 -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 2d0f70b1e5 Stage 6: Document::change() always refreshes derived data; ChangeType removed
change() now flushes drafts, re-syncs assets and shaders, rebuilds every label
list and the uid index, and commits. Document::ChangeType, the switch in
change(), the type parameter of edit_apply/edit_run/edit_push/assets_sync,
Window::changeType and every per-call change type (about 40 sites) are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:59:44 -04:00
shweetandClaude Opus 5.5 9f43a210c5 Stage 5: content-hash AssetStore; undo records asset keys, not pixels
- resource::AssetStore (core) keeps immutable images and sounds keyed by content
  hash for the life of the document; nothing is purged until it closes.
- Undo state holds spritesheet/sound id -> asset key maps (always tracked), so
  every edit can undo texture changes; the textures-only snapshot flag
  (edit_begin(label, true) / push(message, isTextures)) and the pixel/audio
  equality helpers are gone.
- Document::texture_get/sound_get read through the store; texture_set/sound_set
  add assets; texture_edit gives the pencil a private draft that becomes a new
  asset on the next change().
- Spritesheet dirty state compares path + asset key instead of hashing pixels.
- Preview audio reads sounds through the store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:53:34 -04:00
shweetandClaude Opus 5.5 65a3546c3b Stage 4: one uid-based Selection for the timeline and animations list
- Selection { map<kind, set<uid>> uids; Handle focus; } (src/selection.*, core)
  replaces Document::reference, the frames/items/animation Storages,
  groupReferences, and the timeline's selection snapshot/lock/focus state.
- Because selection is by uid it follows elements through edits by itself;
  after an edit or undo, selection_follow only drops removed uids and moves a
  removed focus to its nearest survivor. The Stage 2 handle capture/re-resolve,
  frames_reference_normalize_for, frames_selection_sync_for and the index-based
  frame validity repair are gone.
- Document keeps a UidIndex (rebuilt on every change) and exposes
  reference_get/reference_set, selected_get/selected_set(kind),
  frame_references_get/set and animations_selected_get/set.
- UidIndex records each uid's element type.
- The animations list keeps its ImGui multi-select Storage as a per-frame mirror
  of the Selection; content windows are unchanged until Stage 8.
- tests/selection.cpp and tests/undo.cpp cover selection through inserts,
  reverses, deletes, item and animation removal, regrouping and undo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:46:47 -04:00
shweetandClaude Opus 5.5 700b613c62 Stage 3: operations layer (src/edit) and one undo entry point
- src/edit/ (in anm2ed_core): frame, track, animation, region, grid and
  change-all edits as plain functions of the model. Each returns the uids of what
  it created for the UI to select; copies get fresh uids.
- Document::edit_apply snapshots, runs an operation and commits; edit_begin
  starts drag edits. window_edit, edit_command_push, snapshot_command_push,
  SnapshotKind and the tracks/frames/regions/textures snapshot kinds are gone;
  Snapshots has a single push(message, isTextures).
- Timeline, animations, regions, shaders, items, wizards, taskbar and file merge
  call the edit layer; they keep only selection, scrolling and toasts.
- Snapshots, Storage, Playback and ImGui core build into anm2ed_core, so undo is
  testable: tests/undo.cpp runs a seeded random walk of edits per fixture and
  checks every undo/redo state by hash, plus selection follow through undo.
- types::edit renamed types::edit_state (clashed with the edit namespace).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:26:53 -04:00
shweetandClaude Opus 5.5 20bfbace7a Stage 2: stable element uids and selection that follows edits
- Element::uid: runtime-only, unique per document (uids_repair on load and after
  every edit gives copies and new elements fresh uids; never serialized or hashed)
- Handle {animation, item, frame} uids and UidIndex (one walk: uid -> Reference)
- Snapshots capture the selection's handles when an edit starts and re-resolve the
  fields the edit left untouched on commit, undo and redo; replaces
  restored_snapshot_sanitize. Covers the main reference, frame/item/group
  references, timeline frame selection and the animation list selection.
- tests/selection.cpp: references survive inserts, copies, deletes, animation
  removal/reordering and regrouping

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:04:16 -04:00
shweetandClaude Opus 5.5 26ab394fe4 Stage 1: headless Image and AudioData; GPU and playback caches in the UI
- resource::Image (pixels, size, uid) replaces Texture in documents, undo and
  wizards; it lives in anm2ed_core with no GL. uid changes with the pixels.
- resource::texture::id_get uploads lazily and evicts textures not drawn in a frame
- resource::AudioData (bytes, uid) replaces Audio; resource::audio::play/stop/
  track_detach/is_playing cache decoded audio and tracks per uid
- Resources::icon_id_get shortens the icon call sites
- tests/assets.cpp covers Image png round trip, uid tracking, merge_append

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:52:34 -04:00
shweetandClaude Opus 5.5 5311c2835f Repair duplicate content ids on load; pass unknown attributes and text through
- Duplicate ids in any content list (spritesheets, shaders, layers, nulls, events,
  sounds, regions) are repaired at load: the first holder keeps the id, so tracks
  stay bound to the item they referenced (previously remapped to the wrong layer)
- Unknown attributes and element text survive save; retired BakeCount/OriginalDelay
  are still dropped. Private corpus (1,251 files) output unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:40:20 -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
shweet 8e37b5df3b Claude Code Has Entered 2026-10-03 14:22:12 -04:00
shweetandClaude Opus 5.5 ec72a30ce0 Canvas windows, settings and manager: share view code and list I/O
- CanvasView base holds checker pan sync, zoom step, grid panel, view buttons and view context menu
- frame_parent_model_get replaces five root/group transform compositions
- Canvas builds VAOs through one helper, unifies uniform setters and frees the texture VAO/VBO/EBO (leak fix)
- Settings load/save loop over component suffix tables; unused settings Type enum removed
- Manager shares one path-list load/save for recent and autosave files
- Anonymous namespaces removed per project style

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:50:13 -04:00
shweetandClaude Opus 5.5 a4638a422d Frame properties: one field table for change-all, shared widgets
- FRAME_CHANGE_SCALARS generates FrameChange fields, the frames_change apply step and change-all population
- Change-all draws component rows from tables instead of five widget lambdas and 46 aliases
- Frame properties uses one edit path (edit::COMPLETE), a vec2 field table and an X/Y flip loop
- Shared INTERPOLATION_LABELS and Document::layer_regions_get

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:44:14 -04:00
shweetandClaude Opus 5.5 30ea363c39 Timeline: drop per-frame callback rebinding and duplicated helpers
- TimelineState base carries persistent state; TimelineContext no longer copies 50 references
- 111 per-frame std::function lambdas become member functions
- Delete wrappers that re-implemented anm2 helpers
- One snapshot/edit push path, one theme color lookup, shared frame grouping/refocus/trigger filters
- Row building and bake targets loop over TRACK_CONTAINERS
- Split commands.cpp into selection.cpp, edit.cpp and menus.cpp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:38:17 -04:00
shweetandClaude Opus 5.5 d926fc6677 Split window.cpp per window and drive menus from one flag table
- WINDOW_FLAGS table builds every context menu, footer and shortcut set
- Shared list-row and card-row renderers replace per-window copies
- Layers/nulls/events share one properties popup; Manager keeps one item popup API
- Regions, spritesheets and sounds drop hand-built menus, footers and shortcut blocks
- Animation remove and cut share one erase path that also clears group ids
- Index-mapped multi-select fixes shift-range over non-contiguous ids
- Fix Remove Unused tooltip showing the Add shortcut and the missing break in item properties

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:27:34 -04:00
shweetandClaude Opus 5.5 3f31cedeed Slim Document: move data-model code out, unify edit plumbing
- Region generate/scan move to anm2/regions.cpp; both generators number from 1
- file_merge moves to anm2/merge.cpp and is table-driven
- MaxRects packer moves to util/pack
- Uniform config apply/trim/save move to resource/shader
- Snapshots push from their owned state; Document snapshot wrappers removed
- DocumentData base replaces the hand-written move constructor
- toast_log replaces 55 duplicated toast + English log pairs
- Apply repo .clang-format to touched files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:08:00 -04:00
shweetandClaude Opus 5.5 a9f48bc3a0 De-bloat anm2 core: templates, tables, unified emitter
- Collapse const/non-const pairs into templates; Anm2::element_get uses deducing this
- Drive container/track/item mappings from ANM2_ELEMENT_TYPES, ANM2_ITEM_TYPES and TRACK_CONTAINERS
- One sink-based emitter feeds both XML writing and hashing
- frame_mix and frame_bake_split replace five copies of the bake/lerp loop
- item_add replaces layer_animation_add/null_animation_add
- Fix timeline split ignoring shear

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 12:54:24 -04:00
shweetandClaude Opus 5.5 41ed347925 Split anm2 and timeline into modules; merge groups by name
Baseline before de-bloat refactor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 12:41:23 -04:00
shweet 9e9dd8bd8a fix issue with animation length change acting on new reference 2026-08-27 16:09:10 -04:00
shweet b7c24fad99 shading and shearing 2026-08-20 20:03:12 -04:00
shweet 5e27111b21 address log accumulation issue and non-ascii files load on program init 2026-08-13 21:40:28 -04:00
shweet 46690d6975 fixed group reference issue 2026-08-07 14:48:33 -04:00
shweet a4b34cc0be remove overlay window, add document overlay + over/under 2026-08-07 14:42:16 -04:00
shweet e32e781b46 remove compile commands 2026-08-06 11:47:20 -04:00
shweet ff76932555 fix merge window, fix hash slowness (again), touch up overlays (still not sure about them) 2026-07-19 22:35:48 -04:00
shweet 98f87c9d46 fix sound serialization + extended format 2026-07-15 12:47:44 -04:00
shweet c7abe29106 reintroduce region remapping 2026-07-12 17:43:57 -04:00
shweet d3996a218e format fix 2026-07-12 17:39:21 -04:00
shweet 6786bff07c copying items, remove region remapping 2026-07-12 16:37:35 -04:00
shweet c28ea8eb6f tick/fps difference in render animation; touched up 2026-07-10 21:21:25 -04:00
shweet c5a9ab8119 fix spritesheet overwrite warning 2026-07-09 21:37:41 -04:00
shweet 2b662d24d6 slopped up readme too why not 2026-07-09 19:59:15 -04:00
shweet 5792dd25a2 Overlays, Shaders, Group Roots, Serialization Changes. Legalize Nuclear Bombs 2026-07-09 19:49:33 -04:00
shweet 555caf9f4f more slop with regions 2026-07-01 20:49:39 -04:00
shweet 80ef3f8597 buncha slop 2026-07-01 20:04:12 -04:00
shweet f00396bdfe fixed issue with ctrl+click 2026-06-25 00:07:01 -04:00
shweet b5528bc118 fix to document order and bake into other frames works with colors 2026-06-23 19:08:00 -04:00
shweet 6d206045c7 spritesheet editor fix, zoom levels 2026-06-20 22:27:11 -04:00
shweet d079295803 spritesheet editor fix 2026-06-20 20:38:05 -04:00
shweet dbc1c132bd zoomin' 2026-06-20 15:12:52 -04:00
shweet 4db3e28ced some new crap 2026-06-20 15:06:04 -04:00
shweet 1005b5e4ce pivot fix again 2026-06-13 15:00:09 -04:00
shweet 0ea0afe1e3 pivot fix 2026-06-13 14:56:02 -04:00
shweet 71e799f536 yeah this is more sensible 2026-06-07 12:53:08 -04:00
shweet e8083d7817 Auto bake frames! new attributes! 2026-06-07 12:40:56 -04:00
shweet 8a48eece86 fix gaffe with spritesheets 2026-05-25 22:23:27 -04:00
shweet 93707b234c fix tools 2026-05-22 11:50:03 -04:00
shweet 8c421595c4 more tweaks 2026-05-22 11:13:39 -04:00