Add new audio objects for loading sounds

This commit is contained in:
Ted John committed 2022-05-23 22:24:56 +01:00
1 parent 697fa7c436
commit a2e6691ac2
46 files changed
+1583 -1152

No files matched your search

+15
View File
@@ -303,6 +303,21 @@ uint64_t ObjectAsset::GetSize() const
return 0;
}
std::vector<uint8_t> ObjectAsset::GetData() const
{
if (_zipPath.empty())
{
return File::ReadAllBytes(_path);
}
auto zipArchive = Zip::TryOpen(_zipPath, ZIP_ACCESS::READ);
if (zipArchive != nullptr)
{
return zipArchive->GetFileData(_path);
}
return {};
}
std::unique_ptr<IStream> ObjectAsset::GetStream() const
{
if (_zipPath.empty())