Commit Graph
19 Commits
Author SHA1 Message Date
shweet 03bbb93ba6 Replace glm with vec.h
Vec2, IVec2, Vec3, Vec4, IVec4 and a column-major Mat4, with glm's formulas, in one header.
Free functions are vec_ and mat4_ prefixed. The leaked using namespace glm is gone.
Render goldens still match.
2026-11-22 18:15:02 -05:00
shweet 7afdf709c3 Format like smack-a-brother, and write comments as sentences
Four-space indents, braces on their own lines, and one-statement bodies without braces.
Semicolons in comments became full stops.
Designated initializers may leave fields out without a warning.
2026-11-22 17:30:03 -05:00
shweet 40f6b554b5 Initialize with = instead of braces, and drop const from local autos
Scalars get = 0, = false or = nullptr. Standard containers and strings rely on their constructors.
Other types get = {} or = value, and lists keep = {...}.
glm types are left alone until they're replaced.
2026-11-22 17:27:24 -05:00
shweet 666f65bf3a Remove namespaces, and make file-local helpers static
Names that only a namespace told apart get prefixes: TOOL_PAN, FONT_BOLD, ICON_FOLDER, COLOR_WHITE, path_to_utf8 and so on.
The OpenGL shader class is ShaderProgram, and its uniform ShaderUniform, beside the document's Shader and Uniform.
Free functions a member of the same name would hide are called through :: for now.
Two unused shader window helpers are gone.
2026-11-22 17:25:09 -05:00
shweet 7fb2c607c2 Flatten src into model, edit and ui, with .h headers
Resources and utilities sit directly in src. The ImGui windows, wizards, popups and helpers are in ui.
Headers that would shadow system ones are renamed: math_util, timestamp, subprocess, localization.
Includes are written from src.
2026-11-22 17:12:05 -05:00
shweet 9072ac5745 JSON: shorter keys, a child object, a markers pair, and no version key 2026-11-22 16:57:26 -05:00
shweetandClaude Opus 5.5 8ef089d306 Isaac compatibility: Convert and Save bridges what the game can't show
The Isaac prompt offers Convert and Save, Ignore and Save, or Cancel; the
document remembers the choice (IsaacIgnored / "isaacIgnored", editor-only)
for saves that don't ask (the warning off, or `convert`). Converting:
- depth: a copy of the layer per depth ("body (depth +1)"), standing where
  the editor draws it and showing only that depth's frames
