summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonAki <konaki@anokonaki.org>2026-10-14 18:42:51 +0800
committerKonAki <konaki@anokonaki.org>2026-10-14 18:42:51 +0800
commit8047c8acdbb8f3dddb423c553c1b74ed45ce99e9 (patch)
treef121b3c28df70a02d9fa2a79518e470c09a0bf20
parentde2bbfb85b1fab3055bf91bfcbdddc6303d9fadf (diff)
wire sound into build.sh and readme
-rw-r--r--README.md3
-rwxr-xr-xbuild.sh18
2 files changed, 18 insertions, 3 deletions
diff --git a/README.md b/README.md
index 9fe7e3c..aef0789 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,7 @@ The engine modules are a `.h` and a `.c` pair, they depend on each other a bit,
| 2d | what any 2D game needs: a scrolling camera, frame animation, drawing frames of a sprite sheet |
| fx | whole screen effects done on the pixels: fade to a colour, flash, shake and tone (adds 2d) |
| particles | pooled particle emitters (sparks, dust, glows) and rain, snow and storm presets |
+| picture | RPG Maker style pictures: moved, faded, turned, tinted and blended over the screen |
| script | event scripts: say, menus, switches, variables, jumps and calls as a flat list of commands, with the program doing the showing. can be read from text with labels. what converters write to |
| battle | turn based fights with RPG Maker style rules: stats, states, skills with damage formulas, hit and critical rolls, elements, turn order, escaping. nothing drawn, you show the results |
| party | actors with classes and levels, equipment, the party, gold and the bag, shops, and using items from the menu (adds battle and save) |
@@ -42,7 +43,6 @@ The engine modules are a `.h` and a `.c` pair, they depend on each other a bit,
| textbox | a text box for any game: wrapped pages, typewriter, name plate, a face inside, menus, a panel that can be a colour, an image or a nine patch (adds 2d, font) |
| platformer | a box that runs and jumps through a tilemap, with coyote time and jump buffering (adds tile) |
| rpg | top-down games on tilemaps: actors that walk a tile at a time, events on tiles (talk, touch, step), directions (adds tile) |
-| picture | RPG Maker style pictures: moved, faded, turned, tinted and blended over the screen |
| 3d | first person kit: mouse look body, walls from a tilemap, editable hill terrain (adds tile) |
| 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) |
@@ -51,6 +51,7 @@ The engine modules are a `.h` and a `.c` pair, they depend on each other a bit,
| image | stb_image so assets can load pngs |
| audio | sound playing, looping, pitch, buses, fades, positional sound, music crossfades |
| mic | microphone level, talking detection, last few seconds as a sound |
+| sound | RPG Maker style audio channels: BGM, BGS, ME and SE, fades, a saved BGM, loop points (adds audio) |
| model | glTF models and animation, converted to my own `.kmdl` format |
| ui | immediate mode ui |
| debug | developer console and asset view |
diff --git a/build.sh b/build.sh
index afd0a63..ef06df5 100755
--- a/build.sh
+++ b/build.sh
@@ -12,7 +12,7 @@ developer=0
usage()
{
echo "usage: build.sh [-d] [-D] [-p platform] [-m module,...] [-o objdir] [target ...]"
- echo "modules: font toml tile pack ui debug assets image audio mic model 2d fx particles picture script battle party save stage textbox platformer rpg 3d sector world"
+ echo "modules: font toml tile pack ui debug assets image audio mic sound model 2d fx particles picture script battle party save stage textbox platformer rpg 3d sector world"
echo "platforms: native linux bsd windows"
echo "targets: all run clean tools pack examples"
exit 1
@@ -85,16 +85,30 @@ addobj()
esac
}
+case " $modules " in
+*" sound "*)
+ case " $modules " in
+ *" audio "*) ;;
+ *) modules="$modules audio" ;;
+ esac
+ ;;
+esac
+
for m in $modules; do
DEFS="$DEFS -DKON_MODULE_$(echo "$m" | tr 'a-z' 'A-Z')"
case $m in
- font|toml|tile|pack|ui|debug|2d|fx|particles|picture|script|battle|party|save|stage|textbox|platformer|rpg|3d|sector|world) addobj "kon$m" ;;
+ font|toml|tile|pack|ui|debug|2d|fx|particles|picture|sound|script|battle|party|save|stage|textbox|platformer|rpg|3d|sector|world) addobj "kon$m" ;;
assets) addobj konassets ;;
model) addobj konmodel; addobj konassets ;;
image) addobj stb_image ;;
audio|mic)
addobj miniaudio
addobj "kon$m"
+ # ogg only works when ext/stb_vorbis.c is there
+ if [ "$m" = audio ] && [ -f ext/stb_vorbis.c ]; then
+ DEFS="$DEFS -DKON_VORBIS"
+ addobj stb_vorbis
+ fi
case $platform in
linux) LDLIBS="$LDLIBS -lpthread -ldl" ;;
bsd) LDLIBS="$LDLIBS -lpthread" ;;