Split reader into metadata/assets

This commit is contained in:
Riyyi
2026-08-09 16:39:43 +02:00
parent 78ba36ae07
commit 4035ff48f3
4 changed files with 186 additions and 186 deletions
+12 -29
View File
@@ -25,37 +25,20 @@ main :: proc() {
w := chunks.writer_init(cast(u64)len(entries))
defer chunks.writer_destroy(&w)
// chunks.write_assets(
// &w,
// opts.output,
// entries[:],
// opts.size,
// opts.compression,
// )
//
// chunks.write_metadata(
// &w,
// opts.output,
// entries[:],
// opts.size,
// opts.compression,
// )
header, err := chunks.read_header_by_path("./build/CHUNK0")
chunk0, o_err := os.open("./build/CHUNK0")
asset_index, a_err := chunks.read_asset_index(chunk0, header)
fmt.println(
"found: ",
chunks.file_exists(header, asset_index, "not_exists"),
)
fmt.println(
"found: ",
chunks.file_exists(header, asset_index, "./toby/engage"),
chunks.write_assets(
&w,
opts.output,
entries[:],
opts.size,
opts.compression,
)
fmt.printf(
"file: %c\n",
chunks.read_file(header, asset_index, opts.output, "./toby/engage"),
chunks.write_metadata(
&w,
opts.output,
entries[:],
opts.size,
opts.compression,
)
}