2021-01-01 23:24:29 -05:00
|
|
|
#pragma once
|
|
|
|
|
2021-03-14 11:40:25 -04:00
|
|
|
#include <cstdint>
|
2021-03-20 12:02:12 -04:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2021-03-14 11:40:25 -04:00
|
|
|
#include "ZDisplayList.h"
|
2021-03-20 12:02:12 -04:00
|
|
|
#include "ZFile.h"
|
2021-03-14 11:40:25 -04:00
|
|
|
#include "ZLimb.h"
|
2021-01-01 23:24:29 -05:00
|
|
|
|
|
|
|
enum ZSkeletonType
|
|
|
|
{
|
|
|
|
Normal,
|
2021-03-20 12:02:12 -04:00
|
|
|
Flex,
|
|
|
|
Curve,
|
2021-01-01 23:24:29 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
class ZSkeleton : public ZResource
|
|
|
|
{
|
|
|
|
public:
|
2021-03-14 11:40:25 -04:00
|
|
|
ZSkeletonType type = ZSkeletonType::Normal;
|
|
|
|
ZLimbType limbType = ZLimbType::Standard;
|
|
|
|
std::vector<ZLimb*> limbs;
|
|
|
|
segptr_t limbsArrayAddress;
|
|
|
|
uint8_t limbCount;
|
2021-03-20 12:02:12 -04:00
|
|
|
uint8_t dListCount; // FLEX SKELETON ONLY
|
2021-01-01 23:24:29 -05:00
|
|
|
|
2021-03-20 12:02:12 -04:00
|
|
|
ZSkeleton() = default;
|
|
|
|
ZSkeleton(tinyxml2::XMLElement* reader, const std::vector<uint8_t>& nRawData, int nRawDataIndex,
|
|
|
|
ZFile* nParent);
|
|
|
|
ZSkeleton(ZSkeletonType nType, ZLimbType nLimbType, const std::string& prefix,
|
|
|
|
const std::vector<uint8_t>& nRawData, int nRawDataIndex, ZFile* nParent);
|
2021-03-14 11:40:25 -04:00
|
|
|
~ZSkeleton();
|
|
|
|
void ParseXML(tinyxml2::XMLElement* reader) override;
|
|
|
|
void ParseRawData() override;
|
2021-03-20 12:02:12 -04:00
|
|
|
static ZSkeleton* FromXML(tinyxml2::XMLElement* reader, std::vector<uint8_t> nRawData,
|
|
|
|
int rawDataIndex, std::string nRelPath, ZFile* nParent);
|
2021-01-22 16:25:08 -05:00
|
|
|
void Save(const std::string& outFolder) override;
|
2021-03-14 11:40:25 -04:00
|
|
|
void GenerateHLIntermediette(HLFileIntermediette& hlFile) override;
|
2021-01-01 23:24:29 -05:00
|
|
|
|
2021-03-14 11:40:25 -04:00
|
|
|
int GetRawDataSize() override;
|
2021-01-22 16:25:08 -05:00
|
|
|
std::string GetSourceOutputCode(const std::string& prefix) override;
|
2021-03-14 11:40:25 -04:00
|
|
|
|
|
|
|
std::string GetSourceTypeName() override;
|
|
|
|
ZResourceType GetResourceType() override;
|
|
|
|
|
|
|
|
segptr_t GetAddress();
|
2021-03-20 12:02:12 -04:00
|
|
|
uint8_t GetLimbCount();
|
2021-01-08 19:38:28 -05:00
|
|
|
};
|