mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
* imgui * detangle zapdutils * ship namespace * register global factories * readfb * deps * bump submodules * keyframe * bump modules
25 lines
784 B
C++
25 lines
784 B
C++
#include "2s2h/resource/importer/PlayerAnimationFactory.h"
|
|
#include "2s2h/resource/type/PlayerAnimation.h"
|
|
#include "spdlog/spdlog.h"
|
|
|
|
namespace SOH {
|
|
std::shared_ptr<Ship::IResource>
|
|
ResourceFactoryBinaryPlayerAnimationV0::ReadResource(std::shared_ptr<Ship::File> file) {
|
|
if (!FileHasValidFormatAndReader(file)) {
|
|
return nullptr;
|
|
}
|
|
|
|
auto playerAnimation = std::make_shared<PlayerAnimation>(file->InitData);
|
|
auto reader = std::get<std::shared_ptr<Ship::BinaryReader>>(file->Reader);
|
|
|
|
uint32_t numEntries = reader->ReadUInt32();
|
|
playerAnimation->limbRotData.reserve(numEntries);
|
|
|
|
for (uint32_t i = 0; i < numEntries; i++) {
|
|
playerAnimation->limbRotData.push_back(reader->ReadInt16());
|
|
}
|
|
|
|
return playerAnimation;
|
|
}
|
|
} // namespace SOH
|