#include "SkeletonFactory.h" #include "../type/Skeleton.h" #include "spdlog/spdlog.h" #include "ResourceUtil.h" namespace SF64 { std::shared_ptr ResourceFactoryBinarySkeletonV0::ReadResource(std::shared_ptr file, std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } auto skel = std::make_shared(initData); auto reader = std::get>(file->Reader); auto count = reader->ReadUInt32(); for(size_t i = 0; i < count; i++) { skel->mLimbs.push_back(LoadChild(reader->ReadUInt64())); } skel->mLimbs.push_back(nullptr); return skel; } } // namespace LUS