brush rendering is now completely client-side. the server only receives edits the client would like to do, in the form of PNG images of chunks, that are then composited onto the wall known issue: it is possible to brush up against the current 256 chunk edit limit pretty easily. I'm not sure it can be solved very easily though. the perfect solution would involve splitting up the interaction into multiple edits, and I tried to do that, but there's a noticable stutter for some reason that I haven't managed to track down yet. so it'll be kinda crap for the time being.
53 lines
1.3 KiB
Zig
53 lines
1.3 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
// Library
|
|
|
|
const mod = b.createModule(.{
|
|
.root_source_file = b.path("src/haku2.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.pic = true,
|
|
});
|
|
|
|
const mod_wasm = b.createModule(.{
|
|
.root_source_file = b.path("src/haku2.zig"),
|
|
.target = b.resolveTargetQuery(.{
|
|
.cpu_arch = .wasm32,
|
|
.os_tag = .freestanding,
|
|
}),
|
|
.optimize = optimize,
|
|
});
|
|
const exe_wasm = b.addExecutable(.{
|
|
.linkage = .static,
|
|
.name = "haku2",
|
|
.root_module = mod_wasm,
|
|
});
|
|
exe_wasm.entry = .disabled;
|
|
exe_wasm.rdynamic = true;
|
|
b.installArtifact(exe_wasm);
|
|
|
|
// Tests
|
|
|
|
const lib_unit_tests = b.addTest(.{
|
|
.root_module = mod,
|
|
});
|
|
|
|
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
|
|
|
const test_step = b.step("test", "Run unit tests");
|
|
test_step.dependOn(&run_lib_unit_tests.step);
|
|
|
|
// Checks
|
|
|
|
const lib_check = b.addLibrary(.{
|
|
.linkage = .static,
|
|
.name = "haku2_check",
|
|
.root_module = mod,
|
|
});
|
|
const check_step = b.step("check", "Check if the project compiles");
|
|
check_step.dependOn(&lib_check.step);
|
|
}
|