Commit Graph
38 Commits
Author SHA1 Message Date
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 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 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 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 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
shweet b7c24fad99 shading and shearing 2026-08-20 20:03:12 -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 5792dd25a2 Overlays, Shaders, Group Roots, Serialization Changes. Legalize Nuclear Bombs 2026-07-09 19:49:33 -04:00
shweet 8c421595c4 more tweaks 2026-05-22 11:13:39 -04:00
shweet 4db1cfafb6 the source of the random crashes?! 2026-05-22 09:31:05 -04:00
shweet b7b49eb81e some bullshit to fix potential crash 2026-05-14 22:58:32 -04:00
shweet c11b404392 let's actually stage those changes... 2026-03-09 23:09:37 -04:00
shweet be772481f6 ....that! 2025-11-18 00:56:32 -05:00
shweet e2799b1e58 timeline refactor, bit broken rn 2025-11-09 10:35:21 -05:00
shweet 1e35910b0a Refactoring, FFmpeg updates 2025-11-03 00:16:05 -05:00
shweet 62cd94ca78 Big refactor, shuffling a lot of files around 2025-11-01 19:51:19 -04:00
shweet 99b7d9f49d FFmpeg and sound support; refactor, etc. 2025-11-01 00:54:22 -04:00
shweet fe9366f9ef context menus, document refactoring, fixes 2025-10-26 00:10:44 -04:00
shweet 5b0f9a39c4 Refactor... 2025-10-21 20:23:27 -04:00
shweet dbb6d13f34 refactor pt 1; getting each thing right and then will push to main 2025-09-19 17:57:48 -04:00
shweet f8fb3df8d4 Redid layer system, added layer/null windows, more quality of life, polish 2025-09-12 18:06:30 -04:00
shweet b2cf67a823 Added fit, fixed the layer -1 bug finally, refactored here and there 2025-09-09 17:51:17 -04:00
shweet 3546f27655 Moved spritesheet texture handling to anm2 instead of resources; added undoing for spritesheet texture changes; refactoring 2025-08-27 00:28:41 -04:00
shweet ea3498692a The Omega Update(TM) Part 4 (Massive Refactor, Change All Frame Properties) 2025-08-14 00:25:35 -04:00
shweet a48c72357a The Omega Update(TM) Part 3 (Rendering) 2025-08-10 01:27:06 -04:00
shweet b9c9105621 The Update(TM), Part 2 2025-08-09 00:32:14 -04:00
shweet fe8bdae9a8 The Update(TM), Part 1 2025-07-27 22:08:57 -04:00
shweet 30880c003d The Omega Refactor(TM) + Input Options 2025-06-30 21:29:59 -04:00
shweet 4b12153512 Undo + Recording 2025-06-29 20:33:52 -04:00
shweet e4f6da650e woopsies 2025-06-29 00:53:26 -04:00
shweet 9083a25a2b le readme 2025-06-29 00:49:58 -04:00