Commit Graph
528 Commits
Author SHA1 Message Date
shweet bbfdafb006 Draw localized checkboxes and radio buttons with their tooltips in one call 2026-11-22 19:08:30 -05:00
shweet f39ea8cdfc Share the persistent-edit state between widgets, and simplify render validation
The three persistent widgets follow their edit through one template. Render checks fail through one helper, and a table picks each render type's dialog.
2026-11-22 19:07:44 -05:00
shweet 045acb181f Hash asset contents eight bytes at a time
A 4096x4096 spritesheet hashes in 8 ms instead of 51 ms on each change.
2026-11-22 19:05:44 -05:00
shweet 0fd0bc4cf2 Drop the framebuffer's unused depth-stencil buffer and resize bookkeeping
Nothing draws with depth or stencil. The renderbuffer calls leave the OpenGL table.
2026-11-22 19:05:12 -05:00
shweet 4b17e9b328 Read the settings file once, keeping Dear ImGui's section as it parses 2026-11-22 19:04:09 -05:00
shweet 91cc11aa3b Test mouse hover and draw bold headings with shared helpers 2026-11-22 19:02:20 -05:00
shweet 69b6acb9e8 Draw frame property changes with a function instead of a one-flag class
ChangeAllFrameProperties becomes frame_properties_change_draw, told where it is drawn by ChangeHost and returning whether it applied.
2026-11-22 19:01:26 -05:00
shweet d2c50b5548 Lay out the welcome window and dockspace with one helper 2026-11-22 19:00:42 -05:00
shweet ada48aefdd Name row drops, merge sources, playback looping and spritesheet merge options
items_move takes a DropZone, animations_merge MergeSources, Playback::tick PlaybackLoop, and spritesheets_merge SpritesheetMergeOptions.
2026-11-22 18:58:37 -05:00
shweet 228a15b5b3 Open documents in one of three ways instead of two bools, and let dialogs know when they take many files
DocumentOpen (open, new, or restored from an autosave) replaces isNew and isRecent and Manager::new_.
The *_OPEN dialogs pick several files without being told.
2026-11-22 18:56:16 -05:00
shweet 1fc6b064ae Pass BakeOptions to every bake instead of rounding bools
RootBakeOptions moves into the model as BakeOptions, used by frame and track bakes and root transforms.
2026-11-22 18:55:16 -05:00
shweet f9dcfb8d79 Describe timeline item types in one style table 2026-11-22 18:53:11 -05:00
shweet a5ffa916d8 Share row drag-and-drop in the timeline, and drop zones with the animations list
One row_drag_drop serves group and track rows, and drop_zone_get splits a row in thirds for both windows.
2026-11-22 18:52:44 -05:00
shweet f7c90945a7 Give the generate-regions popup the shared confirm/cancel row 2026-11-22 18:51:06 -05:00
shweet 14e9668bab Name shortcut keys from ImGui, keeping only the names saved differently
The two key tables become 21 aliases (Num0 to NumEqual, and the arrows). Every key the old tables knew converts to and from text exactly as before.
2026-11-22 18:50:42 -05:00
shweet a9177b13d0 Draw popup confirm/cancel rows with one helper
popup_buttons_draw takes its labels, tooltips and enabled state as a struct. Three hand-written rows use it.
2026-11-22 18:48:58 -05:00
shweet 8d3ebf2329 Add tooltip_set and PopupHelper::begin, and use localize_format
149 localized tooltips, 38 localized formats and 27 modal popups lose their boilerplate.
2026-11-22 18:47:33 -05:00
shweet 99e06b72ea Remove dead UI code and 39 unused strings
Sound pastes use the Paste Sound(s) edit label instead of a toast string.
The popup size table is defined once, and the shaders window reuses asset_path_get.
2026-11-22 18:45:36 -05:00
shweet 15e94192bd Describe frame properties in one table
FRAME_PROPERTIES gives each property's tracks and what copying it takes, for the enum, the check and the copy.
2026-11-22 18:42:11 -05:00
shweet 250adcb6e9 Make Document a Snapshot instead of aliasing one
The state undo restores is Document's own members, and Snapshots takes it by reference.
The DocumentData base, the reference members and the placement-new move assignment are gone.
2026-11-22 18:41:04 -05:00
shweet 544ab3cac9 Drop dead model code, and let edits that select nothing return nothing
Model::uid_get, the UidIndex element types, Playback's accumulator, ID_NONE and track_frames_count_get were unused.
Fourteen edit functions only ever returned an empty selection, so they return void.
2026-11-22 18:39:08 -05:00
shweet c44c7fe8df Share the region and unique-name helpers
Matching a frame to a region, giving a frame its region's rectangle, a region's origin pivot, and naming something Name 2 each live in one place.
2026-11-22 18:36:14 -05:00
shweet 0f5a224e7a Write documents in one of three modes instead of ten flags
SAVE_GAME, SAVE_EDITOR and SAVE_CLIPBOARD are the only combinations the editor used.
The dirty-state hash uses the editor's copy. The eased-frame baking only a test preset reached is gone.
Goldens: the old editor preset is now clipboard, game and editor replace isaac and anm2ed, and default is gone.
Every changed golden equals its old one without default tints and color offsets.
2026-11-22 18:33:49 -05:00
shweet 7e3c5cfeb5 Share one set of group operations between tracks and animations
model/group.h walks, finds, takes, wraps, unwraps and expands lists of items and groups.
Track and animation groups both keep their members in items, and the edits, bakes, merges and writers use it.
2026-11-22 18:31:13 -05:00
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 c38a3a9890 Sleep while idle
With no input for a second and nothing playing, recording, fading or being typed, the window redraws 20 times a second instead of 120, and wakes on the next event.
Idle CPU with a document open went from 5.6% to 1.7% of a core.
2026-11-22 17:46:36 -05:00
shweet 20209e655e Read the system CJK font once, and hold fonts as ImFont pointers
Each of the four fonts merged the system CJK font from a fresh read of its file, twice, and never freed it.
It is now read once and shared. Startup memory with a document open went from 412 MB to 269 MB.
2026-11-22 17:44:07 -05:00
shweet 2f1e75da37 Keep the log file open, drop the stderr pipe thread
A session log is written line by line through one open file. The last ten sessions are kept.
FFmpeg's warnings and errors are appended to the log by the shell instead.
2026-11-22 17:42:54 -05:00
shweet d2c0e32ff5 Start the editor from main, and hand paths over with a small instance listener
Loader and State are folded into main.cpp. SDL_main gives Windows UTF-8 arguments.
instance.cpp replaces the Socket class. A later editor sends its paths and waits for the first to answer.
When something else holds the port, the editor now runs on its own instead of quietly exiting.
2026-11-22 17:40:24 -05:00
shweet 6f2fc8c196 Load OpenGL through SDL instead of glad
gl.h lists the 62 functions the editor calls, loaded with SDL_GL_GetProcAddress into gl, as in smack-a-brother.
The 25k lines of glad and KHR headers are gone.
2026-11-22 17:36:29 -05:00
shweet 7e81ea4259 Play sounds with SDL audio and stb_vorbis instead of SDL_mixer
Sounds decode once to 48 kHz stereo floats. Each play is a stream on one shared device, opened on the first play.
A render's audio is mixed offline at 48 kHz, so command line renders get their sounds too.
The About music is Ogg Vorbis now. Opus, libopus and libogg are gone.
2026-11-22 17:34:01 -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 a515267e26 Build: libraries optimized, resources compiled from files, stb and doctest as submodules
CMAKE_BUILD_TYPE is now set before the libraries are added, so SDL, SDL_mixer and lunasvg build optimized.
Release on Linux is -O2 with unused sections dropped and the binary stripped.
SDL builds only what the editor uses. simdjson builds without exceptions and with two parsers.
Fonts, icons, the About music and friends live under resources/ and compile in through one generated C file.
The string tables are shared between files instead of copied into each.
nanosvg and imconfig.h were unused and are gone.
2026-11-22 17:07:36 -05:00
shweet 4e35f9d450 Stop tracking CLAUDE.md 2026-11-22 16:57:26 -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 065dd522f3 Remove items in use; drop Remove Unused
Every content window's Remove (the Delete key) takes the selection out with
what refers to it: a layer's or null's tracks in every animation, a
spritesheet's plain layers (and regions), an event or sound from its triggers
(dropping triggers left with neither), a shader or region from its frames
(which keep the region's rectangle), and a library's layers, flattened into
plain ones. When anything is in use it asks first, listing what goes ("This
will remove:" ... "Are you sure?"). Remove Unused is gone; Remove takes its
place in each footer.

One reference walk (model.cpp) counts uses and finds unused items, so
shaders on null and root frames count, and an animation layer's unused
spritesheet doesn't. Flattening can be limited to some layers, merging only
their children's triggers, which now record the layer they fired through.
edit::content_remove does the removal; Document::spritesheet_path_resolver_get
is shared with saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 22:33:25 -04:00
shweetandClaude Opus 5.5 c9d68781d0 Add a convert command; JSON libraries come before layers
`anm2ed convert <file> [--format json|xml] [--out PATH]` saves a document as
the editor does: XML (the default) is the game's copy with the editor's
embedded, animation layers flattened through their libraries; JSON is the
editor's own. Without --out the file is rewritten in place. JSON problems go
to stderr; a file that can't load or write exits 1, a bad --format 2. A
document loads without an OpenGL context now: its custom shaders just aren't
compiled. The file and --out are made absolute, so a bare file name has a
folder (render and frame crashed on one too).

JSON writes and reads "libraries" before "layers", so a layer's library index
is checked against the libraries rather than reported missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 22:33:15 -04:00
shweetandClaude Opus 5.5 201a7c7cfc Replace tinyxml2 with pugixml
Parsing a 60 MB save drops from about 350 ms to 30 ms (a whole load from about
620 ms to 200). The reader keeps tinyxml2's rules for numbers and booleans
("%d"/"%f" on the leading text; a number or true/false), so every golden is
unchanged, and parse errors now give a line. SVG composing (pack and merge)
builds, clones and prints through pugixml. Tests check escaping by reading a
save back instead of comparing against tinyxml2's printer, and cut
SourceDocument from saves as text. pugixml is a submodule at v1.16; the About
window lists it, and simdjson, instead of tinyxml2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 21:57:39 -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 d77b2bae71 Open Directory selects the file in the file manager
Showing a spritesheet, sound, library (or Explore XML Location's document)
opens its folder with the file selected: explorer /select on Windows, the
freedesktop FileManager1 ShowItems call on Linux (Nautilus, Dolphin, Nemo,
Caja, Thunar...), falling back to opening the folder. Paths go to the shell
single-quoted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 01:18:05 -04:00
shweetandClaude Opus 5.5 a6f9b425e8 Close seams where an SVG's shapes meet
Anti-aliasing leaves a partly transparent hairline where two shapes share an
edge (each covers about half of those pixels), and the background shows
through. After drawing an SVG, a partly covered pixel with opaque pixels on
both sides of it, along any axis within two pixels, takes their color over
its own and becomes opaque; outer edges keep their anti-aliasing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 00:25:45 -04:00
shweetandClaude Opus 5.5 4141c53681 Remove built-in stop and done events
Events are plain again: no built-in names offered, locked or listed in the
Events window, and the game's copy of a trigger keeps its first event. The
list rows' rename lock and event_id_resolve go with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 00:20:11 -04:00
shweetandClaude Opus 5.5 5f01e8065d SVG spritesheets: pack, merge, rasterize
Packing an SVG sheet makes a new SVG holding its drawing once (as a symbol),
each region a clipped view of it at its new place; merging makes an SVG
whenever any sheet is one, with PNG sheets embedded as images (the merged
sheet's file name takes the matching extension). Both go through
Image::compose, which also does the pixel versions, so merge_append is gone.
Vector sheets save as their SVG (autosaves too, and images load as PNG or
SVG by content), and their asset key includes the SVG. Rasterize in the
Spritesheets menu turns selected SVG sheets into PNGs beside them, with a
toast for each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 00:15:56 -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
shweet 0857e62419 metadata 2026-10-08 18:47:39 -04:00
shweetandClaude Opus 5.5 d4b88289ac README and extended format spec for libraries, animation layers and the rest
docs/extended_format.md describes ExtendedVersion 2 for converters and game
loaders: libraries, animation layers and how children are placed, timed and
fire triggers, multiple events, SVG spritesheets, the frame attributes and
the transform, and what a Rebirth copy keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:44:41 -04:00