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

@@ -47,6 +47,7 @@ typedef struct Tilemap {
int tile_def_count;
SDL_Texture *tileset;
int tileset_cols; /* columns in tileset image */
char tileset_path[ASSET_PATH_MAX]; /* tileset file path */
Vec2 player_spawn;
float gravity; /* level gravity (px/s^2), 0 = use default */
char music_path[ASSET_PATH_MAX]; /* level music file path */