2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 18:27:42 +00:00

various implementation

This commit is contained in:
Jack Andersen
2015-08-22 20:42:29 -10:00
parent 6577d4ca13
commit f3b5b9f49a
45 changed files with 580 additions and 84 deletions

View File

@@ -18,15 +18,15 @@ typedef Athena::io::DNA<Athena::BigEndian> BigDNA;
typedef Athena::io::DNAYaml<Athena::BigEndian> BigYAML;
/* FourCC with DNA read/write */
class FourCC final : public BigYAML, public HECL::FourCC
class DNAFourCC final : public BigYAML, public HECL::FourCC
{
public:
FourCC() : HECL::FourCC() {}
FourCC(const HECL::FourCC& other)
DNAFourCC() : HECL::FourCC() {}
DNAFourCC(const HECL::FourCC& other)
: HECL::FourCC() {num = other.toUint32();}
FourCC(const char* name)
DNAFourCC(const char* name)
: HECL::FourCC(name) {}
FourCC(uint32_t n)
DNAFourCC(uint32_t n)
: HECL::FourCC(n) {}
Delete expl;
@@ -40,6 +40,8 @@ public:
{writer.writeString(nullptr, std::string(fcc, 4));}
};
using FourCC = HECL::FourCC;
/* PAK 32-bit Unique ID */
class UniqueID32 : public BigYAML
{
@@ -243,9 +245,9 @@ typedef std::function<bool(const HECL::ProjectPath&, const HECL::ProjectPath&)>
namespace std
{
template<>
struct hash<Retro::FourCC>
struct hash<Retro::DNAFourCC>
{
inline size_t operator()(const Retro::FourCC& fcc) const
inline size_t operator()(const Retro::DNAFourCC& fcc) const
{return fcc.toUint32();}
};