Skip to content

Commit 52e095e

Browse files
committed
WIP: Cleanup and upgrade ZBGFX, ZNFDE, ZFlecs, ZGUI, FontAwesome => Lucide
1 parent 8711923 commit 52e095e

1,495 files changed

Lines changed: 316103 additions & 83531 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
.{
2+
.tasks = .{
3+
.{ .name = "Build", .type = "shell", .command = "zig", .args = .{"build"} },
4+
.{ .name = "Format", .type = "shell", .command = "zig", .args = .{ "fmt", ".", "--exlude", "externals/" } },
5+
},
6+
27
.launchers = .{
38
.{ .name = "Unit tests", .program = .{ .path = "zig-out/bin/cetech1_test" }, .args = .{} },
49
.{ .name = "No asset root", .args = .{} },

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
22
Version 2, December 2004
33

4-
Copyright (C) 2024-2025 Ondra Voves
4+
Copyright (C) 2024-2026 Ondra Voves
55

66
Everyone is permitted to copy and distribute verbatim or modified
77
copies of this license document, and changing it is allowed as long

build.zig

Lines changed: 24 additions & 20 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,
@@ -357,7 +364,7 @@ pub fn build(b: *std.Build) !void {
357364

358365
// const copy_tool = b.addExecutable(.{
359366
// .name = "copy",
360-
// .root_source_file = .{ .path = "tools/copy.zig" },
367+
// .root_source_file = .{ .path = "src/tools/copy.zig" },
361368
// .target = target,
362369
// });
363370

@@ -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
//
@@ -588,7 +591,7 @@ pub fn build(b: *std.Build) !void {
588591
.name = "cetech1_kernel",
589592
.version = cetech1_version,
590593
.root_module = b.createModule(.{
591-
.root_source_file = b.path("src/private.zig"),
594+
.root_source_file = b.path("src/kernel/private.zig"),
592595
.target = target,
593596
.optimize = optimize,
594597
}),
@@ -607,7 +610,7 @@ pub fn build(b: *std.Build) !void {
607610
}
608611

609612
const kernel_module = b.addModule("kernel", .{
610-
.root_source_file = b.path("src/private.zig"),
613+
.root_source_file = b.path("src/kernel/private.zig"),
611614
.imports = &imports,
612615
});
613616

@@ -617,7 +620,7 @@ pub fn build(b: *std.Build) !void {
617620
const editor_exe = try createStudioExe(
618621
b,
619622
"cetech1",
620-
b.path("src/main.zig"),
623+
b.path("src/kernel/main.zig"),
621624
kernel_module,
622625
kernel_lib,
623626
cetech1_version,
@@ -633,7 +636,7 @@ pub fn build(b: *std.Build) !void {
633636
const runner_exe = try createRunnerExe(
634637
b,
635638
"cetech1",
636-
b.path("src/main.zig"),
639+
b.path("src/kernel/main.zig"),
637640
kernel_module,
638641
kernel_lib,
639642
cetech1_version,
@@ -649,12 +652,13 @@ pub fn build(b: *std.Build) !void {
649652
const tests = b.addTest(.{
650653
.name = "cetech1_test",
651654
.root_module = b.createModule(.{
652-
.root_source_file = b.path("src/tests.zig"),
655+
.root_source_file = b.path("src/kernel/tests.zig"),
653656
.target = target,
654657
.optimize = optimize,
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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
.fingerprint = 0x999557f3ebfaa97a,
66
.paths = .{
77
"docs",
8-
"src",
8+
"kernel",
99
"public",
1010
"modules",
11-
"tests",
1211
"externals",
1312
"fixtures",
1413

@@ -106,8 +105,8 @@
106105

107106
// zig-gamedev
108107
.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",
108+
.url = "https://github.com/zig-gamedev/system_sdk/archive/777e76828f05d5d223df47a4c0de95ae4efde884.tar.gz",
109+
.hash = "system_sdk-0.3.0-dev-alwUNqAaaALJ5VoZImZo3n6prezBnQnrpziun3ZeZwcp",
111110
.lazy = true,
112111
},
113112
.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+

0 commit comments

Comments
 (0)