mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-12 05:27:07 -04:00
b2747aa8b4
* git subrepo pull tools/asm-differ --force subrepo: subdir: "tools/asm-differ" merged: "d218cdf0" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "d218cdf0" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "f5fe93d7" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "f5fe93d7" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "e7a8a48c" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "e7a8a48c" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "d14ea084" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "d14ea084" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "e243634e" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "e243634e" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/decomp-permuter --force subrepo: subdir: "tools/decomp-permuter" merged: "d1294dfa0" upstream: origin: "https://github.com/simonlindholm/decomp-permuter.git" branch: "main" commit: "d1294dfa0" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "f5fe93d75" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "f5fe93d75" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "d0cd6b397" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "d0cd6b397" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * add ExternalXMLFolder config * git subrepo pull --force tools/decomp-permuter subrepo: subdir: "tools/decomp-permuter" merged: "a20bac942" upstream: origin: "https://github.com/simonlindholm/decomp-permuter.git" branch: "main" commit: "a20bac942" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "4f7b8393e" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "4f7b8393e" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull --force tools/asm-differ subrepo: subdir: "tools/asm-differ" merged: "f30d43ace" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "f30d43ace" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Remove Segment="128"
152 lines
3.6 KiB
C++
152 lines
3.6 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "ZResource.h"
|
|
|
|
enum class TextureAnimationParamsType
|
|
{
|
|
/* 0 */ SingleScroll,
|
|
/* 1 */ DualScroll,
|
|
/* 2 */ ColorChange,
|
|
/* 3 */ ColorChangeLERP,
|
|
/* 4 */ ColorChangeLagrange,
|
|
/* 5 */ TextureCycle,
|
|
/* 6 */ Empty // An empty TextureAnimation has the form 00 00 00 06 00000000
|
|
};
|
|
|
|
class ZTextureAnimationParams : public ZResource
|
|
{
|
|
public:
|
|
ZTextureAnimationParams(ZFile* parent);
|
|
|
|
void ExtractFromBinary(uint32_t nRawDataIndex);
|
|
virtual void ExtractFromBinary(uint32_t nRawDataIndex, int count);
|
|
|
|
virtual std::string GetDefaultName(const std::string& prefix) const;
|
|
ZResourceType GetResourceType() const;
|
|
|
|
TextureAnimationParamsType type;
|
|
};
|
|
|
|
struct TextureScrollingParamsEntry
|
|
{
|
|
int8_t xStep;
|
|
int8_t yStep;
|
|
uint8_t width;
|
|
uint8_t height;
|
|
};
|
|
|
|
class TextureScrollingParams : public ZTextureAnimationParams
|
|
{
|
|
public:
|
|
TextureScrollingParams(ZFile* parent);
|
|
|
|
void ParseRawData() override;
|
|
void ExtractFromBinary(uint32_t nRawDataIndex, int count) override;
|
|
|
|
std::string GetSourceTypeName() const override;
|
|
std::string GetDefaultName(const std::string& prefix) const override;
|
|
size_t GetRawDataSize() const override;
|
|
|
|
Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override;
|
|
std::string GetBodySourceCode() const override;
|
|
|
|
int count; // 1 for Single, 2 for Dual
|
|
TextureScrollingParamsEntry rows[2]; // Too small to make a vector worth it
|
|
};
|
|
|
|
struct F3DPrimColor
|
|
{
|
|
uint8_t r;
|
|
uint8_t g;
|
|
uint8_t b;
|
|
uint8_t a;
|
|
uint8_t lodFrac;
|
|
};
|
|
|
|
struct F3DEnvColor
|
|
{
|
|
uint8_t r;
|
|
uint8_t g;
|
|
uint8_t b;
|
|
uint8_t a;
|
|
};
|
|
|
|
class TextureColorChangingParams : public ZTextureAnimationParams
|
|
{
|
|
public:
|
|
TextureColorChangingParams(ZFile* parent);
|
|
|
|
void ParseRawData() override;
|
|
|
|
std::string GetSourceTypeName() const override;
|
|
std::string GetDefaultName(const std::string& prefix) const override;
|
|
size_t GetRawDataSize() const override;
|
|
|
|
void DeclareReferences(const std::string& prefix) override;
|
|
|
|
std::string GetBodySourceCode() const override;
|
|
|
|
uint16_t animLength; // size of list for type 2
|
|
uint16_t colorListCount;
|
|
segptr_t primColorListAddress;
|
|
segptr_t envColorListAddress;
|
|
segptr_t frameDataListAddress;
|
|
std::vector<F3DPrimColor> primColorList;
|
|
std::vector<F3DEnvColor> envColorList;
|
|
std::vector<uint16_t> frameDataList;
|
|
};
|
|
|
|
class TextureCyclingParams : public ZTextureAnimationParams
|
|
{
|
|
public:
|
|
TextureCyclingParams(ZFile* parent);
|
|
|
|
void ParseRawData() override;
|
|
|
|
std::string GetSourceTypeName() const override;
|
|
std::string GetDefaultName(const std::string& prefix) const override;
|
|
size_t GetRawDataSize() const override;
|
|
|
|
void DeclareReferences(const std::string& prefix) override;
|
|
|
|
std::string GetBodySourceCode() const override;
|
|
|
|
uint16_t cycleLength;
|
|
segptr_t textureListAddress;
|
|
segptr_t textureIndexListAddress;
|
|
std::vector<segptr_t> textureList;
|
|
std::vector<uint8_t> textureIndexList;
|
|
};
|
|
|
|
struct TextureAnimationEntry
|
|
{
|
|
int8_t segment;
|
|
TextureAnimationParamsType type;
|
|
segptr_t paramsPtr;
|
|
};
|
|
|
|
class ZTextureAnimation : public ZResource
|
|
{
|
|
public:
|
|
ZTextureAnimation(ZFile* nParent);
|
|
|
|
void ParseRawData() override;
|
|
void DeclareReferences(const std::string& prefix) override;
|
|
|
|
std::string GetSourceTypeName() const override;
|
|
ZResourceType GetResourceType() const override;
|
|
size_t GetRawDataSize() const override;
|
|
std::string GetDefaultName(const std::string& prefix) const override;
|
|
|
|
Declaration* DeclareVar(const std::string& prefix, const std::string& bodyStr) override;
|
|
std::string GetBodySourceCode() const override;
|
|
|
|
private:
|
|
std::vector<TextureAnimationEntry> entries;
|
|
};
|