summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonAki <konaki@anokonaki.org>2026-10-18 04:26:33 +0800
committerKonAki <konaki@anokonaki.org>2026-10-18 04:26:33 +0800
commita0d6ecbbbdf481e3d0457d6e66f7593b9ce17253 (patch)
tree592d360cab1eda0c559cf7f99e28be11dab16104
parent5871c92a35771e5ae84613377387154f8afb0f3b (diff)
build.c: packw module, konedit adds packw and imagemain
-rw-r--r--README.md3
-rw-r--r--build.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/README.md b/README.md
index 9ee1417..8275071 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,7 @@ The engine modules are a `.h` and a `.c` pair, they depend on each other a bit,
| sector | maps made of rooms (vertices, floors, ceilings, walls) with entities like doors and buttons, in a text format |
| world | one place to move bodies through sector maps, terrain, tilemaps and your own boxes, cylinders, spheres and planes (needs 3d, sector) |
| pack | encrypted asset packs |
+| packw | making packs from code, the writer that konpack uses. konedit builds packs with it (adds pack) |
| assets | named asset cache with reference counts, loose files or a pack |
| image | stb_image so assets can load pngs |
| audio | sound playing, looping, pitch, buses, fades, positional sound, music crossfades |
@@ -160,7 +161,7 @@ konedit is the editor, a program built on the engine's own ui. It works on plain
obj/konedit [project folder]
```
-It adds the modules it needs itself. File > New Project makes a project.toml and an assets folder, File > Open Project opens one, Ctrl+S saves. The tabs for the tilemap, script and level editors are not written yet.
+It adds the modules it needs itself. File > New Project makes a project.toml and an assets folder, File > Open Project opens one, Ctrl+S saves. The Assets tab shows pictures and the start of text files from the file list on the left. The Pack tab lists what is in the assets folder and builds the pack, with a key file if you give one. The tabs for the tilemap, script and level editors are not written yet.
## Examples
diff --git a/build.c b/build.c
index b69c3c2..b3e4994 100644
--- a/build.c
+++ b/build.c
@@ -30,7 +30,7 @@ typedef struct module
} module_t;
static const module_t known[] = {
- {"font", ""}, {"toml", ""}, {"fs", ""}, {"tile", ""}, {"pack", ""}, {"ui", "font"}, {"debug", "font assets"},
+ {"font", ""}, {"toml", ""}, {"fs", ""}, {"tile", ""}, {"pack", ""}, {"packw", "pack"}, {"ui", "font"}, {"debug", "font assets"},
{"assets", "pack"}, {"image", ""}, {"audio", ""}, {"mic", ""}, {"sound", "audio"}, {"model", "assets"},
{"2d", ""}, {"fx", "2d"}, {"particles", ""}, {"picture", "2d"}, {"rm", ""}, {"rmmap", ""}, {"rmtile", ""},
{"rmdraw", "rmmap rmtile"}, {"rmfield", "rmmap"}, {"rmplugin", ""}, {"rmdata", "battle party save"},
@@ -407,6 +407,8 @@ static void addModuleUnits(const char *m)
} else if (strcmp(m, "model") == 0) {
addKon("konmodel");
addKon("konassets");
+ } else if (strcmp(m, "packw") == 0) {
+ /* the pack unit is there with pack, this only turns the writer on in it */
} else if (strcmp(m, "image") == 0) {
addUnit("stb_image", SRCDIR "/impl/stb_image.c", 1);
} else if (strcmp(m, "audio") == 0 || strcmp(m, "mic") == 0) {
@@ -490,6 +492,7 @@ static void setup(void)
kon_freeCmd(&platformDefs);
for (i = 0; i < chosenCount; i++) push(&defs, kon_fmt("-DKON_MODULE_%s", upper(chosen[i])));
if (hasModule("3d") || hasModule("model") || hasModule("sector")) push(&defs, "-DKONSOFREN_3D");
+ if (hasModule("packw")) push(&defs, "-DKONPACK_WRITER");
if (hasModule("audio") && kon_exists(EXTDIR "/stb_vorbis.c")) push(&defs, "-DKON_VORBIS");
if (hasModule("audio") || hasModule("mic")) {
if (strcmp(platform, "linux") == 0) {
@@ -900,7 +903,7 @@ int main(int argc, char **argv)
}
if (targetCount == 0) targets[targetCount++] = "all";
for (i = 0; i < targetCount; i++) {
- if (isEditorTarget(targets[i])) addModuleList("ui,font,toml,fs");
+ if (isEditorTarget(targets[i])) addModuleList("ui,font,toml,fs,packw,image");
}
maxJobs = jobsAsked > 0 ? jobsAsked : kon_cpuCount();