From d5aec5e6e1a78ce54a3d721036ea6d5d1489f1b6 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Sat, 22 Feb 2025 20:29:28 +0300 Subject: [PATCH] /bin/twn: devcompl command to generate clangd completions in root --- apps/demos/bunnymark/data/packs/data.toml | 2 +- apps/demos/platformer/data/packs/data.toml | 2 +- apps/demos/scenery/data/packs/data.toml | 4 ++-- apps/twnlua/data/packs/data.toml | 4 ++-- bin/twn | 3 +++ bin/twnbuild | 6 ++++-- {common-data => data}/assets/9slice.png | 0 {common-data => data}/assets/big-violet.png | 0 data/assets/dirt/1.png | 3 +++ data/assets/dirt/2.png | 3 +++ {common-data => data}/assets/grass.png | 0 {common-data => data}/assets/grasses/10.png | 0 {common-data => data}/assets/light.png | 0 {common-data => data}/assets/miramar/README.TXT | 0 .../assets/miramar/miramar_down.tga | 0 .../assets/miramar/miramar_east.tga | 0 .../assets/miramar/miramar_north.tga | 0 .../assets/miramar/miramar_south.tga | 0 {common-data => data}/assets/miramar/miramar_up.tga | 0 .../assets/miramar/miramar_west.tga | 0 {common-data => data}/assets/player/baron-walk.png | 0 {common-data => data}/assets/red.png | 0 {common-data => data}/assets/title.png | 0 {common-data => data}/assets/white.png | 0 {common-data => data}/fonts/kenney-pixel.ttf | Bin {common-data => data}/music/mod65.xm | 0 {common-data => data}/music/repeat-test.ogg | 0 {common-data => data}/music/repeat-test.xm | 0 {common-data => data}/music/test.ogg | 0 {common-data => data}/music/test.xm | 0 {common-data => data}/twn.toml | 0 31 files changed, 19 insertions(+), 8 deletions(-) rename {common-data => data}/assets/9slice.png (100%) rename {common-data => data}/assets/big-violet.png (100%) create mode 100644 data/assets/dirt/1.png create mode 100644 data/assets/dirt/2.png rename {common-data => data}/assets/grass.png (100%) rename {common-data => data}/assets/grasses/10.png (100%) rename {common-data => data}/assets/light.png (100%) rename {common-data => data}/assets/miramar/README.TXT (100%) rename {common-data => data}/assets/miramar/miramar_down.tga (100%) rename {common-data => data}/assets/miramar/miramar_east.tga (100%) rename {common-data => data}/assets/miramar/miramar_north.tga (100%) rename {common-data => data}/assets/miramar/miramar_south.tga (100%) rename {common-data => data}/assets/miramar/miramar_up.tga (100%) rename {common-data => data}/assets/miramar/miramar_west.tga (100%) rename {common-data => data}/assets/player/baron-walk.png (100%) rename {common-data => data}/assets/red.png (100%) rename {common-data => data}/assets/title.png (100%) rename {common-data => data}/assets/white.png (100%) rename {common-data => data}/fonts/kenney-pixel.ttf (100%) rename {common-data => data}/music/mod65.xm (100%) rename {common-data => data}/music/repeat-test.ogg (100%) rename {common-data => data}/music/repeat-test.xm (100%) rename {common-data => data}/music/test.ogg (100%) rename {common-data => data}/music/test.xm (100%) rename {common-data => data}/twn.toml (100%) diff --git a/apps/demos/bunnymark/data/packs/data.toml b/apps/demos/bunnymark/data/packs/data.toml index ee707d7..e218a16 100644 --- a/apps/demos/bunnymark/data/packs/data.toml +++ b/apps/demos/bunnymark/data/packs/data.toml @@ -1,3 +1,3 @@ [[deps]] -source = "../../../common-data" +source = "../../../data" name = "common-data" diff --git a/apps/demos/platformer/data/packs/data.toml b/apps/demos/platformer/data/packs/data.toml index 000fdd5..b9161de 100644 --- a/apps/demos/platformer/data/packs/data.toml +++ b/apps/demos/platformer/data/packs/data.toml @@ -1,3 +1,3 @@ [[deps]] -source = "../../../common-data" # where does it come from, might be an url +source = "../../../data" # where does it come from, might be an url name = "common-data" # should be globally unique diff --git a/apps/demos/scenery/data/packs/data.toml b/apps/demos/scenery/data/packs/data.toml index 000fdd5..d9d9bfc 100644 --- a/apps/demos/scenery/data/packs/data.toml +++ b/apps/demos/scenery/data/packs/data.toml @@ -1,3 +1,3 @@ [[deps]] -source = "../../../common-data" # where does it come from, might be an url -name = "common-data" # should be globally unique +source = "../../../data" # where does it come from, might be an url +name = "common-data" # should be globally unique diff --git a/apps/twnlua/data/packs/data.toml b/apps/twnlua/data/packs/data.toml index 5778b2a..8274739 100644 --- a/apps/twnlua/data/packs/data.toml +++ b/apps/twnlua/data/packs/data.toml @@ -1,3 +1,3 @@ [[deps]] -source = "../../common-data" # where does it come from, might be an url -name = "common-data" # should be globally unique +source = "../../data" # where does it come from, might be an url +name = "common-data" # should be globally unique diff --git a/bin/twn b/bin/twn index 9836fd5..91ee56b 100755 --- a/bin/twn +++ b/bin/twn @@ -57,6 +57,9 @@ case "$1" in fi ;; + devcompl ) (cd "$TWNROOT" && "$toolpath"/twnbuild "--build_dir=$TWNROOT/build" "${@:2}") + ;; + * ) echo "Unknown command." ;; esac diff --git a/bin/twnbuild b/bin/twnbuild index 480c86c..27cd8dd 100755 --- a/bin/twnbuild +++ b/bin/twnbuild @@ -5,6 +5,7 @@ from os import getcwd from os.path import expandvars from pathlib import Path from sys import argv +from functools import reduce import tomllib #TODO: support for default pack override @@ -16,8 +17,9 @@ has_clang = getoutput("command -v clang") != "" target_web = "--target=web" in argv #TODO: infer what "native" means for current env -build_dir = "build/web" if target_web else "build/native" -build_dir += "/release" if "--release" in argv else "/debug" +build_dir_arg = reduce(lambda c, n: c if c.startswith("--build_dir=") else n, argv + [""], "") +build_dir = "build/web" if target_web else build_dir_arg.split("=")[1] if build_dir_arg else "build/native" +build_dir += "" if build_dir_arg else "/release" if "--release" in argv else "/debug" cmake = ["emcmake", "cmake"] if target_web else ["cmake"] # cmake configuration command diff --git a/common-data/assets/9slice.png b/data/assets/9slice.png similarity index 100% rename from common-data/assets/9slice.png rename to data/assets/9slice.png diff --git a/common-data/assets/big-violet.png b/data/assets/big-violet.png similarity index 100% rename from common-data/assets/big-violet.png rename to data/assets/big-violet.png diff --git a/data/assets/dirt/1.png b/data/assets/dirt/1.png new file mode 100644 index 0000000..1aa0a81 --- /dev/null +++ b/data/assets/dirt/1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1c1b05208085c1f94d937fa238bf3f506d643cb9cef9be2b41fdab8e17921b60 +size 40165 diff --git a/data/assets/dirt/2.png b/data/assets/dirt/2.png new file mode 100644 index 0000000..8d15238 --- /dev/null +++ b/data/assets/dirt/2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df24de635dc7751f729a435ab8ffc534b9996b83e9534fbf3685c2d1d84e9532 +size 40158 diff --git a/common-data/assets/grass.png b/data/assets/grass.png similarity index 100% rename from common-data/assets/grass.png rename to data/assets/grass.png diff --git a/common-data/assets/grasses/10.png b/data/assets/grasses/10.png similarity index 100% rename from common-data/assets/grasses/10.png rename to data/assets/grasses/10.png diff --git a/common-data/assets/light.png b/data/assets/light.png similarity index 100% rename from common-data/assets/light.png rename to data/assets/light.png diff --git a/common-data/assets/miramar/README.TXT b/data/assets/miramar/README.TXT similarity index 100% rename from common-data/assets/miramar/README.TXT rename to data/assets/miramar/README.TXT diff --git a/common-data/assets/miramar/miramar_down.tga b/data/assets/miramar/miramar_down.tga similarity index 100% rename from common-data/assets/miramar/miramar_down.tga rename to data/assets/miramar/miramar_down.tga diff --git a/common-data/assets/miramar/miramar_east.tga b/data/assets/miramar/miramar_east.tga similarity index 100% rename from common-data/assets/miramar/miramar_east.tga rename to data/assets/miramar/miramar_east.tga diff --git a/common-data/assets/miramar/miramar_north.tga b/data/assets/miramar/miramar_north.tga similarity index 100% rename from common-data/assets/miramar/miramar_north.tga rename to data/assets/miramar/miramar_north.tga diff --git a/common-data/assets/miramar/miramar_south.tga b/data/assets/miramar/miramar_south.tga similarity index 100% rename from common-data/assets/miramar/miramar_south.tga rename to data/assets/miramar/miramar_south.tga diff --git a/common-data/assets/miramar/miramar_up.tga b/data/assets/miramar/miramar_up.tga similarity index 100% rename from common-data/assets/miramar/miramar_up.tga rename to data/assets/miramar/miramar_up.tga diff --git a/common-data/assets/miramar/miramar_west.tga b/data/assets/miramar/miramar_west.tga similarity index 100% rename from common-data/assets/miramar/miramar_west.tga rename to data/assets/miramar/miramar_west.tga diff --git a/common-data/assets/player/baron-walk.png b/data/assets/player/baron-walk.png similarity index 100% rename from common-data/assets/player/baron-walk.png rename to data/assets/player/baron-walk.png diff --git a/common-data/assets/red.png b/data/assets/red.png similarity index 100% rename from common-data/assets/red.png rename to data/assets/red.png diff --git a/common-data/assets/title.png b/data/assets/title.png similarity index 100% rename from common-data/assets/title.png rename to data/assets/title.png diff --git a/common-data/assets/white.png b/data/assets/white.png similarity index 100% rename from common-data/assets/white.png rename to data/assets/white.png diff --git a/common-data/fonts/kenney-pixel.ttf b/data/fonts/kenney-pixel.ttf similarity index 100% rename from common-data/fonts/kenney-pixel.ttf rename to data/fonts/kenney-pixel.ttf diff --git a/common-data/music/mod65.xm b/data/music/mod65.xm similarity index 100% rename from common-data/music/mod65.xm rename to data/music/mod65.xm diff --git a/common-data/music/repeat-test.ogg b/data/music/repeat-test.ogg similarity index 100% rename from common-data/music/repeat-test.ogg rename to data/music/repeat-test.ogg diff --git a/common-data/music/repeat-test.xm b/data/music/repeat-test.xm similarity index 100% rename from common-data/music/repeat-test.xm rename to data/music/repeat-test.xm diff --git a/common-data/music/test.ogg b/data/music/test.ogg similarity index 100% rename from common-data/music/test.ogg rename to data/music/test.ogg diff --git a/common-data/music/test.xm b/data/music/test.xm similarity index 100% rename from common-data/music/test.xm rename to data/music/test.xm diff --git a/common-data/twn.toml b/data/twn.toml similarity index 100% rename from common-data/twn.toml rename to data/twn.toml