Skip to content

Commit 8711923

Browse files
committed
Basic physics via zphysics (jolt), ECS observer, cleanup transform,
cleanup CDBDecl type names, persistent render graph modules, move bloom to module, cleanup modules folder, cleanup math type, split editor to editor and editor_tabs, new asset browser.
1 parent a4781fc commit 8711923

707 files changed

Lines changed: 157410 additions & 28826 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.

.externals.zon

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
.{
22
.externals = .{
3+
.{ .name = "zphysics", .license = "externals/shared/lib/zphysics/LICENSE" },
4+
5+
.{ .name = "glfw", .license = "externals/shared/lib/zglfw/libs/glfw/LICENSE.md" },
36
.{ .name = "zglfw", .license = "externals/shared/lib/zglfw/LICENSE" },
7+
48
.{ .name = "ztracy", .license = "externals/shared/lib/ztracy/LICENSE" },
5-
.{ .name = "zgui", .license = "externals/shared/lib/zgui/LICENSE" },
9+
610
.{ .name = "zflecs", .license = "externals/shared/lib/zflecs/LICENSE" },
11+
.{ .name = "flecs", .license = "externals/shared/lib/zflecs/libs/flecs/LICENSE" },
12+
713
.{ .name = "imgui", .license = "externals/shared/lib/zgui/libs/imgui/LICENSE.txt" },
814
.{ .name = "imgui_test_engine", .license = "externals/shared/lib/zgui/libs/imgui_test_engine/LICENSE.txt" },
915
.{ .name = "implot", .license = "externals/shared/lib/zgui/libs/implot/LICENSE" },
1016
.{ .name = "imguizmo", .license = "externals/shared/lib/zgui/libs/imguizmo/LICENSE" },
1117
.{ .name = "imgui_node_editor", .license = "externals/shared/lib/zgui/libs/node_editor/LICENSE" },
12-
.{ .name = "FLECS", .license = "externals/shared/lib/zflecs/libs/flecs/LICENSE" },
13-
.{ .name = "glfw", .license = "externals/shared/lib/zglfw/libs/glfw/LICENSE.md" },
18+
.{ .name = "zgui", .license = "externals/shared/lib/zgui/LICENSE" },
19+
1420
.{ .name = "SDL_GameControllerDB", .license = "externals/shared/lib/SDL_GameControllerDB/LICENSE" },
1521
.{ .name = "zf", .license = "externals/shared/lib/zf/LICENSE" },
1622
.{ .name = "zig-uuid", .license = "externals/shared/lib/zig-uuid/LICENSE" },
1723
.{ .name = "nativefiledialog-extended", .license = "externals/shared/lib/znfde/nativefiledialog/LICENSE" },
24+
25+
.{ .name = "ziglang-set", .license = "externals/shared/lib/ziglang-set/LICENSE" },
26+
1827
.{ .name = "bgfx", .license = "externals/shared/lib/zbgfx/libs/bgfx/LICENSE" },
1928
.{ .name = "zbgfx", .license = "externals/shared/lib/zbgfx/LICENSE" },
20-
.{ .name = "ziglang-set", .license = "externals/shared/lib/ziglang-set/LICENSE" },
29+
2130
.{ .name = "cetech1", .license = "LICENSE" },
2231
},
2332
}

.gitmodules

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = https://github.com/cyberegoorg/SDL_GameControllerDB.git
44
[submodule "externals/shared/repo/zbgfx"]
55
path = externals/shared/repo/zbgfx
6-
url = https://github.com/cyberegoorg/zbgfx.git
6+
url = https://codeberg.org/cyberegoorg/zbgfx.git
77
[submodule "externals/shared/repo/zf"]
88
path = externals/shared/repo/zf
99
url = https://github.com/cyberegoorg/zf.git
@@ -33,7 +33,10 @@
3333
url = https://github.com/cyberegoorg/ztracy.git
3434
[submodule "externals/shared/repo/znfde"]
3535
path = externals/shared/repo/znfde
36-
url = https://github.com/cyberegoorg/znfde.git
36+
url = https://codeberg.org/cyberegoorg/znfde.git
3737
[submodule "externals/shared/repo/tracy"]
3838
path = externals/shared/repo/tracy
3939
url = https://github.com/wolfpld/tracy.git
40+
[submodule "externals/shared/repo/zphysics"]
41+
path = externals/shared/repo/zphysics
42+
url = https://github.com/cyberegoorg/zphysics.git

.ide.zon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
.launchers = .{
33
.{ .name = "Unit tests", .program = .{ .path = "zig-out/bin/cetech1_test" }, .args = .{} },
44
.{ .name = "No asset root", .args = .{} },
5-
.{ .name = "max 5 tick", .args = .{ "--max-kernel-tick", "5", "--asset-root", "fixtures/test_asset/" } },
6-
.{ .name = "--headless", .args = .{ "--max-kernel-tick", "5", "--asset-root", "fixtures/test_asset/", "--headless" } },
5+
.{ .name = "max 5 tick", .args = .{ "--max-kernel-tick", "5", "--asset-root", "fixtures/test_graph/" } },
6+
.{ .name = "--headless", .args = .{ "--max-kernel-tick", "5", "--asset-root", "fixtures/test_graph/", "--headless" } },
77
.{ .name = "Tests UI", .args = .{"--test-ui"} },
88
.{ .name = "Tests UI (headless)", .args = .{ "--test-ui", "--headless", "--test-ui-junit", "./result.xml" } },
9-
.{ .name = "(Vulkan)", .args = .{ "--asset-root", "fixtures/test_asset/", "--renderer", "bgfx_vulkan" } },
9+
.{ .name = "(Vulkan)", .args = .{ "--asset-root", "fixtures/test_graph/", "--renderer", "bgfx_vulkan" } },
1010
},
1111
}

