1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00

Add new audio objects for loading sounds

This commit is contained in:
Ted John
2022-05-09 18:34:38 +01:00
parent 697fa7c436
commit a2e6691ac2
46 changed files with 1583 additions and 1152 deletions

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())