From 715fdbb7c1553ebfd6fe72e4c8f2d68bc291c3c3 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 25 Aug 2026 21:43:02 +0200 Subject: [PATCH] Initial commit --- .DS_Store | Bin 0 -> 6148 bytes .gitmodules | 3 +++ README.md | 29 +++++++++++++++++++++++++++++ build.sh | 17 +++++++++++++++++ fmt.sh | 6 ++++++ odinfmt.json | 13 +++++++++++++ ols.json | 8 ++++++++ scripts/pre-commit | 18 ++++++++++++++++++ src/.DS_Store | Bin 0 -> 6148 bytes src/main.odin | 11 +++++++++++ vendor/.DS_Store | Bin 0 -> 6148 bytes vendor/gram | 1 + 12 files changed, 106 insertions(+) create mode 100644 .DS_Store create mode 100644 .gitmodules create mode 100644 README.md create mode 100755 build.sh create mode 100755 fmt.sh create mode 100644 odinfmt.json create mode 100644 ols.json create mode 100755 scripts/pre-commit create mode 100644 src/.DS_Store create mode 100644 src/main.odin create mode 100644 vendor/.DS_Store create mode 160000 vendor/gram diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e29c8ce56b745f9deedc1c4df883d9ddd57fc0f0 GIT binary patch literal 6148 zcmeH~O-{o=427R*1(n!z$#Sm14MtUaf?fbMVSyA8lmP4OdhI^{v?>ZntXLph^1Rez z&nVv_t^vsAqkRO{09JHW9CewS?yJx2CL#-}*coql$JmZdcj#x?-v_kz4kH>2c)?YD z-)X^uTLT(DvhR2cZt;m{yrM;q;k==_X-OanB!MK51d_ln2xvE@t?pfOO#(?E30w&1 z_o2{LYv|-^pAIfI0#KI>oAKFZ32M;*wT4cvjL^hOsa`5EVu+VBULvoCPOe@KiQz-y zW{C+!>~@}CEFDr^b4>zC;41;0y=iOh|2z5*^S|b#C4nUHPYK9!yWej3a?x97uc^JZ u(4XjMW3Huhu~tmAR?HvTiXX1>iav9{hEA?l&bXCR^N)aXNlOBMLEr?dV;_b9 literal 0 HcmV?d00001 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..21034b5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sindri/vendor/gram"] + path = vendor/gram + url = https://github.com/riyyi/gram.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..3363b28 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Sindri + +Game engine. + +## Usage + + TODO + +## Compiling + +### Dependencies + +- `odin` +- `sh` a POSIX compatible shell + +### Building + +```sh +./build.sh +./build.sh debug +``` + +## Contributing + +Make sure to enable git hooks: + +```sh +git config core.hooksPath scripts +``` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..31ca658 --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +PROJECT="sindri" +VERSION="dev-$(date -u '+%Y-%m-%d')-$(git rev-parse --short HEAD)" + +mkdir -p build + +if [ "$1" = "debug" ]; then + shift + + odin build src/ -show-timings -collection:src=src -out:build/$PROJECT -microarch:native -use-separate-modules -define:VERSION="$VERSION-debug" -debug "$@" + exit 0 +fi + +odin build src/ -show-timings -collection:src=src -out:build/$PROJECT -microarch:native -o:speed -define:VERSION="$VERSION" "$@" diff --git a/fmt.sh b/fmt.sh new file mode 100755 index 0000000..888ef0e --- /dev/null +++ b/fmt.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +odinfmt -w src/ > /dev/null +# odinfmt -w tests/ > /dev/null diff --git a/odinfmt.json b/odinfmt.json new file mode 100644 index 0000000..ff28670 --- /dev/null +++ b/odinfmt.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/odinfmt.schema.json", + "align_struct_fields": true, + "align_struct_values": true, + "character_width": 80, + "indent_cases": true, + "newline_limit": 1, + "newline_style": "LF", + "sort_imports": true, + "space_single_line_blocks": true, + "tabs": true, + "tabs_width": 4 +} diff --git a/ols.json b/ols.json new file mode 100644 index 0000000..3b36b1e --- /dev/null +++ b/ols.json @@ -0,0 +1,8 @@ +{ + "collections": [ + { + "name": "src", + "path": "src" + } + ] +} \ No newline at end of file diff --git a/scripts/pre-commit b/scripts/pre-commit new file mode 100755 index 0000000..5038022 --- /dev/null +++ b/scripts/pre-commit @@ -0,0 +1,18 @@ +#!/bin/sh + +SCRIPT_DIR=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd) + +git stash push --keep-index --quiet + +"$SCRIPT_DIR/../fmt.sh" + +if ! git diff --quiet; then + echo "Formatting changed staged files; commit aborted." + git checkout -- "$SCRIPT_DIR/.." + git stash pop --quiet + exit 1 +fi + +# "$SCRIPT_DIR/../test.sh" + +git stash pop --quiet diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0b>!3`IXv4*{}x?5L#&$PI)bIYBOvwg$SS2#_GVj-F47OWn?aQG5dA6Dbq6 z|6rK_Y%%#8VfFI@4C@9Fk={$ccLbDoBkOER*roceB=k-%oeck9}T+Z<0CxD3`#jo@*?iXK>HQ72@q3K5;WKfU- HPgURna?}#6 literal 0 HcmV?d00001 diff --git a/vendor/gram b/vendor/gram new file mode 160000 index 0000000..0219d56 --- /dev/null +++ b/vendor/gram @@ -0,0 +1 @@ +Subproject commit 0219d56dc20946653588ec5b91d371805c023336