Map parallax should work #77

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

Source: TODO.txt (at bbb7b8f)

Tiled writes parallaxx and parallaxy per layer. akgl_tilemap_load_layers
reads id, opacity, visible, x, y and type and not those, so a map
authored with parallax scrolls flat.

include/akgl/tilemap.h:604 already describes an image layer as "one picture
rather than a grid, which is what a parallax backdrop wants" -- so the use case is
documented and the factor that drives it is dropped at load.

The draw side is where it lands: akgl_tilemap_draw positions a layer against
akgl_camera, and a parallax factor scales that offset per layer.

Two related items are worth doing in the same pass, since all three add fields to
akgl_TilemapLayer and each on its own is an ABI break:

  • the layer's name, which is dropped the same way
  • whatever the footprint refactor does to that struct

Files: src/tilemap.c (akgl_tilemap_load_layers, akgl_tilemap_draw), include/akgl/tilemap.h


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

**Source:** TODO.txt (at bbb7b8f) Tiled writes `parallaxx` and `parallaxy` per layer. `akgl_tilemap_load_layers` reads `id`, `opacity`, `visible`, `x`, `y` and `type` and **not those**, so a map authored with parallax scrolls flat. `include/akgl/tilemap.h:604` already describes an image layer as "one picture rather than a grid, which is what a parallax backdrop wants" -- so the use case is documented and the factor that drives it is dropped at load. The draw side is where it lands: `akgl_tilemap_draw` positions a layer against `akgl_camera`, and a parallax factor scales that offset per layer. Two related items are worth doing in the same pass, since all three add fields to `akgl_TilemapLayer` and each on its own is an ABI break: - the layer's `name`, which is dropped the same way - whatever the footprint refactor does to that struct **Files:** `src/tilemap.c` (`akgl_tilemap_load_layers`, `akgl_tilemap_draw`), `include/akgl/tilemap.h` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 1.0.0 milestone 2026-08-02 18:38:34 -04:00
tachikoma added the api-gapblast-radius:medium labels 2026-08-02 18:38:34 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:31 -04:00
Sign in to join this conversation.