summaryrefslogtreecommitdiff
path: root/src/util/asset_manager.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-05-21 08:10:47 +0200
committerskal <pascal.massimino@gmail.com>2026-05-21 08:10:47 +0200
commitd806027dcaeadcdd8d2febd88bc46b2fd2c465de (patch)
tree30bc1ef9f40ccab7c00e31ee20e62bb86755fa26 /src/util/asset_manager.cc
parent680042a18c11ad5e58757e45b260745c2f52417f (diff)
style: apply clang-formatHEADmain
Diffstat (limited to 'src/util/asset_manager.cc')
-rw-r--r--src/util/asset_manager.cc14
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] = {};