An actor cannot be scaled per axis #34

Open
opened 2026-08-02 18:33:18 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md, "Carried over", item 2 (at bbb7b8f)

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
. akbasic's sprites are Commodore
sprites, 24 wide and 21 high, and SPRITE n,,,,1 expands one axis.

Two shapes are plausible and the choice is a design decision rather than an
obvious fix:

  1. Add scale_x / scale_y and keep scale as a convenience that writes both.
  2. 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.

Half of the related workaround is no longer needed. akgl_actor_render taking
the drawn height from the sprite's width is fixed, so a non-square sprite draws at
its own proportions through the library's own renderfunc. This item is the half
that remains.

Files: include/akgl/actor.h, src/actor.c


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md, "Carried over", item 2 (at bbb7b8f) `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**. `akbasic`'s sprites are Commodore sprites, 24 wide and 21 high, and `SPRITE n,,,,1` expands one axis. **Two shapes are plausible and the choice is a design decision rather than an obvious fix:** 1. Add `scale_x` / `scale_y` and keep `scale` as a convenience that writes both. 2. 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`. **Half of the related workaround is no longer needed.** `akgl_actor_render` taking the drawn height from the sprite's width is fixed, so a non-square sprite draws at its own proportions through the library's own `renderfunc`. This item is the half that remains. **Files:** `include/akgl/actor.h`, `src/actor.c` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.10.0 milestone 2026-08-02 18:33:18 -04:00
tachikoma added the api-gapdesign-decisionabi-breakblast-radius:medium labels 2026-08-02 18:33:18 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:18 -04:00
Sign in to join this conversation.