2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-23 13:12:06 +00:00

WIP: Converted custom map linker into different asset files

This commit is contained in:
LJW-Dev
2025-10-24 02:56:17 +08:00
parent a81944a7be
commit 948ba5ba8b
15 changed files with 1255 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#include "SkinnedVertsLinker.h"
namespace BSP
{
SkinnedVertsLinker::SkinnedVertsLinker(MemoryManager& memory, ISearchPath& searchPath, AssetCreationContext& context)
: m_memory(memory),
m_search_path(searchPath),
m_context(context)
{
}
AssetCreationResult SkinnedVertsLinker::linkSkinnedVerts(BSPData* bsp)
{
std::string assetName = "skinnedverts";
// I'm pretty sure maxSkinnedVerts relates to the max amount of xmodel skinned verts a map will have
// But setting it to the world vertex count seems to work
SkinnedVertsDef* skinnedVerts = m_memory.Alloc<SkinnedVertsDef>();
skinnedVerts->name = m_memory.Dup(assetName.c_str());
skinnedVerts->maxSkinnedVerts = static_cast<unsigned int>(bsp->gfxWorld.vertices.size());
auto skinnedVertsAsset = m_context.AddAsset<AssetSkinnedVerts>(assetName, skinnedVerts);
return AssetCreationResult::Success(skinnedVertsAsset);
}
}