Fix compilation errors
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kayomn 2024-06-23 03:35:16 +01:00
parent bfa3efbb51
commit f0cc66edfa
2 changed files with 8 additions and 4 deletions

View File

@ -24,7 +24,7 @@ pub fn main() !void {
fn load(display: coral.Write(ona.gfx.Display), actors: coral.Write(Actors), assets: coral.Write(ona.gfx.Assets)) !void {
display.res.width, display.res.height = .{1280, 720};
actors.res.body_texture = try assets.res.open_file("actor.bmp");
actors.res.body_texture = try assets.res.open_file(coral.files.bundle, "actor.bmp");
actors.res.quad_mesh_2d = try assets.res.open_quad_mesh_2d(@splat(1));
try actors.res.instances.push_grow(.{0, 0});

View File

@ -4,8 +4,12 @@ const gfx = @import("../gfx.zig");
const std = @import("std");
pub fn bmp_file_desc(arena: *std.heap.ArenaAllocator, path: []const u8) gfx.Assets.Format.Error!gfx.Desc {
const header = try coral.files.bundle.read_little(path, 0, extern struct {
pub fn bmp_file_desc(
arena: *std.heap.ArenaAllocator,
storage: coral.files.Storage,
path: []const u8,
) gfx.Assets.Format.Error!gfx.Desc {
const header = try storage.read_little(path, 0, extern struct {
type: [2]u8 align (1),
file_size: u32 align (1),
reserved: [2]u16 align (1),
@ -47,7 +51,7 @@ pub fn bmp_file_desc(arena: *std.heap.ArenaAllocator, path: []const u8) gfx.Asse
while (buffer_offset < pixels.len) {
const line = pixels[buffer_offset .. buffer_offset + byte_stride];
if (try coral.files.bundle.read_bytes(path, file_offset, line) != byte_stride) {
if (try storage.read_bytes(path, file_offset, line) != byte_stride) {
return error.FormatUnsupported;
}