mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-14 02:50:23 +00:00
* copy over the xml * Rename anims * A bunch of renames * minor extract_assets fixes * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "820678b4e" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "820678b4e" git-subrepo: version: "0.4.3" origin: "???" commit: "???" * Change rgb5a1 to rgba16 * eye and eyebrows * some dlists * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "6be9af65d" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "6be9af65d" git-subrepo: version: "0.4.3" origin: "???" commit: "???"
68 lines
1.3 KiB
C++
68 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <string>
|
|
#include <vector>
|
|
#include "ZResource.h"
|
|
#include "tinyxml2.h"
|
|
|
|
enum class ZScalarType
|
|
{
|
|
ZSCALAR_NONE,
|
|
ZSCALAR_S8,
|
|
ZSCALAR_U8,
|
|
ZSCALAR_X8,
|
|
ZSCALAR_S16,
|
|
ZSCALAR_U16,
|
|
ZSCALAR_X16,
|
|
ZSCALAR_S32,
|
|
ZSCALAR_U32,
|
|
ZSCALAR_X32,
|
|
ZSCALAR_S64,
|
|
ZSCALAR_U64,
|
|
ZSCALAR_X64,
|
|
ZSCALAR_F32,
|
|
ZSCALAR_F64
|
|
};
|
|
|
|
typedef union ZScalarData
|
|
{
|
|
uint8_t u8;
|
|
int8_t s8;
|
|
uint16_t u16;
|
|
int16_t s16;
|
|
uint32_t u32;
|
|
int32_t s32;
|
|
uint64_t u64;
|
|
int64_t s64;
|
|
float f32;
|
|
double f64;
|
|
} ZScalarData;
|
|
|
|
class ZScalar : public ZResource
|
|
{
|
|
friend class ZVector;
|
|
|
|
public:
|
|
ZScalar(ZFile* nParent);
|
|
ZScalar(const ZScalarType scalarType, ZFile* nParent);
|
|
|
|
void ParseRawData() override;
|
|
void ParseXML(tinyxml2::XMLElement* reader) override;
|
|
std::string GetBodySourceCode() const override;
|
|
std::string GetSourceOutputCode(const std::string& prefix) override;
|
|
|
|
bool DoesSupportArray() const override;
|
|
std::string GetSourceTypeName() const override;
|
|
ZResourceType GetResourceType() const override;
|
|
|
|
size_t GetRawDataSize() const override;
|
|
|
|
static size_t MapTypeToSize(const ZScalarType scalarType);
|
|
static ZScalarType MapOutputTypeToScalarType(const std::string& type);
|
|
static std::string MapScalarTypeToOutputType(const ZScalarType scalarType);
|
|
|
|
protected:
|
|
ZScalarData scalarData;
|
|
ZScalarType scalarType;
|
|
};
|