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:
26
src/ObjLoading/Game/T6/BSP/Linker/SkinnedVertsLinker.cpp
Normal file
26
src/ObjLoading/Game/T6/BSP/Linker/SkinnedVertsLinker.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user