update to Zig 2024.1.0-mach

Related to hexops/mach#1145

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-01-14 19:10:17 -07:00
parent 5bea00d997
commit b5531f84cb
5 changed files with 40 additions and 44 deletions

View file

@ -144,7 +144,7 @@ pub fn reserve(self: *Atlas, alloc: Allocator, width: u32, height: u32) !Region
if (width == 0 and height == 0) return region;
// Find the location in our nodes list to insert the new node for this region.
var best_idx: usize = best_idx: {
const best_idx: usize = best_idx: {
var best_height: u32 = std.math.maxInt(u32);
var best_width: u32 = best_height;
var chosen: ?usize = null;
@ -256,11 +256,8 @@ pub fn set(self: *Atlas, reg: Region, data: []const u8) void {
while (i < reg.height) : (i += 1) {
const tex_offset = (((reg.y + i) * self.size) + reg.x) * depth;
const data_offset = i * reg.width * depth;
std.mem.copy(
u8,
self.data[tex_offset..],
data[data_offset .. data_offset + (reg.width * depth)],
);
const src = data[data_offset .. data_offset + (reg.width * depth)];
@memcpy(self.data[tex_offset .. tex_offset + src.len], src);
}
self.modified = true;