2026-04-16 21:04:50 -04:00
|
|
|
CC := cc
|
|
|
|
|
CFLAGS := -std=c99 -Wall -Wpedantic -Werror=implicit -Wmissing-prototypes -O2 -g -Isrc
|
|
|
|
|
LDFLAGS :=
|
|
|
|
|
|
feat: 3D blobber dungeon generator (PR 1)
Replaces the 2D-only demo pipeline with a 3D cell-based blobber
generator. Per-cell face walls, per-material mesh emission, and a
GDExtension binding that returns a Dictionary with ArrayMesh surfaces
the demo consumes directly.
- src/blobber/: cell3d_t data model, dungeon container, pipeline that
wraps the 2D generator per level and materializes into cell3d
- src/mesh/: face-quad emitter with per-material groups + .obj dump
- src/genesis3d_main.c: new CLI driving the blobber + mesh
- godot/: BrogueGen.generate_dungeon(seed, num_levels, depth) binding
with dungeon_to_dict packing cells + mesh surfaces
- demo/: demo_blobber.tscn + dungeon_builder.gd, func_godot addon for
the .map export path, point/entity templates, TrenchBroom docs
- Retired: old arcade/FPS demo scenes and their scripts, unused meshlib
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 13:24:27 -04:00
|
|
|
GEN_SRC := $(wildcard src/gen/*.c)
|
|
|
|
|
GEN_OBJ := $(GEN_SRC:src/%.c=obj/%.o)
|
2026-04-16 21:04:50 -04:00
|
|
|
|
feat: 3D blobber dungeon generator (PR 1)
Replaces the 2D-only demo pipeline with a 3D cell-based blobber
generator. Per-cell face walls, per-material mesh emission, and a
GDExtension binding that returns a Dictionary with ArrayMesh surfaces
the demo consumes directly.
- src/blobber/: cell3d_t data model, dungeon container, pipeline that
wraps the 2D generator per level and materializes into cell3d
- src/mesh/: face-quad emitter with per-material groups + .obj dump
- src/genesis3d_main.c: new CLI driving the blobber + mesh
- godot/: BrogueGen.generate_dungeon(seed, num_levels, depth) binding
with dungeon_to_dict packing cells + mesh surfaces
- demo/: demo_blobber.tscn + dungeon_builder.gd, func_godot addon for
the .map export path, point/entity templates, TrenchBroom docs
- Retired: old arcade/FPS demo scenes and their scripts, unused meshlib
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 13:24:27 -04:00
|
|
|
BLOBBER_SRC := $(wildcard src/blobber/*.c)
|
|
|
|
|
BLOBBER_OBJ := $(BLOBBER_SRC:src/%.c=obj/%.o)
|
|
|
|
|
|
|
|
|
|
MESH_SRC := $(wildcard src/mesh/*.c)
|
|
|
|
|
MESH_OBJ := $(MESH_SRC:src/%.c=obj/%.o)
|
|
|
|
|
|
|
|
|
|
.PHONY: all clean genesis genesis3d test stress godot godot-clean map tb-sync
|
|
|
|
|
all: genesis genesis3d
|
|
|
|
|
|
|
|
|
|
# --- TrenchBroom round-trip helpers -----------------------------------------
|
|
|
|
|
# Override on the command line: `make map SEED=99 DEPTH=30 LEVELS=4`.
|
|
|
|
|
GENERATOR ?= brogue
|
|
|
|
|
SEED ?= 42
|
|
|
|
|
DEPTH ?= 20
|
|
|
|
|
LEVELS ?= 1
|
|
|
|
|
MAP_OUT ?= $(abspath demo/maps/generated.map)
|
|
|
|
|
TB_GAME_DIR ?= $(HOME)/.TrenchBroom/games/brogue-genesis
|
|
|
|
|
|
|
|
|
|
map:
|
|
|
|
|
@mkdir -p $(dir $(MAP_OUT))
|
|
|
|
|
godot --headless --path demo --script scripts/export_map.gd -- \
|
|
|
|
|
--generator $(GENERATOR) --seed $(SEED) --depth $(DEPTH) \
|
|
|
|
|
--levels $(LEVELS) --out $(MAP_OUT)
|
|
|
|
|
|
|
|
|
|
tb-sync:
|
|
|
|
|
godot --headless --path demo --script scripts/export_tb_config.gd -- $(TB_GAME_DIR)
|
2026-04-16 21:04:50 -04:00
|
|
|
|
|
|
|
|
test: bin/genesis
|
|
|
|
|
@bash test/run_tests.sh
|
|
|
|
|
|
|
|
|
|
stress: bin/genesis
|
|
|
|
|
@./bin/genesis --stress 5000
|
|
|
|
|
|
|
|
|
|
godot:
|
|
|
|
|
@cd godot && scons -j$$(nproc) platform=linux target=template_debug
|
|
|
|
|
|
|
|
|
|
godot-clean:
|
|
|
|
|
@rm -rf godot/build godot/godot-cpp/bin demo/addons/brogue_gen
|
|
|
|
|
|
feat: 3D blobber dungeon generator (PR 1)
Replaces the 2D-only demo pipeline with a 3D cell-based blobber
generator. Per-cell face walls, per-material mesh emission, and a
GDExtension binding that returns a Dictionary with ArrayMesh surfaces
the demo consumes directly.
- src/blobber/: cell3d_t data model, dungeon container, pipeline that
wraps the 2D generator per level and materializes into cell3d
- src/mesh/: face-quad emitter with per-material groups + .obj dump
- src/genesis3d_main.c: new CLI driving the blobber + mesh
- godot/: BrogueGen.generate_dungeon(seed, num_levels, depth) binding
with dungeon_to_dict packing cells + mesh surfaces
- demo/: demo_blobber.tscn + dungeon_builder.gd, func_godot addon for
the .map export path, point/entity templates, TrenchBroom docs
- Retired: old arcade/FPS demo scenes and their scripts, unused meshlib
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 13:24:27 -04:00
|
|
|
genesis: bin/genesis
|
|
|
|
|
genesis3d: bin/genesis3d
|
2026-04-16 21:04:50 -04:00
|
|
|
|
|
|
|
|
bin/genesis: $(GEN_OBJ) obj/genesis_main.o obj/json_emit.o
|
|
|
|
|
@mkdir -p bin
|
|
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ -lm
|
|
|
|
|
|
feat: 3D blobber dungeon generator (PR 1)
Replaces the 2D-only demo pipeline with a 3D cell-based blobber
generator. Per-cell face walls, per-material mesh emission, and a
GDExtension binding that returns a Dictionary with ArrayMesh surfaces
the demo consumes directly.
- src/blobber/: cell3d_t data model, dungeon container, pipeline that
wraps the 2D generator per level and materializes into cell3d
- src/mesh/: face-quad emitter with per-material groups + .obj dump
- src/genesis3d_main.c: new CLI driving the blobber + mesh
- godot/: BrogueGen.generate_dungeon(seed, num_levels, depth) binding
with dungeon_to_dict packing cells + mesh surfaces
- demo/: demo_blobber.tscn + dungeon_builder.gd, func_godot addon for
the .map export path, point/entity templates, TrenchBroom docs
- Retired: old arcade/FPS demo scenes and their scripts, unused meshlib
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 13:24:27 -04:00
|
|
|
bin/genesis3d: $(GEN_OBJ) $(BLOBBER_OBJ) $(MESH_OBJ) obj/genesis3d_main.o
|
|
|
|
|
@mkdir -p bin
|
|
|
|
|
$(CC) $(LDFLAGS) -o $@ $^ -lm
|
|
|
|
|
|
2026-04-16 21:04:50 -04:00
|
|
|
obj/%.o: src/%.c
|
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
|
|
obj/genesis_main.o: src/genesis_main.c
|
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
feat: 3D blobber dungeon generator (PR 1)
Replaces the 2D-only demo pipeline with a 3D cell-based blobber
generator. Per-cell face walls, per-material mesh emission, and a
GDExtension binding that returns a Dictionary with ArrayMesh surfaces
the demo consumes directly.
- src/blobber/: cell3d_t data model, dungeon container, pipeline that
wraps the 2D generator per level and materializes into cell3d
- src/mesh/: face-quad emitter with per-material groups + .obj dump
- src/genesis3d_main.c: new CLI driving the blobber + mesh
- godot/: BrogueGen.generate_dungeon(seed, num_levels, depth) binding
with dungeon_to_dict packing cells + mesh surfaces
- demo/: demo_blobber.tscn + dungeon_builder.gd, func_godot addon for
the .map export path, point/entity templates, TrenchBroom docs
- Retired: old arcade/FPS demo scenes and their scripts, unused meshlib
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 13:24:27 -04:00
|
|
|
obj/genesis3d_main.o: src/genesis3d_main.c
|
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
2026-04-16 21:04:50 -04:00
|
|
|
obj/json_emit.o: src/json_emit.c src/json_emit.h
|
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf obj bin
|