mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-22 02:43:12 -04:00
Merge sbb
and blueprint
asset directories (#1498)
## Description This pull request merges `sbb` and `blueprint` directory trees into single directory tree as discussed in #1403 searched twice, once to load blueprint files, once to load sbb zon files. ## Links Related to: #1403 Related to: #1408
This commit is contained in:
parent
bb0289c738
commit
14c7fafce9
@ -86,7 +86,7 @@ pub const Assets = struct {
|
||||
addon.readAllZon(allocator, "biomes", true, &self.biomes, &self.biomeMigrations);
|
||||
addon.readAllZon(allocator, "recipes", false, &self.recipes, null);
|
||||
addon.readAllZon(allocator, "sbb", true, &self.structureBuildingBlocks, null);
|
||||
addon.readAllBlueprints(allocator, &self.blueprints);
|
||||
addon.readAllBlueprints(allocator, "sbb", &self.blueprints);
|
||||
addon.readAllModels(allocator, &self.models);
|
||||
}
|
||||
}
|
||||
@ -227,8 +227,7 @@ pub const Assets = struct {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn readAllBlueprints(addon: Addon, allocator: NeverFailingAllocator, output: *BytesHashMap) void {
|
||||
const subPath = "blueprints";
|
||||
pub fn readAllBlueprints(addon: Addon, allocator: NeverFailingAllocator, subPath: []const u8, output: *BytesHashMap) void {
|
||||
var assetsDirectory = addon.dir.openDir(subPath, .{.iterate = true}) catch |err| {
|
||||
if(err != error.FileNotFound) {
|
||||
std.log.err("Could not open addon directory {s}: {s}", .{subPath, @errorName(err)});
|
||||
|
Loading…
x
Reference in New Issue
Block a user