Skip to content

Commit e50fed1

Browse files
committed
Update resources module
1 parent 8cb291a commit e50fed1

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .engine,
3-
.version = "0.14.5",
3+
.version = "0.14.6",
44
.fingerprint = 0xe8a81a8d0aa558d5,
55
.minimum_zig_version = "0.16.0",
66
.dependencies = .{

src/engine.zig

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ pub fn Display(comptime T: type) type {
472472
while (i.next()) |x| {
473473
if (x.value_ptr.*.references > 0) {
474474
warn("texture was not deallocated. {f} has {d} references", .{
475-
uid_writer(u64, x.key_ptr.*),
475+
base62.writer(u64, x.key_ptr.*),
476476
x.value_ptr.*.references,
477477
});
478478
}
@@ -963,13 +963,13 @@ pub fn Display(comptime T: type) type {
963963
ti.references -= 1;
964964
if (ti.references != 0) {
965965
if (ti.references < 0) {
966-
err("free texture \"{f}\" (duplicate free)", .{uid_writer(u64, ti.uid)});
966+
err("free texture \"{f}\" (duplicate free)", .{base62.writer(u64, ti.uid)});
967967
} else {
968-
trace("free texture \"{f}\" (not yet {d})", .{ uid_writer(u64, ti.uid), ti.references });
968+
trace("free texture \"{f}\" (not yet {d})", .{ base62.writer(u64, ti.uid), ti.references });
969969
}
970970
return;
971971
}
972-
trace("free texture \"{f}\" (now)", .{uid_writer(u64, ti.uid)});
972+
trace("free texture \"{f}\" (now)", .{base62.writer(u64, ti.uid)});
973973
_ = self.textures.remove(ti.uid);
974974
ti.destroy(allocator);
975975
}
@@ -2087,7 +2087,13 @@ pub fn Display(comptime T: type) type {
20872087
};
20882088
info("making resource bundle: {s}", .{buffer.slice()});
20892089

2090-
display.resources.saveBundle(display.io, buffer.slice(), manifest, .{}, "/tmp") catch |e| {
2090+
display.resources.saveBundle(
2091+
display.io,
2092+
buffer.slice(),
2093+
manifest,
2094+
&.{},
2095+
"/tmp",
2096+
) catch |e| {
20912097
info("save resource bundle failed. {s} {any}", .{ buffer.slice(), e });
20922098
};
20932099
}
@@ -3018,14 +3024,13 @@ pub const Translation = @import("translation.zig").Translation;
30183024
pub const StringBucket = @import("string_bucket.zig").StringBucket;
30193025
pub const TextSize = @import("text_size.zig").TextSize;
30203026

3021-
const uid_writer = @import("resources").base62.uid_writer;
3027+
const base62 = @import("resources").base62;
30223028
const Resources = @import("resources").Resources;
30233029
const Resource = @import("resources").Resource;
30243030
const FileType = @import("resources").FileType;
30253031

30263032
const random = praxis.random;
30273033
const seed = random.seed;
3028-
const random_string = random.randm_string;
30293034

30303035
pub const Background = @import("entity.zig").Background;
30313036
pub const Clip = @import("entity.zig").Clip;

0 commit comments

Comments
 (0)