Skip to content

Commit e6b1ccf

Browse files
committed
WIP: Upgrade ZBGFX, ZNFDE, ZFlecs, ZGUI, FontAwesome => Lucide
1 parent 8711923 commit e6b1ccf

1,440 files changed

Lines changed: 314883 additions & 82187 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
steps:
2828
- name: Checkout repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v5
3030

3131
# - name: Pull LFS
3232
# run: git lfs pull --include "docs/**/*"
@@ -106,7 +106,7 @@ jobs:
106106
needs: [build, test, deploy]
107107
steps:
108108
- name: Check out code
109-
uses: actions/checkout@v4
109+
uses: actions/checkout@v5
110110

111111
- name: Cleanup
112112
run: |

.github/workflows/test.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ jobs:
2828
timeout-minutes: 1
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v4
31+
uses: actions/checkout@v5
32+
3233
- name: Install Zig
3334
uses: mlugg/setup-zig@v2
35+
with:
36+
cache-size-limit: 4096
3437

3538
- name: Lint
3639
run: zig fmt --check . --exclude externals/
@@ -52,7 +55,7 @@ jobs:
5255

5356
steps:
5457
- name: Checkout
55-
uses: actions/checkout@v4
58+
uses: actions/checkout@v5
5659

5760
- if: runner.os == 'Linux'
5861
name: Prepare linux
@@ -68,17 +71,19 @@ jobs:
6871
6972
- name: Install Zig
7073
uses: mlugg/setup-zig@v2
74+
with:
75+
cache-size-limit: 4096
7176

7277
- name: Init repo
7378
shell: bash
7479
run: zig build init
7580

7681
- name: Build
7782
shell: bash
78-
run: zig build -Doptimize=Debug -Dwith_shaderc=false
83+
run: zig build -Doptimize=Debug
7984

8085
- name: Upload build
81-
uses: actions/upload-artifact@v4
86+
uses: actions/upload-artifact@v5
8287
with:
8388
name: ${{matrix.os}}-bin
8489
path: zig-out/
@@ -106,10 +111,9 @@ jobs:
106111
shell: bash
107112
run: zig-out/bin/cetech1_test
108113

109-
# FIXME: Windows
110-
- if: runner.os != 'Windows'
111-
name: Test UI headless
114+
- name: Test UI headless
112115
run: zig-out/bin/cetech1_studio --headless --test-ui --test-ui-junit ./result.xml
116+
113117
- name: Publish Test Report
114118
uses: mikepenz/action-junit-report@v4
115119
if: success() || failure() # always run even if the previous step fails

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
project.xcworkspace/
2828
xcuserdata/
2929

30+
# Kevelop
31+
*.kdev4
32+
3033
kcov-output/
3134

3235
imgui.ini
@@ -36,6 +39,7 @@ _static.zig
3639
# VSCode
3740
.vscode/launch.json
3841
.vscode/settings.json
42+
.vscode/tasks.json
3943

4044
# Idea
4145
.idea/
@@ -51,4 +55,4 @@ result.xml
5155
*.tracy
5256
NodeEditor.json
5357

54-
*.zst
58+
*.zst

