show the generated region maps in the viewer

Tiles are single maps of single regions, generated on worker threads
that each own a worldgen, since the layers keep RNG state. Only the
visible tiles are queued, nearest first, so the viewer never computes
more than the window shows and sleeps once it has drawn it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 18:24:59 +03:00
parent 63fd30a189
commit 5ad62524f1
10 changed files with 939 additions and 116 deletions

View File

@@ -32,13 +32,15 @@ $(B)/cJSON.o: cJSON/cJSON.c cJSON/cJSON.h | $(B)
$(B)/stb.o: src/stb.c third_party/stb/stb_image_write.h | $(B)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
VSMV_OBJ = vsmv cs pb json maps save img dump lcg noise shape worldgen verify cJSON stb
VSMV_OBJ = vsmv cs pb json maps save img dump lcg noise shape worldgen settings verify cJSON stb
$(B)/vsmv: $(VSMV_OBJ:%=$(B)/%.o)
$(CC) $^ -o $@ -lsqlite3
$(B)/vs-map-viewer: $(B)/viewer.o $(B)/nk.o
$(CC) $^ -o $@ $(SDL_LIBS)
VIEWER_OBJ = viewer tiles settings worldgen shape noise lcg maps save pb json cs nk cJSON stb
$(B)/vs-map-viewer: $(VIEWER_OBJ:%=$(B)/%.o)
$(CC) $^ -o $@ $(SDL_LIBS) -lsqlite3
$(B):
mkdir -p $@