refactor: reorganize pxl8 into client/src/ module structure

- core/: main entry, types, logging, I/O, RNG
- asset/: ase loader, cart, save, embed
- gfx/: graphics, animation, atlas, fonts, tilemap, transitions
- sfx/: audio
- script/: lua/fennel runtime, REPL
- hal/: platform abstraction (SDL3)
- world/: BSP, world, procedural gen
- math/: math utilities
- game/: GUI, replay
- lua/: Lua API modules
This commit is contained in:
asrael 2026-01-12 21:46:31 -06:00
parent 272e0bc615
commit 39b604b333
106 changed files with 6078 additions and 3715 deletions

View file

@ -1,93 +0,0 @@
#pragma once
#include "pxl8_types.h"
#include <string.h>
static const char embed_fennel[] = {
#embed "lib/fennel/fennel.lua"
, 0 };
static const char embed_pxl8[] = {
#embed "src/lua/pxl8.lua"
, 0 };
static const char embed_pxl8_anim[] = {
#embed "src/lua/pxl8/anim.lua"
, 0 };
static const char embed_pxl8_core[] = {
#embed "src/lua/pxl8/core.lua"
, 0 };
static const char embed_pxl8_gfx2d[] = {
#embed "src/lua/pxl8/gfx2d.lua"
, 0 };
static const char embed_pxl8_gfx3d[] = {
#embed "src/lua/pxl8/gfx3d.lua"
, 0 };
static const char embed_pxl8_gui[] = {
#embed "src/lua/pxl8/gui.lua"
, 0 };
static const char embed_pxl8_input[] = {
#embed "src/lua/pxl8/input.lua"
, 0 };
static const char embed_pxl8_math[] = {
#embed "src/lua/pxl8/math.lua"
, 0 };
static const char embed_pxl8_particles[] = {
#embed "src/lua/pxl8/particles.lua"
, 0 };
static const char embed_pxl8_sfx[] = {
#embed "src/lua/pxl8/sfx.lua"
, 0 };
static const char embed_pxl8_tilemap[] = {
#embed "src/lua/pxl8/tilemap.lua"
, 0 };
static const char embed_pxl8_transition[] = {
#embed "src/lua/pxl8/transition.lua"
, 0 };
static const char embed_pxl8_vfx[] = {
#embed "src/lua/pxl8/vfx.lua"
, 0 };
static const char embed_pxl8_world[] = {
#embed "src/lua/pxl8/world.lua"
, 0 };
#define PXL8_EMBED_ENTRY(var, name) {name, var, sizeof(var) - 1}
typedef struct { const char* name; const char* data; u32 size; } pxl8_embed;
static const pxl8_embed pxl8_embeds[] = {
PXL8_EMBED_ENTRY(embed_fennel, "fennel"),
PXL8_EMBED_ENTRY(embed_pxl8, "pxl8"),
PXL8_EMBED_ENTRY(embed_pxl8_anim, "pxl8.anim"),
PXL8_EMBED_ENTRY(embed_pxl8_core, "pxl8.core"),
PXL8_EMBED_ENTRY(embed_pxl8_gfx2d, "pxl8.gfx2d"),
PXL8_EMBED_ENTRY(embed_pxl8_gfx3d, "pxl8.gfx3d"),
PXL8_EMBED_ENTRY(embed_pxl8_gui, "pxl8.gui"),
PXL8_EMBED_ENTRY(embed_pxl8_input, "pxl8.input"),
PXL8_EMBED_ENTRY(embed_pxl8_math, "pxl8.math"),
PXL8_EMBED_ENTRY(embed_pxl8_particles, "pxl8.particles"),
PXL8_EMBED_ENTRY(embed_pxl8_sfx, "pxl8.sfx"),
PXL8_EMBED_ENTRY(embed_pxl8_tilemap, "pxl8.tilemap"),
PXL8_EMBED_ENTRY(embed_pxl8_transition, "pxl8.transition"),
PXL8_EMBED_ENTRY(embed_pxl8_vfx, "pxl8.vfx"),
PXL8_EMBED_ENTRY(embed_pxl8_world, "pxl8.world"),
{0}
};
static inline const pxl8_embed* pxl8_embed_find(const char* name) {
for (const pxl8_embed* e = pxl8_embeds; e->name; e++)
if (strcmp(e->name, name) == 0) return e;
return NULL;
}