forked from rosebudai/OpenRCT2-Web
Add new audio objects for loading sounds
This commit is contained in:
1 parent
697fa7c436
commit
a2e6691ac2
46 files changed
+1583
-1152
No files matched your search
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user