Commit Graph
47 Commits
Author SHA1 Message Date
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 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
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 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 a917d8ae97 SVG spritesheets
An .svg spritesheet loads through lunasvg (now part of the core library) at
one pixel per SVG unit, so regions, crops and picking work as for PNGs. The
preview, renders and CLI draw it again, cached per power-of-two zoom level up
to 8x, so it stays sharp when zoomed or scaled. Its pixels aren't edited
(pencil, eraser, pack and merge leave it alone, and Save skips it), and the
Isaac warning counts SVG sheets since the game can't load them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:41:57 -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 2dbbfa5e86 anm2ed-cli and render tests: look at animations without the editor
- anm2ed-cli info|frame|render: a text summary, one frame as a PNG, or the
  whole animation as a contact sheet, PNG sequence, GIF or video, drawn by
  the editor's OpenGL renderer in a hidden window (render::HeadlessGL).
- render::animation_frame_render / animation_record draw an animation's
  layers over its bounds (Canvas::layers_render, also used by About) and
  record them through the existing Recorder.
- The editor's code builds as anm2ed_app, shared by the editor, the CLI and
  anm2ed_render_tests, which checks a fixture's pixels and golden PNGs
  (with tolerance; skipped without OpenGL) and leaves its renders in
  build/renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 13:32:42 -04:00
shweetandClaude Opus 5.5 4c569cb1e5 Stage 10a: delete dead code, merge tiny files, unify duplicated concepts
- Dead code: util/map, util/unordered_map, unused vector/math/string/input
  helpers, Document getters, special-interpolation bake leftovers,
  triggers_sort, SnapshotStack::max_size_get, AudioStream capture API.
- Merges: util/xml, util/string, resource/strings.cpp inlined; constants
  into input.hpp; tooltip into layout; Recorder into render; onionskin,
  tools, welcome and frame properties are panel functions; timeline
  popups.cpp folded into timeline.cpp.
- util/origin.hpp replaced by model Origin (the merge setting stays a
  combo index, so saved preferences keep their meaning).
- Item type names/icons/colors moved from model/common.hpp to the
  timeline header; the model no longer includes icon/strings headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:35:22 -04:00
shweetandClaude Opus 5.5 8953101245 Stage 0: continuity test suite
- anm2ed_core static library (anm2 + non-UI util + log) shared by app and tests
- Logger is inert until session_open, so the core has no SDL dependency
- doctest suite: golden round-trips of 12 synthetic fixtures across every
  serialization preset, format and merge type; save/reload invariants
  (fixed point, hash stability, game view equals re-baked game view);
  operation goldens; env-gated private corpus run (ANM2ED_CORPUS)
- ANM2ED_UPDATE_GOLDEN=1 regenerates goldens; tests/MANUAL.md UI checklist

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 14:34:31 -04:00
shweet b7c24fad99 shading and shearing 2026-08-20 20:03:12 -04:00
shweet 5e27111b21 address log accumulation issue and non-ascii files load on program init 2026-08-13 21:40:28 -04:00
shweet c28ea8eb6f tick/fps difference in render animation; touched up 2026-07-10 21:21:25 -04:00
shweet 6e5d73c639 header cleanup 2026-05-22 10:20:43 -04:00
shweet 1bc5199e3b Holy vibecode Batman! 2026-05-21 21:00:57 -04:00
shweet 5c746d99c2 60Hz 2026-05-07 00:19:53 -04:00
shweet bbfafd7331 Render animation fixes, vs code tasks 2026-03-15 13:22:53 -04:00
shweet 1b5ba6b584 fix audio desync for realsies, stderr to log.txt 2026-03-10 00:36:21 -04:00
shweet c11b404392 let's actually stage those changes... 2026-03-09 23:09:37 -04:00
shweet 77f6e65b15 some bug fixes, added spritesheet filepath setting, etc. 2026-03-05 00:10:59 -05:00
shweet 3b551abb8a fixed rendering issues with non-30 fps 2026-01-14 04:36:24 -05:00
shweet 579ca08181 fix issue with rendering animations on linux 2026-01-14 04:03:26 -05:00
shweet d2bc5696bb render: open process as "wb" not "w" 2026-01-11 17:00:08 -05:00
shweet 99d4d06594 FFFFFFFFFFFFFF 2025-12-18 01:36:20 -05:00
shweet 50154973ef fuck everything 2025-12-18 01:36:07 -05:00
shweet d6fab7c738 bbbbbbbb 2025-12-18 01:23:41 -05:00
shweet 09cfaf9af8 bro 2025-12-18 01:15:10 -05:00
shweet 4475c79438 sneed 2025-12-18 01:08:36 -05:00
shweet d6c2ee3401 breh 2025-12-18 00:57:04 -05:00
shweet df7dfde1d6 this is insane but sure 2025-12-18 00:36:19 -05:00
shweet 7e1b84e83c :) 2025-12-18 00:25:28 -05:00
shweet e81030d9e3 mgggggggggggh 2025-12-17 23:58:31 -05:00
shweet 62c845f47b blork 2025-12-17 23:50:32 -05:00
shweet 0ba585511c windows moment 2025-12-17 23:09:58 -05:00
shweet 119bbc4081 Refactor + render animation tweaks + updated frame properties + bug fixes 2025-12-17 23:02:00 -05:00
shweet ec45bb4e62 again with xm... 2025-11-11 19:19:36 -05:00
shweet 3f666ab18a msvc fixes 2025-11-11 19:16:07 -05:00
shweet 0f5dae7ef8 more fixes 2025-11-11 19:08:17 -05:00
shweet 21fa89c35d bleh bleh bleh 2025-11-11 19:03:57 -05:00
shweet 993f92e412 fix for filepath to string conversions 2025-11-11 18:54:57 -05:00
shweet 2a671e2623 minor polish here and there 2025-11-11 15:45:49 -05:00
shweet e2799b1e58 timeline refactor, bit broken rn 2025-11-09 10:35:21 -05:00
shweet 62cd94ca78 Big refactor, shuffling a lot of files around 2025-11-01 19:51:19 -04:00