diff options
Diffstat (limited to 'src/util/asset_manager.cc')
| -rw-r--r-- | src/util/asset_manager.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util/asset_manager.cc b/src/util/asset_manager.cc index 82c07be..aef67f3 100644 --- a/src/util/asset_manager.cc +++ b/src/util/asset_manager.cc @@ -120,7 +120,8 @@ const uint8_t* GetAsset(AssetId asset_id, size_t* out_size) { const size_t uncomp = source_record.uncompressed_size; uint8_t* buffer = new (std::nothrow) uint8_t[uncomp + 1]; CHECK_RETURN_BEGIN(!buffer, nullptr) - if (out_size) *out_size = 0; + if (out_size) + *out_size = 0; ERROR_MSG("Failed to allocate buffer for ANS-compressed asset id=%u", index); return nullptr; @@ -130,7 +131,8 @@ const uint8_t* GetAsset(AssetId asset_id, size_t* out_size) { &got, GetAnsAsciiHistogram()) || got != uncomp) { delete[] buffer; - if (out_size) *out_size = 0; + if (out_size) + *out_size = 0; ERROR_MSG("ANS decode failed for asset id=%u", index); return nullptr; } @@ -139,7 +141,8 @@ const uint8_t* GetAsset(AssetId asset_id, size_t* out_size) { cached_record.size = uncomp; cached_record.uncompressed_size = uncomp; g_asset_cache[index] = cached_record; - if (out_size) *out_size = uncomp; + if (out_size) + *out_size = uncomp; return buffer; } @@ -279,9 +282,8 @@ bool ReloadAssetsFromFile(const char* config_path) { const AssetRecord& e = g_asset_cache[i]; if (e.data && (e.type == AssetType::PROC || e.type == AssetType::PROC_GPU || - e.compression != AssetCompression::NONE || - e.type == AssetType::SPEC || e.type == AssetType::MP3 || - e.type == AssetType::WGSL)) { + e.compression != AssetCompression::NONE || e.type == AssetType::SPEC || + e.type == AssetType::MP3 || e.type == AssetType::WGSL)) { delete[] e.data; } g_asset_cache[i] = {}; |
