Skip to content

Commit

Permalink
Update to latest master.
Browse files Browse the repository at this point in the history
Felix "xq" Queißner committed May 28, 2022
1 parent f6cbf2a commit 4b57f8a
Showing 5 changed files with 25 additions and 16 deletions.
18 changes: 9 additions & 9 deletions Sdk.zig
Original file line number Diff line number Diff line change
@@ -19,27 +19,27 @@ pub const Platform = union(enum) {
const pkgs = struct {
const zigimg = std.build.Pkg{
.name = "zigimg",
.path = .{ .path = sdkRoot() ++ "/vendor/zigimg/zigimg.zig" },
.source = .{ .path = sdkRoot() ++ "/vendor/zigimg/zigimg.zig" },
};
const ziglyph = std.build.Pkg{
.name = "ziglyph",
.path = .{ .path = sdkRoot() ++ "/vendor/ziglyph/src/ziglyph.zig" },
.source = .{ .path = sdkRoot() ++ "/vendor/ziglyph/src/ziglyph.zig" },
};
const zigstr = std.build.Pkg{
.name = "zigstr",
.path = .{ .path = sdkRoot() ++ "/vendor/zigstr/src/Zigstr.zig" },
.source = .{ .path = sdkRoot() ++ "/vendor/zigstr/src/Zigstr.zig" },
.dependencies = &.{ziglyph},
};
const text_editor = std.build.Pkg{
.name = "TextEditor",
.path = .{ .path = sdkRoot() ++ "/vendor/text-editor/src/TextEditor.zig" },
.source = .{ .path = sdkRoot() ++ "/vendor/text-editor/src/TextEditor.zig" },
.dependencies = &.{ziglyph},
};
};

const zero_graphics_package = std.build.Pkg{
.name = "zero-graphics",
.path = .{ .path = sdkRoot() ++ "/src/zero-graphics.zig" },
.source = .{ .path = sdkRoot() ++ "/src/zero-graphics.zig" },
.dependencies = &[_]std.build.Pkg{
pkgs.zigimg,
pkgs.ziglyph,
@@ -83,7 +83,7 @@ pub fn init(builder: *std.build.Builder, init_android: bool) *Sdk {

sdk.render_main_page_tool.addPackage(.{
.name = "html",
.path = TemplateStep.transform(builder, sdkRoot() ++ "/www/application.ztt"),
.source = TemplateStep.transform(builder, sdkRoot() ++ "/www/application.ztt"),
});

if (sdk.android_sdk) |asdk| {
@@ -100,7 +100,7 @@ pub fn init(builder: *std.build.Builder, init_android: bool) *Sdk {
sdk.dummy_server = builder.addExecutable("http-server", sdkRoot() ++ "/tools/http-server.zig");
sdk.dummy_server.addPackage(std.build.Pkg{
.name = "apple_pie",
.path = .{ .path = sdkRoot() ++ "/vendor/apple_pie/src/apple_pie.zig" },
.source = .{ .path = sdkRoot() ++ "/vendor/apple_pie/src/apple_pie.zig" },
});

return sdk;
@@ -144,7 +144,7 @@ pub fn createApplicationSource(sdk: *Sdk, name: []const u8, root_file: std.build
.packages = std.ArrayList(std.build.Pkg).init(sdk.builder.allocator),
.meta_pkg = std.build.Pkg{
.name = "application-meta",
.path = std.build.FileSource{ .generated = &create_meta_step.outfile },
.source = std.build.FileSource{ .generated = &create_meta_step.outfile },
},
.permissions = std.ArrayList([]const u8).init(sdk.builder.allocator),
};
@@ -232,7 +232,7 @@ pub const Application = struct {
pub fn compileFor(app: *Application, platform: Platform) *AppCompilation {
const app_pkg = app.sdk.builder.dupePkg(std.build.Pkg{
.name = "application",
.path = app.root_file,
.source = app.root_file,
.dependencies = app.packages.items,
});

10 changes: 5 additions & 5 deletions build.zig
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ pub fn build(b: *std.build.Builder) !void {
const zero_init = b.addExecutable("zero-init", "tools/zero-init/main.zig");
zero_init.addPackage(std.build.Pkg{
.name = "args",
.path = .{ .path = "vendor/args/args.zig" },
.source = .{ .path = "vendor/args/args.zig" },
});
zero_init.install();
}
@@ -46,15 +46,15 @@ pub fn build(b: *std.build.Builder) !void {
});
converter.addPackage(std.build.Pkg{
.name = "api",
.path = .{ .generated = &converter_api.output_file },
.source = .{ .generated = &converter_api.output_file },
});
converter.addPackage(std.build.Pkg{
.name = "z3d",
.path = .{ .path = "src/rendering/z3d-format.zig" },
.source = .{ .path = "src/rendering/z3d-format.zig" },
});
converter.addPackage(std.build.Pkg{
.name = "args",
.path = .{ .path = "vendor/args/args.zig" },
.source = .{ .path = "vendor/args/args.zig" },
});
converter.linkLibC();
converter.linkLibCpp();
@@ -69,7 +69,7 @@ pub fn build(b: *std.build.Builder) !void {

app.addPackage(std.build.Pkg{
.name = "zlm",
.path = .{ .path = "vendor/zlm/zlm.zig" },
.source = .{ .path = "vendor/zlm/zlm.zig" },
});

{
9 changes: 9 additions & 0 deletions src/UserInterface.zig
Original file line number Diff line number Diff line change
@@ -667,6 +667,15 @@ pub const Builder = struct {
self.ui.mode = .default;

while (self.ui.retained_widgets.popFirst()) |node| {
if (self.ui.focused_widget == &node.data) {
self.ui.focused_widget = null;
}
if (self.ui.hovered_widget == &node.data) {
self.ui.hovered_widget = null;
}
if (self.ui.pressed_widget == &node.data) {
self.ui.pressed_widget = null;
}
node.data.deinit();
self.ui.freeWidgetNode(node);
}
2 changes: 1 addition & 1 deletion vendor/SDL.zig
2 changes: 1 addition & 1 deletion vendor/ZigAndroidTemplate

0 comments on commit 4b57f8a

Please sign in to comment.