clean up worldgen and remove verbose logging

This commit is contained in:
asrael 2025-11-11 21:24:53 -06:00
parent 4d84122ef3
commit 34e534b6f2
11 changed files with 359 additions and 174 deletions

View file

@ -225,10 +225,34 @@ static const char* pxl8_ffi_cdefs =
" void* type_params;\n"
"} pxl8_procgen_params;\n"
"\n"
"typedef struct pxl8_procgen_tex_params {\n"
" char name[16];\n"
" unsigned int seed;\n"
" int width;\n"
" int height;\n"
" float scale;\n"
" float roughness;\n"
" unsigned char base_color;\n"
" unsigned char variation;\n"
"} pxl8_procgen_tex_params;\n"
"\n"
"void pxl8_procgen_tex(u8* buffer, const pxl8_procgen_tex_params* params);\n"
"\n"
"typedef struct pxl8_bsp pxl8_bsp;\n"
"typedef struct pxl8_bsp_face pxl8_bsp_face;\n"
"typedef bool (*pxl8_texture_rule)(const pxl8_vec3* normal, const pxl8_bsp_face* face, const pxl8_bsp* bsp);\n"
"\n"
"typedef struct pxl8_world_texture {\n"
" char name[16];\n"
" unsigned int texture_id;\n"
" pxl8_texture_rule rule;\n"
"} pxl8_world_texture;\n"
"\n"
"typedef struct pxl8_world pxl8_world;\n"
"pxl8_world* pxl8_world_create(void);\n"
"void pxl8_world_destroy(pxl8_world* world);\n"
"int pxl8_world_generate(pxl8_world* world, const pxl8_procgen_params* params);\n"
"int pxl8_world_generate(pxl8_world* world, pxl8_gfx* gfx, const pxl8_procgen_params* params);\n"
"int pxl8_world_apply_textures(pxl8_world* world, const pxl8_world_texture* textures, unsigned int count);\n"
"bool pxl8_world_is_loaded(const pxl8_world* world);\n"
"int pxl8_world_load(pxl8_world* world, const char* path);\n"
"void pxl8_world_render(pxl8_world* world, pxl8_gfx* gfx, pxl8_vec3 camera_pos);\n"
@ -692,7 +716,7 @@ pxl8_result pxl8_script_load_main(pxl8_script* script, const char* path) {
if (result == PXL8_OK) {
pxl8_info("Loaded script: %s", path);
} else {
pxl8_warn("Failed to load script: %s", script->last_error);
pxl8_error("Failed to load script: %s", script->last_error);
}
return result;