From ae43a994b96fc49f4c41c9df1b0358ec5b5da4d9 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 23 Apr 2024 00:06:48 +0200 Subject: [PATCH] chore: update usages of AddAsset for template asset struct api --- src/ObjLoading/AssetLoading/AssetLoadingManager.cpp | 3 +-- .../Game/IW3/AssetLoaders/AssetLoaderGfxImage.cpp | 2 +- .../Game/IW3/AssetLoaders/AssetLoaderLocalizeEntry.cpp | 2 +- .../Game/IW3/AssetLoaders/AssetLoaderRawFile.cpp | 2 +- .../Game/IW3/AssetLoaders/AssetLoaderStringTable.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderGfxLightDef.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderLocalizeEntry.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderMaterial.cpp | 4 +++- .../Game/IW4/AssetLoaders/AssetLoaderMenuList.cpp | 7 +++---- .../Game/IW4/AssetLoaders/AssetLoaderPhysPreset.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderPixelShader.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderSndCurve.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderStringTable.cpp | 2 +- .../AssetLoaders/AssetLoaderStructuredDataDefSet.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderTechniqueSet.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderVertexDecl.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderVertexShader.cpp | 2 +- .../Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp | 8 ++------ .../Game/IW5/AssetLoaders/AssetLoaderLocalizeEntry.cpp | 2 +- .../Game/IW5/AssetLoaders/AssetLoaderMenuList.cpp | 7 +++---- .../Game/IW5/AssetLoaders/AssetLoaderRawFile.cpp | 2 +- .../Game/IW5/AssetLoaders/AssetLoaderScriptFile.cpp | 2 +- .../Game/IW5/AssetLoaders/AssetLoaderStringTable.cpp | 2 +- .../Game/IW5/AssetLoaders/AssetLoaderWeapon.cpp | 8 ++------ .../IW5/AssetLoaders/AssetLoaderWeaponAttachment.cpp | 3 +-- .../Game/IW5/Weapon/JsonWeaponAttachmentLoader.cpp | 10 +++++----- .../Game/T5/AssetLoaders/AssetLoaderLocalizeEntry.cpp | 2 +- .../Game/T5/AssetLoaders/AssetLoaderRawFile.cpp | 4 ++-- .../Game/T5/AssetLoaders/AssetLoaderStringTable.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderFontIcon.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderGfxImage.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderLocalizeEntry.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderMaterial.cpp | 2 +- .../T6/AssetLoaders/AssetLoaderPhysConstraints.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderPhysPreset.cpp | 2 +- src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderQdb.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderRawFile.cpp | 4 ++-- .../T6/AssetLoaders/AssetLoaderScriptParseTree.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderSlug.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderStringTable.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderTracer.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderVehicle.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderWeapon.cpp | 8 ++------ .../T6/AssetLoaders/AssetLoaderWeaponAttachment.cpp | 4 ++-- .../AssetLoaders/AssetLoaderWeaponAttachmentUnique.cpp | 8 ++------ .../Game/T6/AssetLoaders/AssetLoaderWeaponCamo.cpp | 2 +- .../Game/T6/AssetLoaders/AssetLoaderZBarrier.cpp | 2 +- 49 files changed, 66 insertions(+), 84 deletions(-) diff --git a/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp b/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp index eb3cb03b..e262e08a 100644 --- a/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp +++ b/src/ObjLoading/AssetLoading/AssetLoadingManager.cpp @@ -50,8 +50,7 @@ XAssetInfoGeneric* AssetLoadingManager::LoadIgnoredDependency(const asset_type_t auto* linkAsset = loader->CreateEmptyAsset(assetName, m_context.m_zone->GetMemory()); if (linkAsset) { - IAssetLoadingManager::AddAsset( - assetType, assetName, linkAsset, std::vector(), std::vector(), std::vector()); + AddAsset(std::make_unique(assetType, assetName, linkAsset)); auto* lastDependency = m_last_dependency_loaded; m_last_dependency_loaded = nullptr; return lastDependency; diff --git a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderGfxImage.cpp b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderGfxImage.cpp index 0beea100..0351f788 100644 --- a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderGfxImage.cpp +++ b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderGfxImage.cpp @@ -127,7 +127,7 @@ bool AssetLoaderGfxImage::LoadFromRaw( } } - manager->AddAsset(ASSET_TYPE_IMAGE, assetName, image); + manager->AddAsset(assetName, image); return true; } diff --git a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderLocalizeEntry.cpp b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderLocalizeEntry.cpp index a6ab6caa..b71c5cf5 100644 --- a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderLocalizeEntry.cpp +++ b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderLocalizeEntry.cpp @@ -29,7 +29,7 @@ bool AssetLoaderLocalizeEntry::LoadFromRaw( localizeEntry->name = memory->Dup(entry.m_key.c_str()); localizeEntry->value = memory->Dup(entry.m_value.c_str()); - manager->AddAsset(ASSET_TYPE_LOCALIZE_ENTRY, entry.m_key, localizeEntry); + manager->AddAsset(entry.m_key, localizeEntry); }); return commonLoader.LoadLocalizeAsset(assetName, searchPath, manager, zone); diff --git a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderRawFile.cpp b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderRawFile.cpp index b14f245e..c865c06e 100644 --- a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderRawFile.cpp +++ b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderRawFile.cpp @@ -38,7 +38,7 @@ bool AssetLoaderRawFile::LoadFromRaw( fileBuffer[rawFile->len] = '\0'; rawFile->buffer = fileBuffer; - manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); + manager->AddAsset(assetName, rawFile); return true; } diff --git a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderStringTable.cpp b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderStringTable.cpp index 895f2b24..972e647f 100644 --- a/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderStringTable.cpp +++ b/src/ObjLoading/Game/IW3/AssetLoaders/AssetLoaderStringTable.cpp @@ -33,7 +33,7 @@ bool AssetLoaderStringTable::LoadFromRaw( string_table::StringTableLoaderV1 loader; auto* stringTable = loader.LoadFromStream(assetName, *memory, *file.m_stream); - manager->AddAsset(ASSET_TYPE_STRINGTABLE, assetName, stringTable); + manager->AddAsset(assetName, stringTable); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxLightDef.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxLightDef.cpp index de01df08..775eb766 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxLightDef.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderGfxLightDef.cpp @@ -66,7 +66,7 @@ bool AssetLoaderGfxLightDef::LoadFromRaw( lightDef->attenuation.image = imageDependency->Asset(); lightDef->lmapLookupStart = static_cast(static_cast(lmapLookupStart)); - manager->AddAsset(ASSET_TYPE_LIGHT_DEF, assetName, lightDef); + manager->AddAsset(assetName, lightDef); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderLocalizeEntry.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderLocalizeEntry.cpp index ea83282c..6d4f596e 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderLocalizeEntry.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderLocalizeEntry.cpp @@ -29,7 +29,7 @@ bool AssetLoaderLocalizeEntry::LoadFromRaw( localizeEntry->name = memory->Dup(entry.m_key.c_str()); localizeEntry->value = memory->Dup(entry.m_value.c_str()); - manager->AddAsset(ASSET_TYPE_LOCALIZE_ENTRY, entry.m_key, localizeEntry); + manager->AddAsset(entry.m_key, localizeEntry); }); return commonLoader.LoadLocalizeAsset(assetName, searchPath, manager, zone); diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMaterial.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMaterial.cpp index 1d9d472f..57efc24f 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMaterial.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMaterial.cpp @@ -1381,7 +1381,9 @@ bool AssetLoaderMaterial::LoadFromGdt( try { if (loader.Load()) - manager->AddAsset(ASSET_TYPE_MATERIAL, assetName, loader.GetMaterial(), loader.GetDependencies(), std::vector()); + { + manager->AddAsset(assetName, loader.GetMaterial(), loader.GetDependencies()); + } } catch (const SkipMaterialException&) { diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMenuList.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMenuList.cpp index dde2b090..1907a41b 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMenuList.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderMenuList.cpp @@ -57,12 +57,11 @@ namespace IW4 } menus.push_back(menuAsset); - auto* menuAssetInfo = - manager->AddAsset(ASSET_TYPE_MENU, menu->m_name, menuAsset, std::move(converter.GetDependencies()), std::vector()); + auto* menuAssetInfo = manager->AddAsset(menu->m_name, menuAsset, std::move(converter.GetDependencies())); if (menuAssetInfo) { - allMenusOfFile.push_back(reinterpret_cast*>(menuAssetInfo)); + allMenusOfFile.push_back(menuAssetInfo); menuListDependencies.push_back(menuAssetInfo); } @@ -223,7 +222,7 @@ bool AssetLoaderMenuList::LoadFromRaw( auto* menuListAsset = MenuLoader::CreateMenuListAsset(assetName, memory, menus); if (menuListAsset) - manager->AddAsset(ASSET_TYPE_MENULIST, assetName, menuListAsset, menuListDependencies, std::vector()); + manager->AddAsset(assetName, menuListAsset, menuListDependencies); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPhysPreset.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPhysPreset.cpp index ac0c581e..30701f60 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPhysPreset.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPhysPreset.cpp @@ -75,7 +75,7 @@ bool AssetLoaderPhysPreset::LoadFromInfoString( CopyFromPhysPresetInfo(presetInfo.get(), physPreset); physPreset->name = memory->Dup(assetName.c_str()); - manager->AddAsset(ASSET_TYPE_PHYSPRESET, assetName, physPreset, converter.GetDependencies(), converter.GetUsedScriptStrings()); + manager->AddAsset(assetName, physPreset, converter.GetDependencies(), converter.GetUsedScriptStrings()); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPixelShader.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPixelShader.cpp index dbedfef6..e034f6da 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPixelShader.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderPixelShader.cpp @@ -57,7 +57,7 @@ bool AssetLoaderPixelShader::LoadFromRaw( return false; pixelShader->prog.loadDef.program = fileBuffer; - manager->AddAsset(ASSET_TYPE_PIXELSHADER, assetName, pixelShader); + manager->AddAsset(assetName, pixelShader); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp index ff79965f..20db51ad 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderRawFile.cpp @@ -74,7 +74,7 @@ bool AssetLoaderRawFile::LoadFromRaw( deflateEnd(&zs); - manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); + manager->AddAsset(assetName, rawFile); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderSndCurve.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderSndCurve.cpp index c657d8c7..53822d4a 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderSndCurve.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderSndCurve.cpp @@ -73,7 +73,7 @@ bool AssetLoaderSndCurve::LoadFromRaw( } } - manager->AddAsset(ASSET_TYPE_SOUND_CURVE, assetName, sndCurve); + manager->AddAsset(assetName, sndCurve); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStringTable.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStringTable.cpp index e7335004..08121661 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStringTable.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStringTable.cpp @@ -34,7 +34,7 @@ bool AssetLoaderStringTable::LoadFromRaw( string_table::StringTableLoaderV2 loader; auto* stringTable = loader.LoadFromStream(assetName, *memory, *file.m_stream); - manager->AddAsset(ASSET_TYPE_STRINGTABLE, assetName, stringTable); + manager->AddAsset(assetName, stringTable); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStructuredDataDefSet.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStructuredDataDefSet.cpp index 36068ca8..ee5c8183 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStructuredDataDefSet.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderStructuredDataDefSet.cpp @@ -214,7 +214,7 @@ bool AssetLoaderStructuredDataDefSet::LoadFromRaw( const auto defs = reader.ReadStructureDataDefs(readingDefsSuccessful); if (readingDefsSuccessful) - manager->AddAsset(ASSET_TYPE_STRUCTURED_DATA_DEF, assetName, ConvertSet(assetName, defs, memory)); + manager->AddAsset(assetName, ConvertSet(assetName, defs, memory)); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderTechniqueSet.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderTechniqueSet.cpp index e51a7a3b..c7b330ec 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderTechniqueSet.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderTechniqueSet.cpp @@ -1329,7 +1329,7 @@ bool AssetLoaderTechniqueSet::CreateTechsetFromDefinition( } } - manager->AddAsset(ASSET_TYPE_TECHNIQUE_SET, assetName, techset, std::vector(dependencies.begin(), dependencies.end()), std::vector()); + manager->AddAsset(assetName, techset, std::vector(dependencies.begin(), dependencies.end())); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexDecl.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexDecl.cpp index 65fff5cb..8f616e49 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexDecl.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexDecl.cpp @@ -96,6 +96,6 @@ bool AssetLoaderVertexDecl::LoadFromRaw( auto* allocatedDecl = memory->Create(decl); - manager->AddAsset(ASSET_TYPE_VERTEXDECL, assetName, allocatedDecl); + manager->AddAsset(assetName, allocatedDecl); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexShader.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexShader.cpp index 94f22f90..07df2b0a 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexShader.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderVertexShader.cpp @@ -57,7 +57,7 @@ bool AssetLoaderVertexShader::LoadFromRaw( return false; vertexShader->prog.loadDef.program = fileBuffer; - manager->AddAsset(ASSET_TYPE_VERTEXSHADER, assetName, vertexShader); + manager->AddAsset(assetName, vertexShader); return true; } diff --git a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp index c7221d1d..eb74d699 100644 --- a/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp +++ b/src/ObjLoading/Game/IW4/AssetLoaders/AssetLoaderWeapon.cpp @@ -387,12 +387,8 @@ namespace CalculateWeaponFields(weaponFullDef, memory); - manager->AddAsset(ASSET_TYPE_WEAPON, - assetName, - &weaponFullDef->weapCompleteDef, - converter.GetDependencies(), - converter.GetUsedScriptStrings(), - converter.GetIndirectAssetReferences()); + manager->AddAsset( + assetName, &weaponFullDef->weapCompleteDef, converter.GetDependencies(), converter.GetUsedScriptStrings(), converter.GetIndirectAssetReferences()); return true; } diff --git a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderLocalizeEntry.cpp b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderLocalizeEntry.cpp index ac6d39e1..94f9a42e 100644 --- a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderLocalizeEntry.cpp +++ b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderLocalizeEntry.cpp @@ -29,7 +29,7 @@ bool AssetLoaderLocalizeEntry::LoadFromRaw( localizeEntry->name = memory->Dup(entry.m_key.c_str()); localizeEntry->value = memory->Dup(entry.m_value.c_str()); - manager->AddAsset(ASSET_TYPE_LOCALIZE_ENTRY, entry.m_key, localizeEntry); + manager->AddAsset(entry.m_key, localizeEntry); }); return commonLoader.LoadLocalizeAsset(assetName, searchPath, manager, zone); diff --git a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderMenuList.cpp b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderMenuList.cpp index 62071db0..8a0ba21e 100644 --- a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderMenuList.cpp +++ b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderMenuList.cpp @@ -57,12 +57,11 @@ namespace IW5 } menus.push_back(menuAsset); - auto* menuAssetInfo = - manager->AddAsset(ASSET_TYPE_MENU, menu->m_name, menuAsset, std::move(converter.GetDependencies()), std::vector()); + auto* menuAssetInfo = manager->AddAsset(menu->m_name, menuAsset, std::move(converter.GetDependencies())); if (menuAssetInfo) { - allMenusOfFile.push_back(reinterpret_cast*>(menuAssetInfo)); + allMenusOfFile.push_back(menuAssetInfo); menuListDependencies.push_back(menuAssetInfo); } @@ -223,7 +222,7 @@ bool AssetLoaderMenuList::LoadFromRaw( auto* menuListAsset = MenuLoader::CreateMenuListAsset(assetName, memory, menus); if (menuListAsset) - manager->AddAsset(ASSET_TYPE_MENULIST, assetName, menuListAsset, menuListDependencies, std::vector()); + manager->AddAsset(assetName, menuListAsset, menuListDependencies); return true; } diff --git a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderRawFile.cpp b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderRawFile.cpp index d29eb61c..b1a9a0a7 100644 --- a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderRawFile.cpp +++ b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderRawFile.cpp @@ -74,7 +74,7 @@ bool AssetLoaderRawFile::LoadFromRaw( deflateEnd(&zs); - manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); + manager->AddAsset(assetName, rawFile); return true; } diff --git a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderScriptFile.cpp b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderScriptFile.cpp index c1e84af7..84d4a8bb 100644 --- a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderScriptFile.cpp +++ b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderScriptFile.cpp @@ -72,7 +72,7 @@ bool AssetLoaderScriptFile::LoadFromRaw( scriptFile->bytecode = memory->Alloc(scriptFile->bytecodeLen); memcpy(scriptFile->bytecode, fileBuffer.get() + offset, scriptFile->bytecodeLen); - manager->AddAsset(ASSET_TYPE_SCRIPTFILE, assetName, scriptFile); + manager->AddAsset(assetName, scriptFile); return true; } diff --git a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderStringTable.cpp b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderStringTable.cpp index ece65461..c91eceb9 100644 --- a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderStringTable.cpp +++ b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderStringTable.cpp @@ -34,7 +34,7 @@ bool AssetLoaderStringTable::LoadFromRaw( string_table::StringTableLoaderV2 loader; auto* stringTable = loader.LoadFromStream(assetName, *memory, *file.m_stream); - manager->AddAsset(ASSET_TYPE_STRINGTABLE, assetName, stringTable); + manager->AddAsset(assetName, stringTable); return true; } diff --git a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeapon.cpp b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeapon.cpp index c81441a0..06e73bf3 100644 --- a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeapon.cpp +++ b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeapon.cpp @@ -817,12 +817,8 @@ namespace CalculateWeaponFields(weaponFullDef, memory); - manager->AddAsset(ASSET_TYPE_WEAPON, - assetName, - &weaponFullDef->weapCompleteDef, - converter.GetDependencies(), - converter.GetUsedScriptStrings(), - converter.GetIndirectAssetReferences()); + manager->AddAsset( + assetName, &weaponFullDef->weapCompleteDef, converter.GetDependencies(), converter.GetUsedScriptStrings(), converter.GetIndirectAssetReferences()); return true; } diff --git a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeaponAttachment.cpp b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeaponAttachment.cpp index 8545be21..0d04b56d 100644 --- a/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeaponAttachment.cpp +++ b/src/ObjLoading/Game/IW5/AssetLoaders/AssetLoaderWeaponAttachment.cpp @@ -37,8 +37,7 @@ bool AssetLoaderWeaponAttachment::LoadFromRaw( std::vector dependencies; std::vector indirectAssetReferences; if (LoadWeaponAttachmentAsJson(*file.m_stream, *attachment, memory, manager, dependencies, indirectAssetReferences)) - manager->AddAsset( - ASSET_TYPE_ATTACHMENT, assetName, attachment, std::move(dependencies), std::vector(), std::move(indirectAssetReferences)); + manager->AddAsset(assetName, attachment, std::move(dependencies), std::vector(), std::move(indirectAssetReferences)); else std::cerr << "Failed to load attachment \"" << assetName << "\"\n"; diff --git a/src/ObjLoading/Game/IW5/Weapon/JsonWeaponAttachmentLoader.cpp b/src/ObjLoading/Game/IW5/Weapon/JsonWeaponAttachmentLoader.cpp index ab35dff4..5957ba83 100644 --- a/src/ObjLoading/Game/IW5/Weapon/JsonWeaponAttachmentLoader.cpp +++ b/src/ObjLoading/Game/IW5/Weapon/JsonWeaponAttachmentLoader.cpp @@ -120,7 +120,7 @@ namespace bool CreateTracerFromJson(const std::string& assetName, TracerDef*& tracerPtr, const WeaponAttachment& attachment) const { - auto* tracer = static_cast*>(m_manager.LoadDependency(ASSET_TYPE_TRACER, assetName)); + auto* tracer = m_manager.LoadDependency(assetName); if (!tracer) { PrintError(attachment, std::format("Could not find tracer {}", assetName)); @@ -134,7 +134,7 @@ namespace bool CreateMaterialFromJson(const std::string& assetName, Material*& materialPtr, const WeaponAttachment& attachment) const { - auto* material = static_cast*>(m_manager.LoadDependency(ASSET_TYPE_MATERIAL, assetName)); + auto* material = m_manager.LoadDependency(assetName); if (!material) { PrintError(attachment, std::format("Could not find material {}", assetName)); @@ -148,7 +148,7 @@ namespace bool CreateFxFromJson(const std::string& assetName, FxEffectDef*& fxPtr, const WeaponAttachment& attachment) const { - auto* fx = static_cast*>(m_manager.LoadDependency(ASSET_TYPE_FX, assetName)); + auto* fx = m_manager.LoadDependency(assetName); if (!fx) { PrintError(attachment, std::format("Could not find fx {}", assetName)); @@ -162,7 +162,7 @@ namespace bool CreateSoundFromJson(const std::string& assetName, SndAliasCustom& sndAliasCustom, const WeaponAttachment& attachment) const { - auto sound = m_manager.LoadIndirectAssetReference(ASSET_TYPE_SOUND, assetName); + auto sound = m_manager.LoadIndirectAssetReference(assetName); m_indirect_asset_references.push_back(std::move(sound)); sndAliasCustom.name = m_memory.Alloc(); sndAliasCustom.name->soundName = m_memory.Dup(assetName.c_str()); @@ -172,7 +172,7 @@ namespace bool CreateXModelFromJson(const std::string& assetName, XModel*& xmodelPtr, const WeaponAttachment& attachment) const { - auto* xmodel = static_cast*>(m_manager.LoadDependency(ASSET_TYPE_XMODEL, assetName)); + auto* xmodel = m_manager.LoadDependency(assetName); if (!xmodel) { PrintError(attachment, std::format("Could not find xmodel {}", assetName)); diff --git a/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderLocalizeEntry.cpp b/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderLocalizeEntry.cpp index 091d217f..720af58a 100644 --- a/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderLocalizeEntry.cpp +++ b/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderLocalizeEntry.cpp @@ -29,7 +29,7 @@ bool AssetLoaderLocalizeEntry::LoadFromRaw( localizeEntry->name = memory->Dup(entry.m_key.c_str()); localizeEntry->value = memory->Dup(entry.m_value.c_str()); - manager->AddAsset(ASSET_TYPE_LOCALIZE_ENTRY, entry.m_key, localizeEntry); + manager->AddAsset(entry.m_key, localizeEntry); }); return commonLoader.LoadLocalizeAsset(assetName, searchPath, manager, zone); diff --git a/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderRawFile.cpp b/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderRawFile.cpp index 682aca7e..53a5ae1a 100644 --- a/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderRawFile.cpp +++ b/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderRawFile.cpp @@ -75,7 +75,7 @@ bool AssetLoaderRawFile::LoadGsc( deflateEnd(&zs); - manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); + manager->AddAsset(assetName, rawFile); return true; } @@ -94,7 +94,7 @@ bool AssetLoaderRawFile::LoadDefault( fileBuffer[rawFile->len] = '\0'; rawFile->buffer = fileBuffer; - manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); + manager->AddAsset(assetName, rawFile); return true; } diff --git a/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderStringTable.cpp b/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderStringTable.cpp index d8785dc7..3d06701e 100644 --- a/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderStringTable.cpp +++ b/src/ObjLoading/Game/T5/AssetLoaders/AssetLoaderStringTable.cpp @@ -33,7 +33,7 @@ bool AssetLoaderStringTable::LoadFromRaw( string_table::StringTableLoaderV3 loader; auto* stringTable = loader.LoadFromStream(assetName, *memory, *file.m_stream); - manager->AddAsset(ASSET_TYPE_STRINGTABLE, assetName, stringTable); + manager->AddAsset(assetName, stringTable); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderFontIcon.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderFontIcon.cpp index b89b4f8c..b355051f 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderFontIcon.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderFontIcon.cpp @@ -265,7 +265,7 @@ bool AssetLoaderFontIcon::LoadFromRaw( else fontIcon->fontIconAlias = nullptr; - manager->AddAsset(ASSET_TYPE_FONTICON, assetName, fontIcon); + manager->AddAsset(assetName, fontIcon); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderGfxImage.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderGfxImage.cpp index 832a10a9..746da931 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderGfxImage.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderGfxImage.cpp @@ -66,7 +66,7 @@ bool AssetLoaderGfxImage::LoadFromRaw( image->streamedParts[0].hash = dataHash & 0x1FFFFFFF; image->streamedPartCount = 1; - manager->AddAsset(ASSET_TYPE_IMAGE, assetName, image); + manager->AddAsset(assetName, image); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderLocalizeEntry.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderLocalizeEntry.cpp index 6dbb3bab..b90d5eb7 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderLocalizeEntry.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderLocalizeEntry.cpp @@ -29,7 +29,7 @@ bool AssetLoaderLocalizeEntry::LoadFromRaw( localizeEntry->name = memory->Dup(entry.m_key.c_str()); localizeEntry->value = memory->Dup(entry.m_value.c_str()); - manager->AddAsset(ASSET_TYPE_LOCALIZE_ENTRY, entry.m_key, localizeEntry); + manager->AddAsset(entry.m_key, localizeEntry); }); return commonLoader.LoadLocalizeAsset(assetName, searchPath, manager, zone); diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderMaterial.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderMaterial.cpp index 1297825f..85e44d9f 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderMaterial.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderMaterial.cpp @@ -51,7 +51,7 @@ bool AssetLoaderMaterial::LoadFromRaw( std::vector dependencies; if (LoadMaterialAsJson(*file.m_stream, *material, memory, manager, dependencies)) - manager->AddAsset(ASSET_TYPE_MATERIAL, assetName, material, std::move(dependencies)); + manager->AddAsset(assetName, material, std::move(dependencies)); else std::cerr << "Failed to load material \"" << assetName << "\"\n"; diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysConstraints.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysConstraints.cpp index ea413091..6dc86ede 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysConstraints.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysConstraints.cpp @@ -95,7 +95,7 @@ bool AssetLoaderPhysConstraints::LoadFromInfoString( auto scrStrings = converter.GetUsedScriptStrings(); scrStrings.push_back(zone->m_script_strings.AddOrGetScriptString("")); - manager->AddAsset(ASSET_TYPE_PHYSCONSTRAINTS, assetName, physConstraints, converter.GetDependencies(), scrStrings); + manager->AddAsset(assetName, physConstraints, converter.GetDependencies(), scrStrings); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysPreset.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysPreset.cpp index bcf315a1..4542953b 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysPreset.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderPhysPreset.cpp @@ -78,7 +78,7 @@ bool AssetLoaderPhysPreset::LoadFromInfoString( CopyFromPhysPresetInfo(presetInfo.get(), physPreset); physPreset->name = memory->Dup(assetName.c_str()); - manager->AddAsset(ASSET_TYPE_PHYSPRESET, assetName, physPreset, converter.GetDependencies(), converter.GetUsedScriptStrings()); + manager->AddAsset(assetName, physPreset, converter.GetDependencies(), converter.GetUsedScriptStrings()); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderQdb.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderQdb.cpp index ca06111c..4366f1d5 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderQdb.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderQdb.cpp @@ -37,7 +37,7 @@ bool AssetLoaderQdb::LoadFromRaw(const std::string& assetName, ISearchPath* sear fileBuffer[qdb->len] = '\0'; qdb->buffer = static_cast(fileBuffer); - manager->AddAsset(ASSET_TYPE_QDB, assetName, qdb); + manager->AddAsset(assetName, qdb); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp index 7e71a2d5..6e652691 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderRawFile.cpp @@ -74,7 +74,7 @@ bool AssetLoaderRawFile::LoadAnimtree( deflateEnd(&zs); - manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); + manager->AddAsset(assetName, rawFile); return true; } @@ -93,7 +93,7 @@ bool AssetLoaderRawFile::LoadDefault( fileBuffer[rawFile->len] = '\0'; rawFile->buffer = static_cast(fileBuffer); - manager->AddAsset(ASSET_TYPE_RAWFILE, assetName, rawFile); + manager->AddAsset(assetName, rawFile); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderScriptParseTree.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderScriptParseTree.cpp index f82218b4..822567c6 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderScriptParseTree.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderScriptParseTree.cpp @@ -38,7 +38,7 @@ bool AssetLoaderScriptParseTree::LoadFromRaw( fileBuffer[scriptParseTree->len] = '\0'; scriptParseTree->buffer = static_cast(fileBuffer); - manager->AddAsset(ASSET_TYPE_SCRIPTPARSETREE, assetName, scriptParseTree); + manager->AddAsset(assetName, scriptParseTree); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSlug.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSlug.cpp index 263ab4b0..5a6dac42 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSlug.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSlug.cpp @@ -37,7 +37,7 @@ bool AssetLoaderSlug::LoadFromRaw(const std::string& assetName, ISearchPath* sea fileBuffer[slug->len] = '\0'; slug->buffer = static_cast(fileBuffer); - manager->AddAsset(ASSET_TYPE_SLUG, assetName, slug); + manager->AddAsset(assetName, slug); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp index dd7c3074..ad5c4cc8 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderSoundBank.cpp @@ -569,6 +569,6 @@ bool AssetLoaderSoundBank::LoadFromRaw( } } - manager->AddAsset(ASSET_TYPE_SOUND, assetName, sndBank); + manager->AddAsset(assetName, sndBank); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderStringTable.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderStringTable.cpp index e77cc4bb..5c4283f8 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderStringTable.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderStringTable.cpp @@ -33,7 +33,7 @@ bool AssetLoaderStringTable::LoadFromRaw( string_table::StringTableLoaderV3 loader; auto* stringTable = loader.LoadFromStream(assetName, *memory, *file.m_stream); - manager->AddAsset(ASSET_TYPE_STRINGTABLE, assetName, stringTable); + manager->AddAsset(assetName, stringTable); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderTracer.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderTracer.cpp index 96784923..90d21cf2 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderTracer.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderTracer.cpp @@ -61,7 +61,7 @@ bool AssetLoaderTracer::LoadFromInfoString( tracer->name = memory->Dup(assetName.c_str()); - manager->AddAsset(ASSET_TYPE_TRACER, assetName, tracer, converter.GetDependencies(), converter.GetUsedScriptStrings()); + manager->AddAsset(assetName, tracer, converter.GetDependencies(), converter.GetUsedScriptStrings()); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderVehicle.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderVehicle.cpp index 9717b9da..3b935a5c 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderVehicle.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderVehicle.cpp @@ -124,7 +124,7 @@ bool AssetLoaderVehicle::LoadFromInfoString( vehicleDef->name = memory->Dup(assetName.c_str()); - manager->AddAsset(ASSET_TYPE_VEHICLEDEF, assetName, vehicleDef, converter.GetDependencies(), converter.GetUsedScriptStrings()); + manager->AddAsset(assetName, vehicleDef, converter.GetDependencies(), converter.GetUsedScriptStrings()); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeapon.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeapon.cpp index 96f21e6f..6228858a 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeapon.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeapon.cpp @@ -567,12 +567,8 @@ bool AssetLoaderWeapon::LoadFromInfoString( CalculateWeaponFields(weaponFullDef); CalculateAttachmentFields(weaponFullDef); - manager->AddAsset(ASSET_TYPE_WEAPON, - assetName, - &weaponFullDef->weapVariantDef, - converter.GetDependencies(), - converter.GetUsedScriptStrings(), - converter.GetIndirectAssetReferences()); + manager->AddAsset( + assetName, &weaponFullDef->weapVariantDef, converter.GetDependencies(), converter.GetUsedScriptStrings(), converter.GetIndirectAssetReferences()); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachment.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachment.cpp index 5ed03211..8f748a0f 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachment.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachment.cpp @@ -112,8 +112,8 @@ bool AssetLoaderWeaponAttachment::LoadFromInfoString( CalculateAttachmentFields(attachment); attachment->szInternalName = memory->Dup(assetName.c_str()); - manager->AddAsset( - ASSET_TYPE_ATTACHMENT, assetName, attachment, converter.GetDependencies(), converter.GetUsedScriptStrings(), converter.GetIndirectAssetReferences()); + manager->AddAsset( + assetName, attachment, converter.GetDependencies(), converter.GetUsedScriptStrings(), converter.GetIndirectAssetReferences()); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachmentUnique.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachmentUnique.cpp index 1e3cd64a..86ff51fa 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachmentUnique.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponAttachmentUnique.cpp @@ -231,12 +231,8 @@ bool AssetLoaderWeaponAttachmentUnique::LoadFromInfoString( attachmentUniqueFull->attachment.szInternalName = memory->Dup(assetName.c_str()); - manager->AddAsset(ASSET_TYPE_ATTACHMENT_UNIQUE, - assetName, - &attachmentUniqueFull->attachment, - converter.GetDependencies(), - converter.GetUsedScriptStrings(), - converter.GetIndirectAssetReferences()); + manager->AddAsset( + assetName, &attachmentUniqueFull->attachment, converter.GetDependencies(), converter.GetUsedScriptStrings(), converter.GetIndirectAssetReferences()); return true; } diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponCamo.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponCamo.cpp index bec480f8..ac964eb0 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponCamo.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderWeaponCamo.cpp @@ -37,7 +37,7 @@ bool AssetLoaderWeaponCamo::LoadFromRaw( std::vector dependencies; if (LoadWeaponCamoAsJson(*file.m_stream, *weaponCamo, memory, manager, dependencies)) - manager->AddAsset(ASSET_TYPE_WEAPON_CAMO, assetName, weaponCamo, std::move(dependencies)); + manager->AddAsset(assetName, weaponCamo, std::move(dependencies)); else std::cerr << "Failed to load weapon camo \"" << assetName << "\"\n"; diff --git a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderZBarrier.cpp b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderZBarrier.cpp index 5da0f3b3..b8421ae5 100644 --- a/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderZBarrier.cpp +++ b/src/ObjLoading/Game/T6/AssetLoaders/AssetLoaderZBarrier.cpp @@ -74,7 +74,7 @@ bool AssetLoaderZBarrier::LoadFromInfoString( CalculateZBarrierFields(zbarrier); zbarrier->name = memory->Dup(assetName.c_str()); - manager->AddAsset(ASSET_TYPE_ZBARRIER, assetName, zbarrier, converter.GetDependencies(), converter.GetUsedScriptStrings()); + manager->AddAsset(assetName, zbarrier, converter.GetDependencies(), converter.GetUsedScriptStrings()); return true; }