Skip to content

Commit

Permalink
update interface. std.StringHashMap([] const u8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ousttrue committed Oct 5, 2024
1 parent 4d017b6 commit 706a24a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deps/sokol_samples/draco/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export fn init() void {
gltf_fetcher.fetch_gltf(load_file, &on_gltf) catch @panic("fetch_gltf");
}

fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin:?[]const u8) void {
fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin: std.StringHashMap([]const u8)) void {
state.gltf = gltf;
std.debug.print("{s}\n", .{gltf.value});
state.scene.load(gltf, bin) catch |e| {
Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/glb/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export fn init() void {
gltf_fetcher.fetch_gltf(load_file, &on_gltf) catch @panic("fetch_gltf");
}

fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin:?[]const u8) void {
fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin: std.StringHashMap([]const u8)) void {
state.gltf = gltf;
state.scene.load(gltf, bin) catch |e| {
std.debug.print("{s}\n", .{@errorName(e)});
Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/gltf/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export fn init() void {
gltf_fetcher.fetch_gltf(load_file, &on_gltf) catch @panic("fetch_gltf");
}

fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin:?[]const u8) void {
fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin: std.StringHashMap([]const u8)) void {
state.gltf = gltf;
std.debug.print("{s}\n", .{gltf.value});
state.scene.load(gltf, bin) catch |e| {
Expand Down
4 changes: 2 additions & 2 deletions deps/sokol_samples/sample_framework/Scene.zig
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn deinit(self: *@This()) void {
pub fn load(
self: *@This(),
json: std.json.Parsed(zigltf.Gltf),
binmap: std.StringHashMap([]const u8),
binmap: ?std.StringHashMap([]const u8),
) !void {
std.debug.print("{s}\n", .{json.value});
self.gltf = json;
Expand All @@ -77,7 +77,7 @@ pub fn load(
var gltf_buffer = zigltf.GltfBuffer.init(
self.allocator,
gltf,
binmap,
binmap orelse std.StringHashMap([]const u8).init(self.allocator),
);
defer gltf_buffer.deinit();

Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/tutorials/animation/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export fn init() void {
};

// build
state.scene.load(parsed, &.{}) catch |e| {
state.scene.load(parsed, null) catch |e| {
std.debug.print("{s}\n", .{@errorName(e)});
@panic("Scene.load");
};
Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/tutorials/minimal/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export fn init() void {
};

// build
state.scene.load(parsed, &.{}) catch |e| {
state.scene.load(parsed, null) catch |e| {
std.debug.print("{s}\n", .{@errorName(e)});
@panic("Scene.load");
};
Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/tutorials/simple_material/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export fn init() void {
};

// build
state.scene.load(parsed, &.{}) catch |e| {
state.scene.load(parsed, null) catch |e| {
std.debug.print("{s}\n", .{@errorName(e)});
@panic("Scene.load");
};
Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/tutorials/simple_meshes/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export fn init() void {
};

// build
state.scene.load(parsed, &.{}) catch |e| {
state.scene.load(parsed, null) catch |e| {
std.debug.print("{s}\n", .{@errorName(e)});
@panic("Scene.load");
};
Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/tutorials/sparse/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export fn init() void {
};

// build
state.scene.load(parsed, &.{}) catch |e| {
state.scene.load(parsed, null) catch |e| {
std.debug.print("{s}\n", .{@errorName(e)});
@panic("Scene.load");
};
Expand Down
2 changes: 1 addition & 1 deletion deps/sokol_samples/vrm0/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export fn init() void {
gltf_fetcher.fetch_gltf(load_file, &on_gltf) catch @panic("fetch_gltf");
}

fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin: ?[]const u8) void {
fn on_gltf(gltf: std.json.Parsed(zigltf.Gltf), bin: std.StringHashMap([]const u8)) void {
state.gltf = gltf;
std.debug.print("{s}\n", .{gltf.value});
state.scene.load(gltf, bin) catch |e| {
Expand Down

0 comments on commit 706a24a

Please sign in to comment.