From 93e8e4afa4fff5778606d50f92107141f4ada180 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Fri, 31 Jul 2026 16:51:34 -0400 Subject: [PATCH] Record that an actor cannot be scaled per axis akgl_Actor::scale is one float32_t applied to both dest.w and dest.h, so "twice as wide, the same height" cannot be expressed. The VIC-II has had separate x- and y-expand bits since 1982 and Commodore BASIC 7.0's SPRITE verb exposes both, so a BASIC interpreter drawing through this library cannot implement its own documented verb. Reached from akbasic, whose sprites are 24x21. It works around this and defect 26 together by installing its own renderfunc on each actor rather than patching around the library. Two other defects were filed alongside this one before the rebase and both are gone: the drawn-height-from-width bug is already defect 26, and the akgl_path_relative context leak was fixed in c622754. Co-Authored-By: Claude Opus 5 (1M context) --- TODO.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/TODO.md b/TODO.md index 1e2eeab..e86b00f 100644 --- a/TODO.md +++ b/TODO.md @@ -1748,3 +1748,19 @@ this library and told it is compatible. `akgl_character_state_sprites_iterate` is still uncovered and is the natural place to start; `tests/actor.c` now covers `akgl_character_sprite_get` and the composite-state binding behavior it depends on. + +2. **An actor cannot be scaled per axis.** `akgl_Actor::scale` is one `float32_t` applied + to both `dest.w` and `dest.h`, so there is no way to express "twice as wide, the same + height". The VIC-II has had separate x- and y-expand bits since 1982 and Commodore + BASIC 7.0's `SPRITE` verb exposes both, so a BASIC interpreter drawing through libakgl + cannot implement its own documented verb. + + Two shapes are plausible and the choice is a design decision rather than an obvious + fix: add `scale_x` / `scale_y` and keep `scale` as a convenience that writes both, or + replace `scale` outright and take the ABI break while the major version is still 0. + The second is cleaner and the soname already carries `MAJOR.MINOR`. + + Related to defect 26, and reached the same way: `akbasic`'s sprites are Commodore + sprites, 24 wide and 21 high, and `SPRITE n,,,,1` expands one axis. It works around + both by installing its own `renderfunc` on each actor rather than patching around the + library.