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>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-03 12:54:24 -04:00
1 parent 41ed347925
commit a9f48bc3a0
23 files changed
+1087 -1978

No files matched your search

+3 -3
View File
@@ -122,7 +122,7 @@ namespace anm2ed::imgui
auto zoom_out = [&]() { zoom_adjust(-ZOOM_LEVEL_STEP); };
auto region_get = [&](int id)
{ return spritesheet ? element_child_id_get(*spritesheet, ElementType::REGION, id) : nullptr; };
{ return spritesheet ? child_id_get(*spritesheet, ElementType::REGION, id) : nullptr; };
if (ImGui::Begin(localize.get(LABEL_SPRITESHEET_EDITOR_WINDOW), &settings.windowIsSpritesheetEditor))
{
@@ -553,7 +553,7 @@ namespace anm2ed::imgui
auto spritesheet =
document.anm2.element_get(ElementType::SPRITESHEET, queuedSpritesheet);
if (!spritesheet) return;
auto region = element_child_id_get(*spritesheet, ElementType::REGION, id);
auto region = child_id_get(*spritesheet, ElementType::REGION, id);
if (!region) return;
update(*region);
}});
@@ -569,7 +569,7 @@ namespace anm2ed::imgui
if (!spritesheet) return;
for (auto id : queuedSelection)
{
auto region = element_child_id_get(*spritesheet, ElementType::REGION, id);
auto region = child_id_get(*spritesheet, ElementType::REGION, id);
if (!region) continue;
update(*region);
}