Merge pull request #28 from lioncash/endian

General: Be explicit about athena's Endian type
This commit is contained in:
Phillip Stephens 2019-09-14 08:38:37 -07:00 committed by GitHub
commit e4dcda11b3
4 changed files with 8 additions and 8 deletions

View File

@ -15,7 +15,7 @@ class MemoryReader;
namespace hecl::blender { namespace hecl::blender {
enum class BlendType; enum class BlendType;
struct SDNABlock : public athena::io::DNA<athena::Little> { struct SDNABlock : public athena::io::DNA<athena::Endian::Little> {
AT_DECL_DNA AT_DECL_DNA
DNAFourCC magic; DNAFourCC magic;
DNAFourCC nameMagic; DNAFourCC nameMagic;
@ -31,11 +31,11 @@ struct SDNABlock : public athena::io::DNA<athena::Little> {
Align<4> align3; Align<4> align3;
DNAFourCC strcMagic; DNAFourCC strcMagic;
Value<atUint32> numStrcs; Value<atUint32> numStrcs;
struct SDNAStruct : public athena::io::DNA<athena::Little> { struct SDNAStruct : public athena::io::DNA<athena::Endian::Little> {
AT_DECL_DNA AT_DECL_DNA
Value<atUint16> type; Value<atUint16> type;
Value<atUint16> numFields; Value<atUint16> numFields;
struct SDNAField : public athena::io::DNA<athena::Little> { struct SDNAField : public athena::io::DNA<athena::Endian::Little> {
AT_DECL_DNA AT_DECL_DNA
Value<atUint16> type; Value<atUint16> type;
Value<atUint16> name; Value<atUint16> name;
@ -51,7 +51,7 @@ struct SDNABlock : public athena::io::DNA<athena::Little> {
const SDNAStruct* lookupStruct(const char* n, atUint32& idx) const; const SDNAStruct* lookupStruct(const char* n, atUint32& idx) const;
}; };
struct FileBlock : public athena::io::DNA<athena::Little> { struct FileBlock : public athena::io::DNA<athena::Endian::Little> {
AT_DECL_DNA AT_DECL_DNA
DNAFourCC type; DNAFourCC type;
Value<atUint32> size; Value<atUint32> size;

View File

@ -28,14 +28,14 @@ enum EFlags {
}; };
ENABLE_BITWISE_ENUM(EFlags) ENABLE_BITWISE_ENUM(EFlags)
class CVar : public athena::io::DNA<athena::Big> { class CVar : public athena::io::DNA<athena::Endian::Big> {
public: public:
AT_DECL_DNA AT_DECL_DNA
String<-1> m_name; String<-1> m_name;
String<-1> m_value; String<-1> m_value;
}; };
struct CVarContainer : public athena::io::DNA<athena::Big> { struct CVarContainer : public athena::io::DNA<athena::Endian::Big> {
AT_DECL_DNA AT_DECL_DNA
Value<atUint32> magic = 'CVAR'; Value<atUint32> magic = 'CVAR';
Value<atUint32> cvarCount; Value<atUint32> cvarCount;

View File

@ -53,7 +53,7 @@ public:
}; };
#define FOURCC(chars) FourCC(SBIG(chars)) #define FOURCC(chars) FourCC(SBIG(chars))
using BigDNA = athena::io::DNA<athena::Big>; using BigDNA = athena::io::DNA<athena::Endian::Big>;
/** FourCC with DNA read/write */ /** FourCC with DNA read/write */
class DNAFourCC final : public BigDNA, public FourCC { class DNAFourCC final : public BigDNA, public FourCC {

View File

@ -11,7 +11,7 @@ enum class HMDLTopology : atUint32 {
#define HECL_HMDL_META_SZ 32 #define HECL_HMDL_META_SZ 32
struct HMDLMeta : athena::io::DNA<athena::Big> { struct HMDLMeta : athena::io::DNA<athena::Endian::Big> {
AT_DECL_DNA AT_DECL_DNA
Value<atUint32> magic = 'TACO'; Value<atUint32> magic = 'TACO';
Value<HMDLTopology> topology; Value<HMDLTopology> topology;