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>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 15:26:53 -04:00
1 parent 20bfbace7a
commit 700b613c62
63 files changed
+3223 -1775

No files matched your search

@@ -0,0 +1,47 @@
<AnimatedActor>
<Info CreatedBy="fixture" CreatedOn="01/01/2026 12:00:00 PM" Fps="30" Version="2"/>
<Content>
<Spritesheets>
<Spritesheet Id="0" Path="sheet.png">
<Region Id="0" Name="custom" XCrop="0" YCrop="0" Width="16" Height="16" XPivot="3" YPivot="5"/>
<Region Id="1" Name="topleft" XCrop="16" YCrop="0" Width="16" Height="32" Origin="TopLeft"/>
<Region Id="2" Name="center" XCrop="32" YCrop="0" Width="10" Height="20" Origin="Center"/>
<Region Id="3" Name="gap" XCrop="0" YCrop="32" Width="8" Height="8" XPivot="0" YPivot="0"/>
<Region Id="4" Name="Grid 0" XCrop="0" YCrop="0" Width="8" Height="8" XPivot="4" YPivot="4"/>
<Region Id="5" Name="Grid 1" XCrop="8" YCrop="0" Width="8" Height="8" XPivot="4" YPivot="4"/>
<Region Id="6" Name="Grid 2" XCrop="0" YCrop="8" Width="8" Height="8" XPivot="4" YPivot="4"/>
</Spritesheet>
<Spritesheet Id="1" Path="other.png"/>
</Spritesheets>
<Layers>
<Layer Id="0" Name="a" SpritesheetId="0"/>
<Layer Id="1" Name="b" SpritesheetId="1"/>
</Layers>
<Nulls/>
<Events/>
</Content>
<Animations DefaultAnimation="A">
<Animation Name="A" FrameNum="26" Loop="true">
<RootAnimation>
<Frame XPosition="0" YPosition="0" Delay="4" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
</RootAnimation>
<LayerAnimations>
<LayerAnimation LayerId="0" Visible="true">
<Frame RegionId="0" XPosition="0" YPosition="0" Delay="4" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
<Frame RegionId="1" XPosition="0" YPosition="0" Delay="4" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
<Frame RegionId="2" XPosition="0" YPosition="0" Delay="4" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
<Frame XPivot="1" YPivot="1" XCrop="2" YCrop="2" Width="4" Height="4" XPosition="0" YPosition="0" Delay="4" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
<Frame RegionId="3" XPosition="0" YPosition="0" Delay="4" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
<Frame RegionId="4" XPosition="0" YPosition="0" Delay="2" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
<Frame RegionId="5" XPosition="0" YPosition="0" Delay="2" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
<Frame RegionId="6" XPosition="0" YPosition="0" Delay="2" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
</LayerAnimation>
<LayerAnimation LayerId="1" Visible="true">
<Frame XPivot="8" YPivot="8" XCrop="0" YCrop="0" Width="16" Height="16" XPosition="0" YPosition="0" Delay="4" Visible="true" XScale="100" YScale="100" ShearX="0" ShearY="0" RedTint="255" GreenTint="255" BlueTint="255" AlphaTint="255" RedOffset="0" GreenOffset="0" BlueOffset="0" Rotation="0" Interpolated="false"/>
</LayerAnimation>
</LayerAnimations>
<NullAnimations/>
<Triggers/>
</Animation>
</Animations>
</AnimatedActor>