build.zig

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,12 @@ pub fn build(b: *std.Build) !void {
313313
.{
314314
.target = target,
315315
.optimize = options.externals_optimize,
316-
.backend = .glfw,
316+
.backend = .glfw, // TODO: move to module
317317
.with_implot = true,
318318
.with_gizmo = true,
319319
.with_node_editor = true,
320320
.with_te = true,
321321
.with_freetype = options.with_freetype,
322-
// .disable_obsolete = false
323322
},
324323
);
325324

@@ -338,6 +337,8 @@ pub fn build(b: *std.Build) !void {
338337
.{
339338
.target = target,
340339
.optimize = options.externals_optimize,
340+
.keep_assert = optimize == .Debug,
341+
.soft_assert = optimize == .Debug,
341342
},
342343
);
343344

@@ -473,7 +474,8 @@ pub fn build(b: *std.Build) !void {
473474
//
474475
const gen_ide_step = b.step("gen-ide", "init/update IDE configs");
475476
{
476-
const ide = b.option(generate_ide.EditorType, "ide", "IDE for gen-ide command") orelse .vscode;
477+
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;
477479

478480
const gen_ide = b.addRunArtifact(generate_ide_tool);
479481

@@ -491,6 +493,10 @@ pub fn build(b: *std.Build) !void {
491493
gen_ide.addArg("--config");
492494
gen_ide.addDirectoryArg(b.path(".ide.zon"));
493495

496+
if (no_zls) {
497+
gen_ide.addArg("--no-zls");
498+
}
499+
494500
gen_ide_step.dependOn(&gen_ide.step);
495501
}
496502

@@ -713,13 +719,13 @@ fn ensureZigVersion() !void {
713719

714720
pub const studio_modules = [_][]const u8{
715721
"editor",
716-
"editor_asset",
722+
"editor_tabs",
723+
"editor_assetdb",
717724
"editor_asset_browser",
718725
"editor_explorer",
719726
"editor_fixtures",
720727
"editor_inspector",
721728
"editor_obj_buffer",
722-
"editor_tags",
723729
"editor_tree",
724730
"editor_log",
725731
"editor_graph",
@@ -748,8 +754,8 @@ pub const core_modules = [_][]const u8{
748754
"default_render_pipeline",
749755
"shader_system",
750756
"render_component",
751-
"graphvm_logic_component",
752-
"native_logic_component",
757+
"graphvm_script_component",
758+
"native_script_component",
753759
"transform",
754760
"camera",
755761
"camera_controller",
@@ -759,6 +765,9 @@ pub const core_modules = [_][]const u8{
759765
"light_component",
760766
"light_system",
761767
"physics",
768+
"physics_jolt",
769+
"bloom",
770+
"tonemap",
762771
};
763772

764773
pub const samples_modules = [_][]const u8{

build.zig.zon

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030

3131
// EDITOR
3232
.editor = .{ .path = "modules/editor/editor", .lazy = true },
33-
.editor_asset = .{ .path = "modules/editor/asset", .lazy = true },
33+
.editor_tabs = .{ .path = "modules/editor/tabs", .lazy = true },
34+
.editor_assetdb = .{ .path = "modules/editor/assetdb", .lazy = true },
3435
.editor_asset_browser = .{ .path = "modules/editor/asset_browser", .lazy = true },
3536
.editor_explorer = .{ .path = "modules/editor/explorer", .lazy = true },
3637
.editor_fixtures = .{ .path = "modules/editor/fixtures", .lazy = true },
3738
.editor_inspector = .{ .path = "modules/editor/inspector", .lazy = true },
3839
.editor_obj_buffer = .{ .path = "modules/editor/obj_buffer", .lazy = true },
39-
.editor_tags = .{ .path = "modules/editor/tags", .lazy = true },
4040
.editor_tree = .{ .path = "modules/editor/tree", .lazy = true },
4141
.editor_log = .{ .path = "modules/editor/log", .lazy = true },
4242
.editor_graph = .{ .path = "modules/editor/graph", .lazy = true },
@@ -54,33 +54,42 @@
5454

5555
// PHYSICS
5656
.physics = .{ .path = "modules/physics/physics", .lazy = true },
57+
.physics_jolt = .{ .path = "modules/physics/physics_jolt", .lazy = true },
5758

5859
// INPUT
5960
.actions = .{ .path = "modules/input/actions", .lazy = true },
6061

6162
// SCRIPTING
6263
.graphvm = .{ .path = "modules/scripting/graphvm", .lazy = true },
63-
.graphvm_logic_component = .{ .path = "modules/scripting/graphvm_logic_component", .lazy = true },
64-
.native_logic_component = .{ .path = "modules/scripting/native_logic_component", .lazy = true },
64+
.graphvm_script_component = .{ .path = "modules/scripting/graphvm_script_component", .lazy = true },
65+
.native_script_component = .{ .path = "modules/scripting/native_script_component", .lazy = true },
66+
.renderer_nodes = .{ .path = "modules/scripting/renderer_nodes", .lazy = true },
67+
68+
// TRANSFORM
69+
.transform = .{ .path = "modules/transform", .lazy = true },
70+
71+
// CAMERA
72+
.camera = .{ .path = "modules/camera/camera", .lazy = true },
73+
.camera_controller = .{ .path = "modules/camera/camera_controller", .lazy = true },
6574

6675
// RENDERING
67-
.default_render_pipeline = .{ .path = "modules/rendering/default_render_pipeline", .lazy = true },
6876
.render_pipeline = .{ .path = "modules/rendering/render_pipeline", .lazy = true },
6977
.render_viewport = .{ .path = "modules/rendering/render_viewport", .lazy = true },
7078
.render_graph = .{ .path = "modules/rendering/render_graph", .lazy = true },
7179
.shader_system = .{ .path = "modules/rendering/shader_system", .lazy = true },
72-
.transform = .{ .path = "modules/rendering/transform", .lazy = true },
73-
.camera = .{ .path = "modules/rendering/camera", .lazy = true },
74-
.camera_controller = .{ .path = "modules/rendering/camera_controller", .lazy = true },
75-
.render_component = .{ .path = "modules/rendering/render_component", .lazy = true },
76-
.vertex_system = .{ .path = "modules/rendering/vertex_system", .lazy = true },
77-
.instance_system = .{ .path = "modules/rendering/instance_system", .lazy = true },
78-
.renderer_nodes = .{ .path = "modules/rendering/renderer_nodes", .lazy = true },
7980
.visibility_flags = .{ .path = "modules/rendering/visibility_flags", .lazy = true },
80-
.light_component = .{ .path = "modules/rendering/light_component", .lazy = true },
81-
.light_system = .{ .path = "modules/rendering/light_system", .lazy = true },
8281
.gpu_bgfx = .{ .path = "modules/rendering/gpu_bgfx", .lazy = true },
8382

83+
// RENDERING PIPELINE
84+
.default_render_pipeline = .{ .path = "modules/render_pipeline/default_render_pipeline", .lazy = true },
85+
.light_system = .{ .path = "modules/render_pipeline/light_system", .lazy = true },
86+
.bloom = .{ .path = "modules/render_pipeline/bloom", .lazy = true },
87+
.tonemap = .{ .path = "modules/render_pipeline/tonemap", .lazy = true },
88+
.light_component = .{ .path = "modules/render_pipeline/light_component", .lazy = true },
89+
.vertex_system = .{ .path = "modules/render_pipeline/vertex_system", .lazy = true },
90+
.instance_system = .{ .path = "modules/render_pipeline/instance_system", .lazy = true },
91+
.render_component = .{ .path = "modules/render_pipeline/render_component", .lazy = true },
92+
8493
// Examples
8594
.foo = .{ .path = "modules/examples/foo", .lazy = true },
8695
.editor_foo_tab = .{ .path = "modules/examples/editor_foo_tab", .lazy = true },
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
git clone https://github.com/cyberegoorg/cetech1.git
1+
git clone https://codeberg.org/cyberegoorg/cetech1.git
22

33
zig build init
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
zig-out/bin/cetech1_test && zig-out/bin/cetech1_studio --asset-root fixtures/test_asset/
1+
zig-out/bin/cetech1_test && zig-out/bin/cetech1_studio --asset-root fixtures/test_graph/
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Desktop mode
2-
zig-out/bin/cetech1_test && zig-out/bin/cetech1_studio --asset-root fixtures/test_asset/
2+
zig-out/bin/cetech1_test && zig-out/bin/cetech1_studio --asset-root fixtures/test_graph/
33

44
# Standalone
5-
zig-out/bin/cetech1_studio --fullscreen --asset-root fixtures/test_asset/
5+
zig-out/bin/cetech1_studio --fullscreen --asset-root fixtures/test_graph/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
zig-out/bin/cetech1_test.exe && zig-out/bin/cetech1_studio.exe --asset-root fixtures/test_asset/
1+
zig-out/bin/cetech1_test.exe && zig-out/bin/cetech1_studio.exe --asset-root fixtures/test_graph/

docs/topics/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# About
22

3-
[CETech1](https://github.com/cyberegoorg/cetech1) is experimental game engine write in awesome language
3+
[CETech1](https://codeberg.org/cyberegoorg/cetech1) is experimental game engine write in awesome language
44
named [zig](https://ziglang.org).
55
Some core features like [AsseDB](assetdb.md), [CDB](cdb.md) and [ApiDB](apidb.md) is based on BitSquid/OurMachinery blog
66
posts.

0 commit comments

Comments
 (0)