.ide.zon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.{
2+
.tasks = .{
3+
.{ .name = "Build", .type = "shell", .command = "zig", .args = .{"build"} },
4+
},
5+
26
.launchers = .{
37
.{ .name = "Unit tests", .program = .{ .path = "zig-out/bin/cetech1_test" }, .args = .{} },
48
.{ .name = "No asset root", .args = .{} },

build.zig

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const std = @import("std");
22
const builtin = @import("builtin");
33

44
pub const generate_ide = @import("src/tools/generate_ide.zig");
5+
const zbgfx = @import("zbgfx");
56

67
const min_zig_version = std.SemanticVersion.parse("0.15.1") catch @panic("Where is .zigversion?");
78
const cetech1_version = std.SemanticVersion.parse(@embedFile(".version")) catch @panic("Where is .version?");
@@ -131,6 +132,8 @@ pub fn createKernelExe(
131132
ignored_modules: ?[]const []const u8,
132133
ignored_modules_prefix: ?[]const []const u8,
133134
) !*std.Build.Step.Compile {
135+
const use_lld = !target.result.os.tag.isDarwin();
136+
134137
const exe = b.addExecutable(.{
135138
.name = bin_name,
136139
.version = versionn,
@@ -140,6 +143,7 @@ pub fn createKernelExe(
140143
.optimize = optimize,
141144
}),
142145
.use_llvm = true,
146+
.use_lld = use_lld,
143147
});
144148
exe.root_module.link_libc = true;
145149
exe.root_module.addImport("kernel", cetech1_kernel);
@@ -172,7 +176,7 @@ pub fn createStudioExe(
172176
return try createKernelExe(
173177
b,
174178
base_bin_name ++ "_studio",
175-
"studio",
179+
"run-studio",
176180
"Run studio",
177181
root_source,
178182
cetech1_kernel,
@@ -246,7 +250,7 @@ pub fn build(b: *std.Build) !void {
246250
.nfd_portal = b.option(bool, "nfd_portal", "build NFD with xdg-desktop-portal instead of GTK. ( Linux, nice for steamdeck;) )") orelse true,
247251

248252
// ZGUI
249-
.with_freetype = b.option(bool, "with_freetype", "build coreui with freetype support") orelse false,
253+
.with_freetype = b.option(bool, "with_freetype", "build coreui with freetype support") orelse true,
250254

251255
// BGFX
252256
.with_shaderc = b.option(bool, "with_shaderc", "build with shaderc support") orelse true,
@@ -264,6 +268,8 @@ pub fn build(b: *std.Build) !void {
264268
}
265269
const options_module = options_step.createModule();
266270

271+
const use_lld = !target.result.os.tag.isDarwin();
272+
267273
//
268274
// Extrnals
269275
//
@@ -343,7 +349,8 @@ pub fn build(b: *std.Build) !void {
343349
);
344350

345351
// ZBGFX
346-
const zbgfx = b.dependency(
352+
// TODO: Remove
353+
const zbgfx_dep = b.dependency(
347354
"zbgfx",
348355
.{
349356
.target = target,
@@ -384,7 +391,6 @@ pub fn build(b: *std.Build) !void {
384391
.target = b.graph.host,
385392
}),
386393
});
387-
b.installArtifact(generate_ide_tool);
388394

389395
// Modules
390396
const ModulesSet = std.StringArrayHashMapUnmanaged(void);
@@ -418,6 +424,7 @@ pub fn build(b: *std.Build) !void {
418424
// TODO: Problem with debugdraw in dll on windows.
419425
if (target.result.os.tag == .windows) {
420426
try static_modules.put(b.allocator, "gpu_bgfx", {});
427+
try static_modules.put(b.allocator, "physics_jolt", {});
421428
}
422429

423430
// Dynamic modules.
@@ -475,7 +482,6 @@ pub fn build(b: *std.Build) !void {
475482
const gen_ide_step = b.step("gen-ide", "init/update IDE configs");
476483
{
477484
const ide = b.option(generate_ide.EditorType, "ide", "IDE for gen-ide command") orelse .VSCode;
478-
const no_zls = b.option(bool, "no_zls", "Dont write zls path with gen-ide command") orelse false;
479485

480486
const gen_ide = b.addRunArtifact(generate_ide_tool);
481487

@@ -493,10 +499,6 @@ pub fn build(b: *std.Build) !void {
493499
gen_ide.addArg("--config");
494500
gen_ide.addDirectoryArg(b.path(".ide.zon"));
495501

496-
if (no_zls) {
497-
gen_ide.addArg("--no-zls");
498-
}
499-
500502
gen_ide_step.dependOn(&gen_ide.step);
501503
}
502504

@@ -520,7 +522,8 @@ pub fn build(b: *std.Build) !void {
520522
});
521523

522524
if (options.with_shaderc) {
523-
b.installArtifact(zbgfx.artifact("shaderc"));
525+
const shaderc_install = try zbgfx.build_step.installShaderc(b, zbgfx_dep);
526+
b.getInstallStep().dependOn(shaderc_install);
524527
}
525528

526529
//
@@ -570,14 +573,14 @@ pub fn build(b: *std.Build) !void {
570573
.name = "gamecontrollerdb",
571574
.module = b.createModule(.{ .root_source_file = b.path("externals/shared/lib/SDL_GameControllerDB/gamecontrollerdb.txt") }),
572575
},
573-
.{
574-
.name = "fa-solid-900",
575-
.module = b.createModule(.{ .root_source_file = b.path("externals/shared/fonts/fa-solid-900.ttf") }),
576-
},
577576
.{
578577
.name = "Roboto-Medium",
579578
.module = b.createModule(.{ .root_source_file = b.path("externals/shared/fonts/Roboto-Medium.ttf") }),
580579
},
580+
.{
581+
.name = "lucide",
582+
.module = b.createModule(.{ .root_source_file = b.path("externals/shared/fonts/lucide.ttf") }),
583+
},
581584
};
582585

583586
//
@@ -655,6 +658,7 @@ pub fn build(b: *std.Build) !void {
655658
.imports = &imports,
656659
}),
657660
.use_llvm = true,
661+
.use_lld = use_lld,
658662
});
659663
useSystemSDK(b, target, tests);
660664
b.installArtifact(tests);

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@
106106

107107
// zig-gamedev
108108
.system_sdk = .{
109-
.url = "https://github.com/zig-gamedev/system_sdk/archive/c0dbf11cdc17da5904ea8a17eadc54dee26567ec.tar.gz",
110-
.hash = "system_sdk-0.3.0-dev-alwUNnYaaAJAtIdE2fg4NQfDqEKs7QCXy_qYukAOBfmF",
109+
.url = "https://github.com/zig-gamedev/system_sdk/archive/777e76828f05d5d223df47a4c0de95ae4efde884.tar.gz",
110+
.hash = "system_sdk-0.3.0-dev-alwUNqAaaALJ5VoZImZo3n6prezBnQnrpziun3ZeZwcp",
111111
.lazy = true,
112112
},
113113
.zglfw = .{ .path = "externals/shared/lib/zglfw" },

docs/topics/about.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ posts.
3434

3535
## Credits/Licenses For Fonts Included In Repository
3636

37-
Some fonts files are available in the `src/embed/fonts/` folder:
37+
Some fonts files are available in the `externals/shared/fonts/` folder:
3838

3939
- **[Roboto-Medium.ttf](https://fonts.google.com/specimen/Roboto)** - Apache License 2.0
40-
- **[fa-regular-400.ttf](https://fontawesome.com)** - SIL OFL 1.1 License
40+
- **[lucide.ttf](https://lucide.dev/)** - ISC License
41+

docs/topics/getting-started.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,18 @@ Get ZIG `0.15.1`.
4646
</tab>
4747
</tabs>
4848

49-
## VSCode
50-
51-
> Repository contain recommended extension.
49+
## NVim
5250

53-
> add `-Dno_zls` to disable zls path change (For example if you are install zls via vscode plugin).
54-
> {style="note"}
51+
> This generate `vscode/{launch.json,tasks.json,settings.json}`
52+
> that can read pluggins in NVim (ex.: overseer, nvim-dap, ..)
5553
5654
1. Create vscode configs.
5755
<code-block lang="bash">
5856
# This generate vscode launch.json with predefined cases
5957
# create or update settings.json
6058
# and set zls path to locally builded
6159
zig build gen-ide -Dide=VSCode
62-
</code-block>
63-
2. Install extension `ziglang.vscode-zig` (or install all recommended)
60+
</code-block>
6461

6562
## Idea
6663

@@ -73,6 +70,19 @@ Need [zigbrains](https://plugins.jetbrains.com/plugin/22456-zigbrains)
7370
zig build gen-ide -Dide=IDEA
7471
</code-block>
7572

73+
## VSCode
74+
75+
> Repository contain recommended extension.
76+
77+
1. Create vscode configs.
78+
<code-block lang="bash">
79+
# This generate vscode launch.json with predefined cases
80+
# create or update settings.json
81+
# and set zls path to locally builded
82+
zig build gen-ide -Dide=VSCode
83+
</code-block>
84+
2. Install extension `ziglang.vscode-zig` (or install all recommended)
85+
7686
## Build
7787

7888
<tabs>
@@ -132,27 +142,6 @@ Need [zigbrains](https://plugins.jetbrains.com/plugin/22456-zigbrains)
132142
| `--test-ui-speed` | `fast`, `normal`, `cinematic` | `fast` | UI test speed. |
133143
| `--test-ui-junit` | `str` | `null` | UI test JUnit result filename. |
134144

135-
## ZLS
136-
137-
CETech provide ZLS as submodule, but you must build it.
138-
139-
<tabs>
140-
<tab title="MacOS/Linux">
141-
<code-block lang="bash">
142-
git submodule update --init externals/shared/repo/zls
143-
cd externals/shared/repo/zls
144-
zig build -Doptimize=ReleaseFast
145-
</code-block>
146-
</tab>
147-
<tab title="Windows">
148-
<code-block lang="bash">
149-
git submodule update --init externals/shared/repo/zls
150-
cd externals/shared/repo/zls
151-
zig.exe build -Doptimize=ReleaseFast
152-
</code-block>
153-
</tab>
154-
</tabs>
155-
156145
## Tracy profiler
157146

158147
CETech1 has builtin support for tracy profiler and provide Tracy as submodule, but you must build it first.
-385 KB
Binary file not shown.

externals/shared/fonts/lucide.ttf

796 KB
Binary file not shown.

0 commit comments

Comments
 (0)