- alpha offsets join the alpha tint (the same on opaque pixels)
- skew, blur and shaders: each layer frame using one is drawn alone at 1x
  into <name>.baked.png beside the save (each image once), on a copy of its
  layer ("body (baked)") right after it, one frame per step; a skewed root
  or group root goes into its layers' images. `convert` makes a headless
  OpenGL context for it; without one (or if the sheet can't be written)
  these are dropped with a warning. Autosaves don't bake.
Tests check the bridged copy draws as the editor does, frame by frame.

Purge Default Color Values is gone: XML saves always leave out tints of 255
and color offsets of 0, in both copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 22:59:35 -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 bec89bf48f Purge Default Color Values (on by default)
Saves leave out tint channels of 255 and color offsets of 0, which Isaac and
the editor read as those defaults, in both the game's copy and the editor's.
The option sits beside Extended Format in Configure's Serialization row; the
manager takes it with the other settings (chords_set is now settings_apply).
Also drops layer_child_transform_get's unused model parameter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:22:26 -04:00
shweetandClaude Opus 5.5 4a13c345ef Rebirth saves keep children's trigger events; ExtendedVersion 2
Flattening adds the events animation layers' children fire to the
animation's triggers on those frames (events matched by name, added when
missing). Extended documents now write ExtendedVersion="2", for files that
may hold libraries, animation layers, child playback, several events per
trigger, alpha offsets and blur.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:43:15 -04:00
shweetandClaude Opus 5.5 0e705e43fa Animation layers in the timeline: child tracks, stepping in, breadcrumb
An animation layer's row shows a folder; opening it lists its child's tracks
underneath, greyed and read only, with each keyframe drawn where the parent
reaches it. Double-clicking the row (or a child row) steps into the child:
its animation in this tab, or its library's tab (opened if need be), at the
time the parent plays it. A breadcrumb above the timeline leads back out, and
the preview draws the parent around the child, dimmed and frozen where it was
stepped in from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:35:29 -04:00
shweetandClaude Opus 5.5 8807096170 Rebirth saves flatten animation layers; missing animations show red; pivot paths follow libraries
A Rebirth document's game copy turns each animation layer into plain layers,
one per layer its child draws, baked a frame at a time (runs of identical
frames merged; skew dropped), adding library spritesheets at paths relative to
the document; the editor's copy is unchanged and the Isaac warning says so.
Layers whose animation isn't in its file are drawn red in the Layers window
(nothing is said while a library hasn't loaded). Onionskin pivot paths are
redrawn when a library loads or reloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:16:35 -04:00
shweetandClaude Opus 5.5 76c2186c81 Child triggers fire; Auto Resource Reload; animation layer labels
Playback, renders and the preview's event label include the triggers of
child animations (from this file or a library) as each child reaches them;
libraries' sounds load with them, and a frame can mix several sounds. The
reload setting is now Auto Resource Reload and covers libraries too.
Animation layers are labeled by their animation (not a spritesheet) in the
timeline and Item Properties as well as the Layers window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:06:47 -04:00
shweetandClaude Opus 5.5 280adaa189 SVG sheets: draw tool hint, convert to PNG for Rebirth; game copy skips built-in events
Drawing or erasing on an SVG spritesheet shows why it can't be edited (and
no longer leaves an empty undo step). Saving a Rebirth document whose layers
show SVG spritesheets first offers to convert them into PNGs beside them
(one undoable edit); keeping them counts them in the Isaac warning. The
game's copy of a trigger keeps its first event that isn't stop or done, and
only further custom events count as dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:56:06 -04:00
shweetandClaude Opus 5.5 4375844c84 Alpha color offset
Color Offset gains an alpha channel (Frame Properties, Change All, property
copy, interpolation and root folding), drawn by adding it to the texel's
alpha. Saved as AlphaOffset in the editor's copy only and counted by the
Isaac warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:22:15 -04:00
shweetandClaude Opus 5.5 0adb0f89bc Frame Blur (Flash's blur filter), child properties in Change All Frame Properties, flips under Visible
Blur is a layer frame's box blur, as Flash's low-quality BlurFilter: a box that many canvas pixels wide, averaged
over the frame's crop (premultiplied) by the texture shader, the quad grown by its reach. An animation layer blurs
its child's draws at least as much. It interpolates, copies, batches (clamped to 0-255), saves as an editor-only
Blur attribute and counts as an Isaac issue.

Change All Frame Properties gains the Child section (animation, mode, start frame, random, restart), applied only
to animation layers and disabled when no animation layer is targeted. Frame Properties' Flip X/Y sit below Visible
instead of inside Child.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:16:49 -04:00
shweetandClaude Opus 5.5 d1a6d89d14 Libraries window, animation layers and child playback
A Libraries window (docked with Spritesheets and Sounds) links other .anm2
files: cards list each one's animations, open it as a tab, and reload when
it changes on disk. A layer's Source is a spritesheet or an animation, from
this file or a library; the preview, renders and CLI draw the child in the
layer's frame. Animation-layer keyframes set the child's animation, mode
(loop, once, hold), start frame (or random) and restart; Child is also a
copyable frame property. All of it is editor-only and counted by the Isaac
warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 16:51:48 -04:00
shweetandClaude Opus 5.5 f3fb7d5101 Layer frame depth: change a layer's draw order for part of an animation
Layer frames get an editor-only Depth (Frame Properties, property
copy/paste): +N draws that layer N layers above its place in the timeline
for that frame, -N below; stepped, not interpolated. The draw list orders
layers by it (preview, renders, CLI). Saved as Depth in the editor's copy
only; the Isaac Compatibility Warning and anm2ed info count frames using it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 01:21:50 -04:00
shweetandClaude Opus 5.5 39ccfb723a Stage 9b: animations draw from a model draw list
- model::animation_draws_get returns what an animation draws at a time (root,
  group roots, layers, nulls; onion-skin samples first), with root and group
  root transforms as each item's parent and their tint/offset folded into
  layer frames.
- The preview, the About friends and animation_rect all use it; the
  preview's render lambda shrinks to drawing the list.
- Tests for draw order and root folding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:11:19 -04:00