From 054b41da9575c3bce82279e3d89560198e0a8766 Mon Sep 17 00:00:00 2001 From: Peter Li Date: Sat, 1 Nov 2025 15:25:49 -0700 Subject: [PATCH] fixed up toolbox.zig --- engine/rend/src/png.zig | 4 ++-- engine/rend/src/sgpu/TextureList.zig | 2 +- projects/tools/toolbox/animationStore.zig | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/engine/rend/src/png.zig b/engine/rend/src/png.zig index 1b5a5d7..27724bd 100644 --- a/engine/rend/src/png.zig +++ b/engine/rend/src/png.zig @@ -27,7 +27,7 @@ pub const PngContents = struct { return pngContents; } - pub fn initFromFSCooked(fs: *core.FileSystem, allocator: std.mem.Allocator, path: []const u8) !@This() { + pub fn initFromFSCooked(fs: *core.PackerFS, allocator: std.mem.Allocator, path: []const u8) !@This() { const mapping = try fs.loadFile(path); defer fs.unmap(mapping); @@ -55,7 +55,7 @@ pub const PngContents = struct { return buffer; } - pub fn initFromFS(fs: *core.FileSystem, allocator: std.mem.Allocator, path: []const u8) !@This() { + pub fn initFromFS(fs: *core.PackerFS, allocator: std.mem.Allocator, path: []const u8) !@This() { // 1. check the fs to see if a cooked version of the file exists // 2. load that one if possible // 3. otherwise, load the other one. diff --git a/engine/rend/src/sgpu/TextureList.zig b/engine/rend/src/sgpu/TextureList.zig index 28b1375..a090a18 100644 --- a/engine/rend/src/sgpu/TextureList.zig +++ b/engine/rend/src/sgpu/TextureList.zig @@ -74,7 +74,7 @@ pub fn uploadCubeFromPaths(self: *@This(), name: core.Name, paths: []const []con var textureSize: u32 = 0; for (paths) |path| { - try cubeList.append(self.allocator, try core.png.PngContents.initFromFS(core.fs(), self.allocator, path)); + try cubeList.append(self.allocator, try rend.png.PngContents.initFromFS(core.fs(), self.allocator, path)); const png = &cubeList.items[cubeList.items.len - 1]; const cmd = self.device.acquireGPUCommandBuffer(); diff --git a/projects/tools/toolbox/animationStore.zig b/projects/tools/toolbox/animationStore.zig index bd1bf29..0b77f27 100644 --- a/projects/tools/toolbox/animationStore.zig +++ b/projects/tools/toolbox/animationStore.zig @@ -55,7 +55,7 @@ pub fn create(allocator: std.mem.Allocator) !*@This() { } pub fn setupCallbacks(self: *@This()) !void { - core.fs().watchPath("content/"); + platform.watchPath("content/"); try core.fs().addAnyWatchCallback(fileChangedCallback, self); } @@ -161,4 +161,5 @@ const sys = api.sys; const zgltf = core.zgltf; const assets = api.assets; const cook = assets.cook; +const platform = api.platform; const extras = @import("gameExtras");