feat: add audio system
This commit is contained in:
@@ -142,6 +142,22 @@ void AssetFS::Mount(std::string scheme, std::filesystem::path root) {
|
||||
mounts.push_back(std::move(mount));
|
||||
}
|
||||
|
||||
void AssetFS::ReloadManifest(std::string_view scheme) {
|
||||
for (FSMount& mount : mounts) {
|
||||
if (mount.scheme != scheme) {
|
||||
continue;
|
||||
}
|
||||
const std::filesystem::path manifestPath = mount.root / "manifest.json";
|
||||
std::error_code error;
|
||||
mount.manifest.reset();
|
||||
if (std::filesystem::is_regular_file(manifestPath, error)) {
|
||||
mount.manifest = FS::LoadAssetManifest(manifestPath);
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw std::runtime_error("asset mount not found: " + std::string{scheme});
|
||||
}
|
||||
|
||||
std::vector<uint8_t> AssetFS::ReadBytes(std::string_view vpath) {
|
||||
return ReadFile(GetFullPath(vpath));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user