Skip to content

Commit

Permalink
WIP: Vendor external
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraVoves committed Jan 7, 2025
1 parent d0d9913 commit 4f367de
Show file tree
Hide file tree
Showing 98 changed files with 352 additions and 9,567 deletions.
4 changes: 2 additions & 2 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ set -e
ZIG_ARCH=$1
OPTIMIZE=$2

zig/bin/${ZIG_ARCH}/zig build init
zig build init

function build() {
WITH_TRACY=$1
WITH_NFD=$2
WITH_SHADERC=$3
zig/bin/${ZIG_ARCH}/zig build -Doptimize=${OPTIMIZE} -Dwith_tracy=${WITH_TRACY} -Dwith_nfd=${WITH_NFD} -Dwith_shaderc=${WITH_SHADERC}
zig build -Doptimize=${OPTIMIZE} -Dwith_tracy=${WITH_TRACY} -Dwith_nfd=${WITH_NFD} -Dwith_shaderc=${WITH_SHADERC}
}

build true true false
Expand Down
10 changes: 0 additions & 10 deletions .ci/init_zig.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions:
env:
INSTANCE: Writerside/cetech1
ARTIFACT: webHelpCETECH12-all.zip
DOCKER_VERSION: "242.21870"
DOCKER_VERSION: "243.22562"

jobs:
build:
Expand Down
62 changes: 16 additions & 46 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,19 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Cache zig binary
id: cache-zig
uses: actions/cache@v4
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
path: zig/bin/x86_64-linux/zig
key: ${{ runner.arch }}-${{ runner.os }}-zig-${{ steps.zigversion.outputs.content }}
- name: Init zig
if: steps.cache-zig.outputs.cache-hit != 'true'
run: .ci/init_zig.sh x86_64-linux
version: ${{ steps.zigversion.outputs.content }}

- name: Lint
run: zig/bin/x86_64-linux/zig fmt --check . --exclude externals/
run: zig fmt --check . --exclude externals/

x86-64-linux:
needs: ["validation"]
Expand All @@ -61,7 +54,6 @@ jobs:
with:
submodules: true


- name: Prepare
uses: awalsh128/cache-apt-pkgs-action@latest
with:
Expand All @@ -75,12 +67,10 @@ jobs:
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Cache zig binary
id: cache-zig
uses: actions/cache@v4
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
path: zig/bin/x86_64-linux/zig
key: ${{ runner.arch }}-${{ runner.os }}-zig-${{ steps.zigversion.outputs.content }}
version: ${{ steps.zigversion.outputs.content }}

- name: Zig cache
uses: actions/cache/restore@v4
Expand All @@ -94,10 +84,6 @@ jobs:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache

- name: Init zig
if: steps.cache-zig.outputs.cache-hit != 'true'
run: .ci/init_zig.sh x86_64-linux

- name: Build
run: .ci/build.sh x86_64-linux Debug

Expand Down Expand Up @@ -137,7 +123,6 @@ jobs:
# - name: Setup headless display
# uses: pyvista/setup-headless-display-action@v2

# TODO: Fix linux CI
- name: Test headless standalone
run: zig-out/bin/cetech1 --headless --max-kernel-tick 5

Expand Down Expand Up @@ -168,7 +153,7 @@ jobs:
with:
submodules: true

# - name: Prepare
# - name: Prepare`
# run: |
# brew update
# brew install kcov
Expand All @@ -178,13 +163,10 @@ jobs:
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion

- name: Cache zig binary
id: cache-zig
uses: actions/cache@v4
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
path: zig/bin/x86_64-macos/zig
key: ${{ runner.arch }}-${{ runner.os }}-zig-${{ steps.zigversion.outputs.content }}
version: ${{ steps.zigversion.outputs.content }}

- name: Zig cache
uses: actions/cache/restore@v4
Expand All @@ -197,10 +179,6 @@ jobs:
# with:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache

- name: Init zig
if: steps.cache-zig.outputs.cache-hit != 'true'
run: .ci/init_zig.sh x86_64-macos

- name: Build
run: .ci/build.sh x86_64-macos Debug
Expand Down Expand Up @@ -258,19 +236,17 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true

