mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-23 23:41:24 +00:00
git subrepo pull --force tools/ZAPD (#727)
subrepo: subdir: "tools/ZAPD" merged: "4751db5c9" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "4751db5c9" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596"
This commit is contained in:
parent
77ec4d4916
commit
493bdbc3c6
115 changed files with 16370 additions and 2789 deletions
|
@ -1,35 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include "ZResource.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "Vec3s.h"
|
||||
#include "ZResource.h"
|
||||
#include "ZSkeleton.h"
|
||||
#include "tinyxml2.h"
|
||||
|
||||
struct RotationIndex
|
||||
{
|
||||
//uint16_t transX, transY, transZ;
|
||||
// uint16_t transX, transY, transZ;
|
||||
uint16_t x, y, z;
|
||||
|
||||
RotationIndex(uint16_t nX, uint16_t nY, uint16_t nZ) { x = nX; y = nY; z = nZ; };
|
||||
RotationIndex(uint16_t nX, uint16_t nY, uint16_t nZ)
|
||||
{
|
||||
x = nX;
|
||||
y = nY;
|
||||
z = nZ;
|
||||
};
|
||||
};
|
||||
|
||||
class ZAnimation : public ZResource
|
||||
{
|
||||
public:
|
||||
|
||||
int16_t frameCount;
|
||||
|
||||
ZAnimation();
|
||||
|
||||
std::string GetSourceOutputCode(const std::string& prefix) override;
|
||||
ZResourceType GetResourceType() override;
|
||||
protected:
|
||||
|
||||
virtual void ParseRawData();
|
||||
void Save(const std::string& outFolder);
|
||||
void ParseXML(tinyxml2::XMLElement* reader);
|
||||
protected:
|
||||
virtual void ParseRawData() override;
|
||||
void Save(const std::string& outFolder) override;
|
||||
void ParseXML(tinyxml2::XMLElement* reader) override;
|
||||
};
|
||||
|
||||
class ZNormalAnimation : public ZAnimation
|
||||
|
@ -43,13 +48,15 @@ public:
|
|||
|
||||
ZNormalAnimation();
|
||||
|
||||
std::string GetSourceOutputCode(const std::string& prefix);
|
||||
std::string GetSourceOutputCode(const std::string& prefix) override;
|
||||
int GetRawDataSize() override;
|
||||
|
||||
static ZNormalAnimation* ExtractFromXML(tinyxml2::XMLElement* reader, std::vector<uint8_t> nRawData, int rawDataIndex, const std::string& nRelPath);
|
||||
static ZNormalAnimation* ExtractFromXML(tinyxml2::XMLElement* reader,
|
||||
std::vector<uint8_t> nRawData, int rawDataIndex,
|
||||
const std::string& nRelPath);
|
||||
|
||||
protected:
|
||||
virtual void ParseRawData();
|
||||
virtual void ParseRawData() override;
|
||||
};
|
||||
|
||||
class ZLinkAnimation : public ZAnimation
|
||||
|
@ -59,11 +66,82 @@ public:
|
|||
|
||||
ZLinkAnimation();
|
||||
|
||||
std::string GetSourceOutputCode(const std::string& prefix);
|
||||
std::string GetSourceOutputCode(const std::string& prefix) override;
|
||||
int GetRawDataSize() override;
|
||||
|
||||
static ZLinkAnimation* ExtractFromXML(tinyxml2::XMLElement* reader, std::vector<uint8_t> nRawData, int rawDataIndex, const std::string& nRelPath);
|
||||
static ZLinkAnimation* ExtractFromXML(tinyxml2::XMLElement* reader,
|
||||
std::vector<uint8_t> nRawData, int rawDataIndex,
|
||||
const std::string& nRelPath);
|
||||
|
||||
protected:
|
||||
virtual void ParseRawData();
|
||||
virtual void ParseRawData() override;
|
||||
};
|
||||
|
||||
class TransformData
|
||||
{
|
||||
protected:
|
||||
ZFile* parent;
|
||||
|
||||
///* 0x0000 */ u16 unk_00; // appears to be flags
|
||||
uint16_t unk_00;
|
||||
///* 0x0002 */ s16 unk_02;
|
||||
int16_t unk_02;
|
||||
///* 0x0004 */ s16 unk_04;
|
||||
int16_t unk_04;
|
||||
///* 0x0006 */ s16 unk_06;
|
||||
int16_t unk_06;
|
||||
///* 0x0008 */ f32 unk_08;
|
||||
float unk_08;
|
||||
|
||||
public:
|
||||
TransformData() = default;
|
||||
TransformData(ZFile* parent, const std::vector<uint8_t>& rawData, uint32_t fileOffset);
|
||||
TransformData(ZFile* parent, const std::vector<uint8_t>& rawData, uint32_t fileOffset,
|
||||
size_t index);
|
||||
|
||||
[[nodiscard]] std::string GetBody(const std::string& prefix) const;
|
||||
|
||||
static size_t GetRawDataSize();
|
||||
static std::string GetSourceTypeName();
|
||||
};
|
||||
|
||||
class ZCurveAnimation : public ZAnimation
|
||||
{
|
||||
protected:
|
||||
segptr_t skelOffset = 0;
|
||||
|
||||
///* 0x0000 */ u8* refIndex;
|
||||
segptr_t refIndex = 0;
|
||||
///* 0x0004 */ TransformData* transformData;
|
||||
segptr_t transformData = 0;
|
||||
///* 0x0008 */ s16* copyValues;
|
||||
segptr_t copyValues = 0;
|
||||
///* 0x000C */ s16 unk_0C;
|
||||
int16_t unk_0C;
|
||||
///* 0x000E */ s16 unk_10;
|
||||
int16_t unk_10;
|
||||
|
||||
ZSkeleton* skel;
|
||||
|
||||
std::vector<uint8_t> refIndexArr;
|
||||
std::vector<TransformData> transformDataArr;
|
||||
std::vector<int16_t> copyValuesArr;
|
||||
|
||||
public:
|
||||
ZCurveAnimation() = default;
|
||||
ZCurveAnimation(tinyxml2::XMLElement* reader, const std::vector<uint8_t>& nRawData,
|
||||
int nRawDataIndex, ZFile* nParent);
|
||||
~ZCurveAnimation();
|
||||
void ParseXML(tinyxml2::XMLElement* reader) override;
|
||||
void ParseRawData() override;
|
||||
static ZCurveAnimation* ExtractFromXML(tinyxml2::XMLElement* reader,
|
||||
const std::vector<uint8_t>& nRawData, int nRawDataIndex,
|
||||
std::string nRelPath, ZFile* nParent);
|
||||
|
||||
void PreGenValues(const std::string& prefix);
|
||||
int GetRawDataSize() override;
|
||||
std::string GetSourceOutputCode(const std::string& prefix) override;
|
||||
|
||||
std::string GetSourceTypeName() override;
|
||||
};
|
||||
// TransformUpdateIndex
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue