Upgrade level editor for moon campaign support

Preserve tileset path and parallax style on save instead of
hardcoding tileset.png. Add tileset cycling (T key), tile flag
editing (F key for solid/platform/hazard/none), and 8x8 pixel
mini-icons for all entity types in the palette and canvas.

Fix entity palette not appearing when editor starts without a
prior level load by splitting entity_registry_init into populate
and init phases. Fix bitmap font rendering dropping the top row
by correcting FONT_H from 6 to 7. Widen toolbar button spacing.

Fix invisible collision from placed tiles lacking TileDefs by
calling ensure_tile_def on pencil and fill placement. Fix editor
hotkeys not working in the web build by latching key presses from
SDL_KEYDOWN events instead of comparing keyboard state snapshots.
This commit is contained in:
Thomas
2026-03-01 16:48:53 +00:00
parent df3bc29fb7
commit 372ea3d586
8 changed files with 382 additions and 99 deletions

View File

@@ -177,6 +177,7 @@ bool tilemap_load(Tilemap *map, const char *path, SDL_Renderer *renderer) {
/* Load tileset texture */
if (tileset_path[0] && renderer) {
snprintf(map->tileset_path, sizeof(map->tileset_path), "%s", tileset_path);
map->tileset = assets_get_texture(tileset_path);
if (map->tileset) {
int tex_w;