- name: Read .zig-version
id: zigversion
uses: juliangruber/read-file-action@v1
with:
path: ./.zigversion
- name: Cache zig binary
id: cache-zig
uses: actions/cache@v4
- name: Install Zig
uses: mlugg/setup-zig@v1
with:
path: zig/bin/x86_64-windows/zig.exe
key: ${{ runner.arch }}-${{ runner.os }}-zig-${{ steps.zigversion.outputs.content }}

version: ${{ steps.zigversion.outputs.content }}

- name: Zig cache
uses: actions/cache/restore@v4
with:
Expand All @@ -283,11 +259,6 @@ jobs:
# path: .zig-cache
# key: ${{ runner.arch }}-${{ runner.os }}-zig-build-cache

- name: Init zig
if: steps.cache-zig.outputs.cache-hit != 'true'
shell: bash
run: .ci/init_zig.sh x86_64-windows

- name: Build
shell: bash
run: .ci/build.sh x86_64-windows Debug
Expand All @@ -300,7 +271,6 @@ jobs:
overwrite: true
retention-days: 1


- name: Zig cache
uses: actions/cache/save@v4
with:
Expand Down
27 changes: 3 additions & 24 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
[submodule "externals/shared/lib/zig-gamedev"]
path = externals/shared/lib/zig-gamedev
url = https://github.com/OndraVoves/zig-gamedev.git
[submodule "externals/shared/tools/zls"]
path = externals/shared/tools/zls
url = https://github.com/zigtools/zls.git
[submodule "externals/shared/lib/SDL_GameControllerDB"]
path = externals/shared/lib/SDL_GameControllerDB
url = https://github.com/mdqinc/SDL_GameControllerDB.git
[submodule "zig"]
path = zig
url = https://github.com/cyberegoorg/cetech1-zig.git
[submodule "externals/shared/lib/zbgfx"]
path = externals/shared/lib/zbgfx
url = https://github.com/cyberegoorg/zbgfx.git
[submodule "externals/shared/lib/ziglang-set"]
path = externals/shared/lib/ziglang-set
url = https://github.com/deckarep/ziglang-set
[submodule "externals/shared/lib/zig-uuid"]
path = externals/shared/lib/zig-uuid
url = https://github.com/tensorush/zig-uuid.git
[submodule "externals/shared/lib/zf"]
path = externals/shared/lib/zf
url = https://github.com/OndraVoves/zf.git
[submodule "externals/shared"]
path = externals/shared
url = https://github.com/cyberegoorg/cetech1-externals-shared.git
3 changes: 2 additions & 1 deletion .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .zigversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14.0-dev.1911+3bf89f55c
2024.10.0-mach
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@

