Commit Graph
546 Commits
Author SHA1 Message Date
shweet 068d189e6a Save files whole or not at all, and keep a render's sounds alive
file_text_save writes a temporary file beside its target, checks every write
and the close, then renames it over the target. A full disk or quota error
no longer leaves a truncated save reported as a success (which then deleted
the autosave). Documents, autosaves, settings and PNGs all save through it.

A recording copies each trigger sound once, so a library reloaded mid-render
leaves its audio mix nothing freed to read. A recording's finish reports
whether its output was made, which animation_record now returns in place of
whether the path existed. A PNG sequence format without a placeholder
numbers each frame after its name instead of writing one file over and over,
and pixel buffers are sized in integers (a float count could run short).
2026-11-22 19:46:22 -05:00
shweet 71b0ef683b Queue handed-over paths for the main loop, and stop listening on any exit
A path handed over before SDL started its event queue was lost (its event
failed to push). Paths now wait in a queue the main loop takes from, and an
event only wakes it. A peer that connects and stays silent times out instead
of holding the listener (and quitting) forever. Forwarded paths are made
absolute first, a forwarded launch no longer opens (and prunes) session logs,
and an exception no longer leaves the listening thread joinable at exit.

Also: a failed audio device open is tried again on the next play, a voice
without a stream isn't kept, subprocess checks _WIN32, and a Process can't be
copied (closing its pipe twice).
2026-11-22 19:43:33 -05:00
shweet 48a6a386e3 Name the current language instead of casting -1 into Language
-1 is outside the enum's range, which the undefined behaviour sanitizer
reports on every localized string.
2026-11-22 19:40:31 -05:00
shweet becd6430ed Find a removed library's layers before the model moves into the flatten
Argument order is unspecified: built with clang, the model moved first, no
layers were found, and every animation layer was flattened.
2026-11-22 19:37:39 -05:00
shweet f35f9cb4b8 Build cleanly under clang, and name the remaining booleans with is
Exported XML templates lose the static clang rejects. Unused this captures,
a dead null check, an undefined declaration, an unused constant and stray
semicolons go, and single statements lose their braces.
2026-11-22 19:35:33 -05:00
shweet c5a2bddfa1 Describe each XML element once, for reading and writing
Each element's attributes, extras and child lists are one *_io function run
by an XmlReader or XmlWriter, as the JSON module does. What the writer leaves
out is an isWritten argument the reader ignores, so reading still takes every
attribute. Unknown children of items, frames and tracks are now kept rather
than dropped.
2026-11-22 19:29:00 -05:00
shweet 7bacfe0cd6 Name markers, icon overlays, list layouts and tooltip anchors instead of passing bools
Autosaves are only ever cleared along with their files, so that flag goes.
2026-11-22 19:16:25 -05:00
shweet c891e1a873 Share the icon card of sounds and libraries, and merge repeated checks in frame dragging 2026-11-22 19:15:12 -05:00
shweet 67b2296fc0 List the change-all wizard's optional fields once 2026-11-22 19:14:28 -05:00
shweet 7a0ef5dd9f Get the selected keyframes, without triggers, from one Document method 2026-11-22 19:13:54 -05:00
shweet b29e208a20 Rename list rows from their label, which is their name where rows rename 2026-11-22 19:13:26 -05:00
shweet c467c39baa Decide a timeline row's visibility in one place 2026-11-22 19:12:59 -05:00
shweet f78d35b12b Save a spritesheet's image from one Document method
The spritesheets window and the close-document prompt both use it.
2026-11-22 19:12:32 -05:00
shweet f6325a794b Share the Add action of events and shaders 2026-11-22 19:11:47 -05:00
shweet 69cb240a8d Pass content lists to the item templates as member pointers
The six one-line accessors go.
2026-11-22 19:11:12 -05:00
shweet 48661b4c2c Edit single frame fields through one helper in Frame Properties 2026-11-22 19:10:32 -05:00
shweet 13bbd8f9c5 Name the id-and-path label for what it is, and drop a duplicate declaration and an unused parameter 2026-11-22 19:09:55 -05:00
shweet 05de859879 Draw the timeline's icon toggles with one method 2026-11-22 19:09:23 -05:00
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