Get a little metaprogrammy
Use FourCCObject template classes to provide magic type
This commit is contained in:
parent
e700c3432d
commit
d244d5e3c2
|
@ -8,7 +8,8 @@ namespace jmmt {
|
|||
|
||||
template <class TMagic, TMagic ValidMagic>
|
||||
struct BasicStructureWithMagic {
|
||||
constexpr static TMagic TypeMagic = ValidMagic;
|
||||
using MagicType = TMagic;
|
||||
constexpr static MagicType TypeMagic = ValidMagic;
|
||||
};
|
||||
|
||||
template <uint32_t ValidMagic>
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace jmmt {
|
|||
};
|
||||
|
||||
struct PackageGroup : public FourCCMagic<0x50524750 /* 'PGRP' */> {
|
||||
uint32_t magic;
|
||||
MagicType magic;
|
||||
uint32_t groupNameCrc;
|
||||
|
||||
uint32_t fileCount;
|
||||
|
@ -30,7 +30,7 @@ namespace jmmt {
|
|||
};
|
||||
|
||||
struct PackageFile : public FourCCMagic<0x4C494650 /* 'PFIL' */> {
|
||||
uint32_t magic;
|
||||
MagicType magic;
|
||||
uint32_t unk[2]; // Don't know what these are?
|
||||
|
||||
// Sequence number of the chunk.
|
||||
|
|
Loading…
Reference in New Issue