Yet another experimental game engine but now in [zig](https://ziglang.org).

> [!IMPORTANT]
> Work in progressssssssssssss
## [Getting started](https://cyberegoorg.github.io/cetech1/getting-started.html)

## [Documentation](https://cyberegoorg.github.io/cetech1)

## Credits/Licenses For Fonts Included In Repository

Some fonts files are available in the `src/embed/fonts/` folder:

- **[Roboto-Medium.ttf](https://fonts.google.com/specimen/Roboto)** - Apache License 2.0
- **[fa-solid-900.ttf](https://fontawesome.com)** - SIL OFL 1.1 License
- **[fa-regular-400.ttf](https://fontawesome.com)** - SIL OFL 1.1 License
2 changes: 1 addition & 1 deletion Writerside/snippets/getting-started/build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
zig/bin/<ARCH>/zig build
zig build
2 changes: 1 addition & 1 deletion Writerside/snippets/getting-started/build_steamdeck.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
zig/bin/<ARCH>/zig build
zig build
2 changes: 1 addition & 1 deletion Writerside/snippets/getting-started/build_windows.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
zig/bin/<ARCH>/zig.exe build
zig.exe build
9 changes: 3 additions & 6 deletions Writerside/snippets/getting-started/clone.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# GIT_LFS_SKIP_SMUDGE=1 disable loading all LFS objects
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/cyberegoorg/cetech1.git

# This fetch submodules from `externals` and zig directory
# This fetch submodules from `externals`
git submodule update --init

# This download zig binary from our website. Only need for your arch where you develop
./zig/get_zig.sh <ARCH>

# This download lfs files that is needed for build
zig/bin/<ARCH>/zig build init
# This download lfs files that is needed for build and other stuff
zig build init
45 changes: 20 additions & 25 deletions Writerside/topics/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,28 @@
</tab>
</tabs>

## Get ZIG/ZLS

Get ZIG `2024.10.0-mach`.

<tabs>
<tab title="ZVM">
Get <a href="https://www.zvm.app">ZVM</a>
<code-block lang="bash">
zvm vmu zig mach
zvm i --zls 2024.10.0-mach
</code-block>
</tab>
</tabs>

## Repository structure

| Folder | Description |
|-------------------------------------------------------------------------------|------------------------------------------------------|
| [`Writerside/`](https://github.com/cyberegoorg/cetech1/tree/main/Writerside/) | This documentation |
| [`zig/`](https://github.com/cyberegoorg/cetech1/tree/main/zig/) | Submodule for prebuilt zig |
| [`externals/`](https://github.com/cyberegoorg/cetech1/tree/main/externals/) | 3rd-party library and tools |
| [`fixtures/`](https://github.com/cyberegoorg/cetech1/tree/main/fixtures/) | Tests fixtures |
| [`fixtures/`](https://github.com/cyberegoorg/cetech1/tree/main/fixtures/) | Tests fixtures |
| [`public/`](https://github.com/cyberegoorg/cetech1/tree/main/public/) | Public API for modules |
| [`src/`](https://github.com/cyberegoorg/cetech1/tree/main/src/) | Main source code folder |
| [`modules/`](https://github.com/cyberegoorg/cetech1/tree/main/modules/) | There is all modules that is possible part of engine |
Expand All @@ -63,8 +77,8 @@
| `-Dstatic_modules=` | `true` or `false` | `false` | Build all modules in static mode. |
| `-Dwith_samples=` | `true` or `false` | `true` | Build with sample modules. |
| `-Dwith_editor=` | `true` or `false` | `true` | Build with editor modules. |
| `-Dwith_tracy=` | `true` or `false` | `true` | Build with [tracy](#tracy-profiler) support. |
| `-Dwith_nfd=` | `true` or `false` | `true` | Build with NFD (native file dialog) |
| `-Dwith_tracy=` | `true` or `false` | `true` | Build with [tracy](#tracy-profiler) support. |
| `-Dwith_nfd=` | `true` or `false` | `true` | Build with NFD (native file dialog) |
| `-Dnfd_portal=` | `true` or `false` | `true` | Build NFD with xdg-desktop-portal instead of GTK. Linux, nice for SteamDeck |

## Run
Expand Down Expand Up @@ -93,9 +107,9 @@
| `--asset-root` | `str` | `null` | Path to asset root. (project path) |
| `--fullscreen` | `1` or `0` | `0` | Force full-screen mode, nice for SteamDeck. |
| `--test-ui` | `1` or `0` | `0` | Run UI tests and quit. |
| `--test-ui-filter` | `str` | `all` | Run only ui tests that pass this filter. |
| `--test-ui-filter` | `str` | `all` | Run only ui tests that pass this filter. |
| `--test-ui-speed` | `fast`, `normal`, `cinematic` | `fast` | UI test speed. |
| `--test-ui-junit` | `str` | `null` | UI test JUnit result filename. |
| `--test-ui-junit` | `str` | `null` | UI test JUnit result filename. |

## Tracy profiler

Expand All @@ -122,32 +136,13 @@ CETech1 has builtin support for tracy profiler.
</tab>
</tabs>

## ZLS

CETech provide ZLS as submodule, but you must build it.

<tabs>
<tab title="MacOS/Linux">
<code-block lang="bash">
zig/bin/ARCH/zig build zls
</code-block>
</tab>
<tab title="Windows">
<code-block lang="bash">
zig/bin/ARCH/zig.exe build zls
</code-block>
</tab>
</tabs>

## VSCode

> Repository contain recommended extension.
1. Build [ZLS](#zls)
2. Crate vscode configs.
<code-block lang="bash">
# This generate vscode launch.json with predefined cases and
# create or update settings.json with path to zig and zls.
zig/bin/ARCH/zig build vscode
# create or update settings.json
</code-block>
3. Install extension `ziglang.vscode-zig` (or install all recommended)
Loading

0 comments on commit 4f367de

Please sign in to comment.