2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-16 04:17:03 +00:00

bug fixes with MP1's spec

This commit is contained in:
Jack Andersen
2015-07-11 18:26:26 -10:00
parent c1f4f31e6f
commit 975429f3c6
8 changed files with 37 additions and 26 deletions

View File

@@ -14,6 +14,8 @@ namespace DNAMP1
class PAK : public BigDNA
{
public:
DECL_EXPLICIT_DNA
struct NameEntry : public BigDNA
{
DECL_DNA
@@ -33,15 +35,11 @@ public:
Value<atUint32> offset;
};
private:
std::vector<NameEntry> m_nameEntries;
std::vector<Entry> m_entries;
std::unordered_map<UniqueID32, Entry*> m_idMap;
std::unordered_map<std::string, Entry*> m_nameMap;
public:
DECL_EXPLICIT_DNA
inline const Entry* lookupEntry(const UniqueID32& id) const
{
std::unordered_map<UniqueID32, Entry*>::const_iterator result = m_idMap.find(id);
@@ -57,9 +55,6 @@ public:
return result->second;
return nullptr;
}
inline std::vector<Entry>::iterator begin() {return m_entries.begin();}
inline std::vector<Entry>::iterator end() {return m_entries.end();}
};
}