1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-15 06:06:04 +00:00
oot/tools/ZAPD/ZAPD/ZLimb.h
Dragorn421 4e55168eaa
Update ZAPD (#1569)
* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "094e79734"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "094e79734"
git-subrepo:
  version:  "0.4.6"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "110b9eb"

* Add EnumData.xml where some names are now externalized

* Remove legacy typedefs for zapd, no longer needed!
2023-10-24 21:36:10 -04:00

74 lines
1.9 KiB
C++

#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "OtherStructs/SkinLimbStructs.h"
#include "ZDisplayList.h"
#include "ZFile.h"
enum class ZLimbType
{
Invalid,
Standard,
LOD,
Skin,
Curve,
Legacy,
};
class ZLimbTable;
class ZLimb : public ZResource
{
public:
std::string enumName;
ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete!
ZLimbType type = ZLimbType::Standard;
ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_Null; // Skin only
segptr_t skinSegment = 0; // Skin only
SkinAnimatedLimbData segmentStruct; // Skin only
// Legacy only
float legTransX, legTransY, legTransZ; // Vec3f
uint16_t rotX, rotY, rotZ; // Vec3s
segptr_t childPtr; // LegacyLimb*
segptr_t siblingPtr; // LegacyLimb*
segptr_t dListPtr = 0;
segptr_t dList2Ptr = 0; // LOD and Curve Only
int16_t transX, transY, transZ;
uint8_t childIndex, siblingIndex;
uint8_t limbIndex = 0;
ZLimb(ZFile* nParent);
void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nType);
void ParseXML(tinyxml2::XMLElement* reader) override;
void ParseRawData() override;
void DeclareReferences(const std::string& prefix) override;
std::string GetBodySourceCode() const override;
std::string GetDefaultName(const std::string& prefix) const override;
size_t GetRawDataSize() const override;
std::string GetSourceTypeName() const override;
ZResourceType GetResourceType() const override;
ZLimbType GetLimbType();
void SetLimbType(ZLimbType value);
static const char* GetSourceTypeName(ZLimbType limbType);
static ZLimbType GetTypeByAttributeName(const std::string& attrName);
void SetLimbIndex(uint8_t nLimbIndex);
protected:
void DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix,
const std::string& limbSuffix);
};